AXPER Posted July 31, 2015 Share Posted July 31, 2015 My question is I use sleep timeBut sometimes I want to skip or stop sleep timerfor Using an external buttonAny Help for this codeSorry 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 Link to comment Share on other sites More sharing options...
Danyfirex Posted July 31, 2015 Share Posted July 31, 2015 Use TimerInit and TimerDiff instead. Saludos AXPER 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
xxaviarxx Posted July 31, 2015 Share Posted July 31, 2015 (edited) Or do this :add Global $wait = xxxreplace 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 $button1add under Case $button2 If $wait >= 1 Then $wait = 0 EndIfThat 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 July 31, 2015 by xxaviarxx AXPER 1 Link to comment Share on other sites More sharing options...
AXPER Posted July 31, 2015 Author Share Posted July 31, 2015 Use TimerInit and TimerDiff instead. Saludos Or do this :add Global $wait = xxxreplace 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 $button1add under Case $button2 If $wait >= 1 Then $wait = 0 EndIfThat 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 stopThank you for the idea Link to comment Share on other sites More sharing options...
xxaviarxx Posted July 31, 2015 Share Posted July 31, 2015 No problem hope everything you are trying to do works out for you. 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