stuckors Posted October 4, 2006 Share Posted October 4, 2006 I have made a loop to press 7 and click until i tell it to stop. Problem is I can't figure out how to tell it to exit loop. I use PgDn key to start it and want PgUp key to end it. Help please. Link to comment Share on other sites More sharing options...
Kickassjoe Posted October 4, 2006 Share Posted October 4, 2006 try using ExitLoop, and post the code you are using here, so we can see what you already have done, and then go on from there What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Paulie Posted October 4, 2006 Share Posted October 4, 2006 (edited) I have made a loop to press 7 and click until i tell it to stop. Problem is I can't figure out how to tell it to exit loop. I use PgDn key to start it and want PgUp key to end it. Help please. Direct from the hotkeyset helpfile with minor edits http://www.autoitscript.com/autoit3/docs/f...s/HotKeySet.htm ; Press pgup to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{PgUp}", "Terminate") HotKeySet("{PgDn}", "Start") ;Shift-Alt-d ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func Start() While 1 ;do whatever Wend EndFunc Edited October 4, 2006 by Paulie Link to comment Share on other sites More sharing options...
stuckors Posted October 4, 2006 Author Share Posted October 4, 2006 (edited) I have everything else good except this part. (I want it to exit the loop when i press PgUp) Case $msg = $start Global $Paused HotKeySet("{Pgdn}","start") GUISetState(@SW_Hide) While 1 Sleep(100) WEnd Func start() [b]While 1 Send ("7") MouseClick ("left") WEnd [/b] EndFunc EndSelect I have a gui with some buttons so i can put multiple options in 1 script. Direct from the hotkeyset helpfile with minor edits http://www.autoitscript.com/autoit3/docs/f...s/HotKeySet.htmLooked at that, didn't help. Edited October 4, 2006 by stuckors Link to comment Share on other sites More sharing options...
Paulie Posted October 4, 2006 Share Posted October 4, 2006 I have everything else good except this part. (I want it to exit the loop when i press PgUp) Case $msg = $start Global $Paused HotKeySet("{Pgdn}","start") GUISetState(@SW_Hide) While 1 Sleep(100) WEnd Func start() [b]While 1 Send ("7") MouseClick ("left") WEnd [/b] EndFunc EndSelect I have a gui with some buttons so i can put multiple options in 1 script.Use the 'terminate' function that was in my above script Link to comment Share on other sites More sharing options...
stuckors Posted October 4, 2006 Author Share Posted October 4, 2006 Use the 'terminate' function that was in my above scriptProblem is i don't want the script to close, just to exit loop with PgUp. Link to comment Share on other sites More sharing options...
Paulie Posted October 4, 2006 Share Posted October 4, 2006 (edited) Problem is i don't want the script to close, just to exit loop with PgUp.then replace the "{pause}" thing and then you can toggle it on and off with one key like this Global $Paused = true HotKeySet("{PgUp}", "TogglePause") HotKeySet("{ESC}", "Terminate") ;;;; Body of program would go here ;;;; While 1 ;Do Whatever WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Edited October 4, 2006 by Paulie Link to comment Share on other sites More sharing options...
stuckors Posted October 4, 2006 Author Share Posted October 4, 2006 Ha it works! Thanks sooo much. 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