break loop not working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kelador
Posts: 1
Joined: 29 Apr 2017, 06:49

break loop not working

29 Apr 2017, 07:27

So I made a simple script what I want to do is Press 3 which triggers the loop I then want numpad9 to stop/reset the script So I can press 3 again to start the loop over, however all that seem to happen is the script closes.

Code: Select all

WinActivate, Star Wars™: The Old Republic™ ahk_class PlayerClient
KeyWait, 3
KeyWait, 3, D
Loop
{
    Sleep, 150
    Send, {Numpad1}
    Sleep, 150
    Send, {Numpad2}
    Sleep, 150
    Send, {Numpad3}
    Sleep, 150
    Send, {Numpad4}
    Sleep, 150
    Send, {Numpad3}
    Sleep, 150
    Send, {Numpad5}
    Sleep, 150
    Send, {Numpad6}
    Sleep, 150
    Send, {Numpad7}
    Sleep, 150
    if GetKeyState("numpad9", "P") ; Looks to see if numpad9 is pressed
        break  ; exits Loop
}
Return

eduardoblu
Posts: 19
Joined: 28 Apr 2017, 18:54

Re: break loop not working

29 Apr 2017, 15:10

Code: Select all

3::
Loop
{
    Sleep, 150
    Send, {Numpad1}
    Sleep, 150
    Send, {Numpad2}
    Sleep, 150
    Send, {Numpad3}
    Sleep, 150
    Send, {Numpad4}
    Sleep, 150
    Send, {Numpad3}
    Sleep, 150
    Send, {Numpad5}
    Sleep, 150
    Send, {Numpad6}
    Sleep, 150
    Send, {Numpad7}
    Sleep, 150
}

return

9::reload

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 327 guests