This should be easy! I've checked out this thread, but it doesn't help.
I can't seem to break out of the loop using the hotkey. The idea is that you can start and stop the looping process with a single hotkey.
It seems like the value of timeron
never gets into the the loop once it's begun.
Here is a sample script:
#singleinstance force
timeron = 0
return
!f7::
if(timeron){
timeron = 0
msgbox Okay, the loop is off.
}else{
timeron = 1 ;if this is not set to one, the loop will not begin
msgbox Turning on the loop.
gosub, STARTLOOPING
}
RETURN
STARTLOOPING:
;do this over and over
loop{
if(!timeron)
break
;now wait for the right length of time before continuing the loop
msgbox, The loop yet continues....
Sleep, 5000
if(!timeron)
break
}
RETURN
What am I missing here?