d0n Posted May 26, 2009 Share Posted May 26, 2009 right now i have this, what i want to do is when i call for the pause func to pause the script, but because its in a loop it dont think its working, is there anyway to achieve this? While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $start Start() Case $msg = $stop Pause() Case $msg = $exit Exit EndSelect WEnd Exit Func Pause() If $Pause = 1 Then $Pause = 0 Elseif $Pause = 0 $Pause = 1 EndIf EndFunc Func Start() While $a < 1 If $Pause = 1 Then Panel() BG() ;Join() Sleep(10000) Elseif $Pause = 0 Then $a = 2 EndIf WEnd EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2009 Moderators Share Posted May 26, 2009 I see you have two other functions as well as what you posted. You'll need to make conditions for the Global $Pause variable in all your functions, checking it periodically to see if it is paused and take an appropriate action then. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Levignot Posted May 26, 2009 Share Posted May 26, 2009 Hi, first sorry about my poor english. If you don't want to check if the program is paused in every loop or function, maybe you can use HotKeySet(), when you want to pause your script use Send() with the key that activate the HotKeySet(), like the HotKeySet is global and works in all script you don't have to worry about where is the script for paused it. I hope it will help you, any doubt you have I'll try to help. Link to comment Share on other sites More sharing options...
d0n Posted May 26, 2009 Author Share Posted May 26, 2009 yea i thought about using hotkeys, but i made a tray menu for this script and hope to have a pause button in it. Link to comment Share on other sites More sharing options...
d0n Posted May 26, 2009 Author Share Posted May 26, 2009 how would i check for something when its running in a loop? i can't even exit with the exit button when its stuck in the loop. And i want it in a loop to do keep on going until i pause or exit the program. Link to comment Share on other sites More sharing options...
d0n Posted May 26, 2009 Author Share Posted May 26, 2009 ok, but my loop goes every 10 second, how would i make it check for pauses within that 10 second? Link to comment Share on other sites More sharing options...
d0n Posted May 26, 2009 Author Share Posted May 26, 2009 nevermind i think i got it now, thanks for the help 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