I would like to execute a loop infinitely, but I would like this loop to stop as soon as a key (any random key) is pressed. I found a similar code on the documentation, but that code executes a loop when a key is held down. Here is what I have so far:
WinWait, NetWinner.com - Windows Internet Explorer,
IfWinNotActive, NetWinner.com - Windows Internet Explorer, , WinActivate, NetWinner.com - Windows Internet Explorer,
WinWaitActive, NetWinner.com - Windows Internet Explorer,
$F1:: ; Make the F1 key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
if not GetKeyState("F1", "P") ; If this statement is true, the user has physically released the F1 key.
break ; Break out of the loop.
; Otherwise (since the above didn't "break"), keep clicking the mouse.
MouseClick, left, 451, 527
Sleep, 17000
MouseClick, left, 607, 525
Sleep, 14000
}
return
[Moderator's note - Added code tags]I have already tried taking out the "not" because I thought that would make the code in parenthesis a true statement. That didnt work. Anyone have any suggestions? Ive already tried searching.
Thanks.




