Jump to content

Recommended Posts

Posted

My question is I use sleep time
But sometimes I want to skip or stop sleep timer
for Using an external button
Any Help for this code

Sorry for my poor English

 

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            Case $Button1
            for $i =1 to 12 Step 1
        Sleep (5000)
        Call ("login")
        sleep (600000)
    
        Case $Button2 ; ---> Stop the sleep time

            Next
    EndSwitch
WEnd

 

Posted (edited)

Or do this :

add Global $wait = xxx

replace Sleep(###) with Sleep($wait) and under that add $wait = xxx this makes sure $wait is once again the number it should be next time you press $button1

add under Case $button2  If $wait >= 1 Then $wait = 0 EndIf

That should make $button2 only stop the sleep timer.

XXX = the amount of time you want sleep to execute

### = the sleep(time) which you want to be able to stop

Edited by xxaviarxx
Posted

Use TimerInit and TimerDiff instead.

 

Saludos

 

Or do this :

add Global $wait = xxx

replace Sleep(###) with Sleep($wait) and under that add $wait = xxx this makes sure $wait is once again the number it should be next time you press $button1

add under Case $button2  If $wait >= 1 Then $wait = 0 EndIf

That should make $button2 only stop the sleep timer.

XXX = the amount of time you want sleep to execute

### = the sleep(time) which you want to be able to stop

Thank you for the idea

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
  • Recently Browsing   0 members

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