Shicken Posted November 11, 2004 Posted November 11, 2004 I'm still learning as much as I can with AutoIt, and I need a command that can pause it until I press the button again... I know how to completley stop the script, then in order to run it I have to run the script manually. So if I could get a bit of code with it setting the hotkey along with the pause command, that'd be great. Thanks, Shicken
SlimShady Posted November 11, 2004 Posted November 11, 2004 expandcollapse popupAutoItSetOption("TrayIconDebug", 1) ;Initialize variable Global $Paused ;Set start state as "not paused" $Paused = 0 ;Show user that the script is NOT paused ToolTip("Script is NOT paused") ;Press "Pause" to toggle the pause state HotKeySet("{PAUSE}", "TogglePause") ;Body of your script ;You can remove this loop if you want While 1 Sleep(500) WEnd ;Functions you need Func TogglePause() ;Swap current state $Paused = NOT $Paused If $Paused Then ;Show user that the script is paused ToolTip("Script is paused") ;Pause the script Pause() Else ;Show user that the script is NOT paused ToolTip("Script is NOT paused") EndIf EndFunc Func Pause() ;Pause While $Paused Sleep(100) WEnd EndFunc
Henrik Posted November 11, 2004 Posted November 11, 2004 $dummy MsgBox(64, "Script waiting", "Hit OK to unpause the script.") Ignorance is strength.
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