Jump to content

sleep until


 Share

Recommended Posts

Try this:

HotKeySet("e", "_MyCode")
Sleep(60000)
Func _MyCode()
;Whatever code you want here..
    MsgBox(0, "whatever", "whatever"); don't need the msgbox, just for debugging purposes
    Exit
EndFunc
FootbaG
Link to comment
Share on other sites

From the FM:

Function Reference

MsgBox

--------------------------------------------------------------------------------

Displays a simple message box with optional timeout.

MsgBox ( flag, "title", "text" [, timeout])

msgbox(4096,"Choose","Click when ready",60)
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Try this, it goes in 1-second increments but it is trivial to change that:

HotKeySet("^c", "ContinueFunc")

...

$keepgoing = 0
$timer = 0
Do
   Sleep(1000)
   $timer = $timer + 1
Until($keepgoing Or ($timer = 60))

...

Func ContinueFunc()
   $keepgoing = 1
EndFunc
Edited by Christopher Blue
Link to comment
Share on other sites

From the FM:

msgbox(4096,"Choose","Click when ready",60)

That's the method I would use, however, a little expansion

$i_Return = MsgBox(4096, "Choose", "Click when ready", 60)
 If $i_Return = -1 Then Exit

If MsgBox times out, returns -1, that's where the if-statement comes in, else it will continue the script

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...