#include <Misc.au3>
;
HotKeySet("!a", "Main") ;wait for ALT-a keystroke, then go to Main()
While 1 ;loop forever to wait for the keypress
Sleep(1000) ;no need to kill the CPU
WEnd
Func Main()
HotKeySet("!a") ;remove the hotkey so we don't jump around once we have started
;you start your script here
$checkWin = WinExists ("Notepad")
if $checkWin=1 then blurb()
EndFunc
Func blurb()
$Stop=True
While 1
If _IsPressed(11) Then $Stop= False
Switch $Stop
Case True
sleep(1000)
send("blurb")
Case False then ExitLoop
EndSwitch
WEnd
Call("Start()")
EndFunc
Func Start()
$Stop=False
$quit=False
While 1 ;loop forever to wait for the keypress
Sleep(1000) ;no need to kill the CPU
if _IsPressed(14) Then $Stop=True
Switch ($Stop)
case True then ExitLoop
EndSwitch
if _IsPressed(11) And _IsPressed(12) then $quit=True
Switch ($quit)
case True then Exit
EndSwitch
WEnd
Call("blurb()")
EndFunc
I seem to be able to get out of the first loop, the one that keeps saying blurb, but after that it seems to either not go to the start function, or the start function does something wrong.