I am having issues getting my script to stop when I press a hotkey. I tried essentially all variations of ExitApp, Suspend, and Pause in basically every location in my code. most of the time the hotkey simply does nothing. I suspect it is because my loops take a long time to complete, and It can't stop the code in the middle of a loop. Just a guess though. Here is my code:
Code: Select all
F4::
F7::ExitApp
Loop{
Loop, 40
{
Random, rand1, 2000, 3000
Random, rand2, 44000, 45000
Random, rand3, 500, 750
Random, rand4, 45000, 45000
Send {Click, Down}
Send {d down}
Sleep, rand2
Send {d up}
Sleep, rand1
Send {a down}
Sleep, rand4
Send {a up}
SoundBeep, 1500
}
DllCall("mouse_event", uint, 1, int, 1200, int, 0)
Send {w down}
Sleep, 1000
Send {w up}
Loop, 40
{
Random, rand1, 500, 750
Random, rand2, 44000, 45000
Random, rand3, 500, 750
Random, rand4, 44000, 45000
Send {Click, Down}
Send {a down}
Sleep, rand2
Send {a up}
Sleep, rand1
Send {d down}
Sleep, rand4
Send {d up}
SoundBeep, 1500
}
DllCall("mouse_event", uint, 1, int, 1200, int, 0)
Send {w down}
Sleep, 1000
Send {w up}
}
Return