Toggle to send multiple different key presses at different rates

Ask gaming related questions (AHK v1.1 and older)
shinzou
Posts: 2
Joined: 23 Dec 2018, 02:43

Toggle to send multiple different key presses at different rates

23 Dec 2018, 03:00

Hi all, it has been a while since I have touched AHK and I have lost my touch a bit.

I am trying to figure out how to make a script which will press different keys at different rates, with a toggle.

For example, pressing mouse button 4 to start sending the 1 key every 3 seconds, the 2 key every 5 seconds, 3 key every 4 seconds, ect. Then press mouse button 4 again to stop it.

I had something like this years ago but I can't for the life of me remember how I did it. There may even be a better way to do it now anyway.

Any help would be appreciated.
Rohwedder
Posts: 7627
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Toggle to send multiple different key presses at different rates

23 Dec 2018, 03:44

Hallo,
try:

Code: Select all

XButton1::
T:=!T
SetTimer 1,% T ? 3000:"Off"
SetTimer 2,% T ? 5000:"Off"
SetTimer 3,% T ? 4000:"Off"
Return
1:
2:
3:
Send,% A_ThisLabel
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 86 guests