ChehSun Posted December 17, 2012 Posted December 17, 2012 expandcollapse popup;;;; Mouse Motion Global $Paused, $counter = 0 HotKeySet("{F2}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") Func Start() While 1 MouseClick("Primary",1398,830) MouseClick("Primary",827,713) MouseClick("Primary",963,459) wEnd EndFunc While 1 $counter +=1 ToolTip('Script is "Running"',0,0, $counter, 1) Sleep(700) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc I cannot seem to put a function and a toggle pause key together. if someone could helpfully point me towards the right path i would be grateful.
stormbreaker Posted December 17, 2012 Posted December 17, 2012 (edited) I think you want to avoid any functions when the script is paused and then go back to normal once it is resumed. How about this: expandcollapse popup;;;; Mouse Motion Global $Paused, $counter = 0 HotKeySet("{F2}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") Func Start() While 1 MouseClick("Primary",1398,830) MouseClick("Primary",827,713) MouseClick("Primary",963,459) wEnd EndFunc While 1 $counter +=1 ToolTip('Script is "Running"',0,0, $counter, 1) Sleep(700) WEnd Func TogglePause() $Paused = NOT $Paused If $Paused then HotKeySet("{ESC}") HotKeySet("+!d") else HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") EndIf While $Paused sleep(100) ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc Did you get what you wanted? Edited December 17, 2012 by MKISH ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
ChehSun Posted December 17, 2012 Author Posted December 17, 2012 Oo for sure, when should i implement the function then? *i tried that code but it still does not recognize the mouse click functions. Suggestions?
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