Need help for a Loop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shin1113
Posts: 1
Joined: 22 Apr 2018, 03:57

Need help for a Loop

22 Apr 2018, 07:23

Hi, I need help for doing a loop, I wanted it to be spamming space bar for 13 seconds then stop and rest for 19 seconds then repeat again but it just kept on spamming the space bar. I tried 2 types but it still wouldn't work. Please help me thanks... :silent:

Code: Select all

*f3::
toggle := !toggle
    if (toggle) {
        SetTimer, Loop1, 1000
        SetTimer, Loop2, 2000
    } else {
        SetTimer, Loop1, Off
        SetTimer, Loop2, Off
    }
return

Loop1:
SetTimer, Spam_Space, 500 ;

return

Loop2:
sleep 1000

return

Spam_Space:          
	SendInput {Space}

return
and this:

Code: Select all

*f3::
Loop
{
SetTimer, Spam_Space, 50 ,13000
Sleep, 19000
}
return

Spam_Space:          
	SendInput {Space}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doanmvu, RSable and 383 guests