Kaze Posted February 20, 2006 Posted February 20, 2006 (edited) I need a way to pause and unpause a simple script like this: HotKeySet("{PAUSE}", "EndScript") While 1 ControlSend ("MyProcess", "", "", "{2}") Sleep(Int(Random(75,105))) WEnd ; End Func EndScript() Exit EndFunc by using hotkeys. J and/or H would be prefereable. Thank you, i actually have NO idea! Edited February 20, 2006 by Kaze
Valuater Posted February 20, 2006 Posted February 20, 2006 (edited) maybe Global $Paused HotKeySet("j", "TogglePause") HotKeySet("{PAUSE}", "EndScript") While 1 ControlSend("MyProcess", "", "", "{2}") Sleep(Int(Random(75, 105))) WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func EndScript() Exit EndFunc ;==>EndScript PAUSE WAS STRAIGHT FROM HELP 8) welcome to the forums.... Maybe take a look at "Welcome to Autoit 1-2-3" in my signature below its a great place to start Edited February 20, 2006 by Valuater
rambo3889 Posted February 20, 2006 Posted February 20, 2006 @ Valuater arent u missing a { in the hot key ? Global $PausedHotKeySet("J}", "TogglePause")Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("")EndFunc My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight!
Valuater Posted February 20, 2006 Posted February 20, 2006 fixed... actually i need to remove the right "}" thanks 8)
Kaze Posted February 20, 2006 Author Posted February 20, 2006 thanks, i already tried the "unfixed solution" and was kinda dissapointed so i opened this thread thanks again!
Valuater Posted February 20, 2006 Posted February 20, 2006 Welcome... and Welcome to Autoit Enjoy!! 8)
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