Tasmania 0 Posted October 5, 2007 I am looking to pause a script if ^!+p is pressed... this is the script: HotKeySet("^!+b", "quit") HotKeySet("^!+p", "pause") AutoItSetOption("TrayAutoPause", 0) Func quit() MsgBox(64, "Exit", "The question eliminator has exited.") Exit EndFunc Func pause() $Paused = NOT $Paused While $Paused sleep(100) TraySetState(4) WEnd TraySetState(8) EndFunc MsgBox(64, "Running", "The question eliminator is running. At any time press CTRL-ALT-SHIFT-B to exit." & @CRLF & "You may also press CTRL-ALT-SHIFT-P to pause/unpause the elimitator.") While 1 If WinExists("Question", "OK") Then ControlClick("Question", "OK", 1) EndIf Sleep(500) WEnd This is an almost EXACT copy from the help file, as far as pause is concerned, so I'm confused as to why it's not working. Anyone know? Share this post Link to post Share on other sites
Jos 2,274 Posted October 5, 2007 I am looking to pause a script if ^!+p is pressed...Which keys are you pressing ? Ctrl and Alt and Shift and p ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Tasmania 0 Posted October 5, 2007 Which keys are you pressing ? Ctrl and Alt and Shift and p ?Yeah Share this post Link to post Share on other sites
aslani 2 Posted October 5, 2007 (edited) It works for me. The icon in the task bar start blinking when paused. EDIT: I noticed that it won't unpause, that's because you din't declare $Pause Add this; Global $Paused Edited October 5, 2007 by aslani [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Share this post Link to post Share on other sites
Jos 2,274 Posted October 5, 2007 you removed this line from the copied example: Global $Paused SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Tasmania 0 Posted October 5, 2007 Ah ha! Thanks Sorry... I must have overlooked it... Share this post Link to post Share on other sites