Sign in to follow this  
Followers 0
longxx

how to break/stop Sleep(xxx)?

4 posts in this topic

I need to sleep for long time ( 300 seconds) but if something else happens I want to stop the sleep and start over again,

---what is the command to stop/break the sleeping time? and how to use it?

thanks.

Share this post


Link to post
Share on other sites

Example:

HotKeySet("{esc}","togglepause")
$paused=False

ToolTip("Script Paused",0,0,"Test")

togglepause()

    
MsgBox(0,"","Script continues")

Func togglepause()
    $paused=Not $paused
    While $paused
        Sleep(100)
    WEnd
EndFunc

Share this post


Link to post
Share on other sites

thanks, i got around with this code:

$begin = TimerInit()

while 1

$dif = TimerDiff($begin)

tooltip($dif,0,0)

    if $dif>200000 Then
        XXXXXXX
        $begin = TimerInit()
    EndIf
    sleep(100)
endw

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