Marshal Dunnik
Marshal Dunnik

Reputation: 13

Correct my AutoHotKey Loop Script

Having a bit of trouble setting up a simple AutoHotKey loop that will hit buttons 1, 2, 3 and 4 on the keyboard with a 16 second pause in between. I don't need a toggle, which I know can complicate things (I'll just stop/pause the script manually).

Here's what I have so far, but all is seems to do is make the 1 button unsuable. The script does seem to be running, but it doesn't seem to activate the buttons when I test it in a text window. Any help would be greatly appreciated.

$1::
freq:=16000
Loop
    (
    Send (1)
    Sleep %freq%
    Send (2)
    Sleep %freq%
    Send (3)
    Sleep %freq%
    Send (4)
    )
return

Upvotes: 1

Views: 172

Answers (1)

vasili111
vasili111

Reputation: 6930

Try this:

$1::
freq:=16000
Loop
{
    Send, 1
    Sleep %freq%
    Send, 2
    Sleep %freq%
    Send, 3
    Sleep %freq%
    Send, 4
}
return

Upvotes: 1

Related Questions