onefish Posted August 19, 2005 Posted August 19, 2005 Can anybody advise me of the best way to pause a script? I can't seem to fine anything in the help file or reference lists. I have used a counter and a loop that exits the loop after XX times. The more times that longer the pause. This doesn't seem right though. I thought about using the system clock but then the script will be dependant upon that functioning properly. What is the best way?
BigDod Posted August 19, 2005 Posted August 19, 2005 Sleep(5000) ; Sleeps for 5 seconds Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
LxP Posted August 19, 2005 Posted August 19, 2005 And there's also the wait-for-user pause: msgBox(0x40048, "Paused", "Press OK to continue.")
Knight Posted August 19, 2005 Posted August 19, 2005 or if you don't want it paused completely, You can do this. $Pause = TimerInit() Do Sleep(50) Until TimerDiff($Pause) = 5000 That Pauses for 5 seconds as well.
LxP Posted August 19, 2005 Posted August 19, 2005 Just to elaborate on Knight's example: right now it's only equivalent to Sleep(5000) but its beauty lies in its ability to do things during that five seconds:local $pause = timerInit() do sleep(50) ; do some number crunching ; or perhaps search for some files until (timerDiff($pause) = 5000)
pricyber Posted August 29, 2005 Posted August 29, 2005 how to make it so its pause when it hit a key for example F12 and resume when it hit the same key or another key?
Knight Posted August 29, 2005 Posted August 29, 2005 Global $Paused HotKeySet("{PAUSE}", "TogglePause") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc
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