Sign in to follow this  
Followers 0
Maxvan1

Starting script at a certain time?

7 posts in this topic

I know I could start a script at a certain time by just timing it with sleep(XXXXXX) But that is not convenient because then I have to do all the math and such to figure out how long it needs to sleep. So, my question is, how can I start a script at a certain time, lets say 12 noon? Is it possible?

Second question, that I can figure out myself, but if someone would like to be kind and answer it quickly (or point me in the right direction) Of how I can minimize a window, so that it is not on the bottom of my page (so that the only way to get it back is winsetstatemaximize) . I did it in my WoW bot, but I copied someone else's script and put my own stuff between the lines. I would think that it is winsetstateminumize but it did not work (I just started working on this, so I am sure I can figure it out but help is always nice :whistle:)

Thanks,

MV1

Share this post


Link to post
Share on other sites



1) Use appropriate English with punctuation. I don't wanna read your thought train/

Answer to your first enquiry:

While @Hour <> 12
   Sleep(60000)
Wend

Just keep sleeping until it is noon. >.<

#)

Share this post


Link to post
Share on other sites

Would you have to somehow read the system time to do that?

Share this post


Link to post
Share on other sites

Would you have to somehow read the system time to do that?

@hour - Retrives the current Hour in 24 hour time format

@min - Retrives the current minute

@Sec - Retrives the current second

And code that tells you if it is 1PM:

While 1
    IF @hour = 13 and @MIN = 0 and @SEC = 0 Then
        MsgBox (0, "HELLO!", "IT's 1:00pm!")
    Else
        Sleep (200)
WEnd

Share this post


Link to post
Share on other sites

EXACTLY what I wanted. Thank you.

Share this post


Link to post
Share on other sites

There are a few approaches in Autoit Wrappers too!

; Time Machine #2
; Hours  & Minutes

; Author Valuater

$start = @HOUR & ":" & @MIN + 2 ; for testing

While 1

    $start2 = @HOUR & ":" & @MIN

    If $start = $start2 Then
        Run("notepad.exe")
        ExitLoop
    EndIf

    ToolTip("Start Time = " & $start & @CRLF & "Real Time = " & $start2, 20, 20, "Time Machine", 1)
    Sleep(2000)

WEnd
Exit

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0