vickerps Posted October 12, 2005 Share Posted October 12, 2005 Hi Is there a way to pause a script for say 60 seconds but if the user presses a key (for example 'Esc') within the 60 seconds the script would abort the pause and continue with what ever left to do in the script. Link to comment Share on other sites More sharing options...
layer Posted October 12, 2005 Share Posted October 12, 2005 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 More sharing options...
jefhal Posted October 12, 2005 Share Posted October 12, 2005 From the FM:Function ReferenceMsgBox --------------------------------------------------------------------------------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 More sharing options...
Christopher Blue Posted October 12, 2005 Share Posted October 12, 2005 (edited) 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 October 12, 2005 by Christopher Blue Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted October 13, 2005 Share Posted October 13, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now