Request Help Writing Simple Macro

Ask gaming related questions (AHK v1.1 and older)
Claudius
Posts: 2
Joined: 22 Nov 2017, 13:20

Request Help Writing Simple Macro

22 Nov 2017, 13:30

So I'm new to AHK and am hoping someone can help me write what should be a really simple script. The thing is, the game I need it for, SW:TOR, has an ability queue system which doesn't always recognize a key press unless it's held down for a certain period of time. I've found 150 ms to work very well on my mouse, but since my keyboard's software doesn't include macro capabilities I'm left with AHK. Anyway, here's what I want it to do:

When "6" is pressed:
Press left click
Wait 25 ms
Release left click
Wait 25 ms
Press "r"
Wait 150 ms
Release "r"
End macro

In particular, I'm having trouble figuring out how to make AHK press and release a key at different times instead of simply sending the command. Any help would be greatly appreciated!
yessorryno
Posts: 22
Joined: 12 Sep 2017, 03:13

Re: Request Help Writing Simple Macro

22 Nov 2017, 21:57

Claudius wrote:So I'm new to AHK and am hoping someone can help me write what should be a really simple script. The thing is, the game I need it for, SW:TOR, has an ability queue system which doesn't always recognize a key press unless it's held down for a certain period of time. I've found 150 ms to work very well on my mouse, but since my keyboard's software doesn't include macro capabilities I'm left with AHK. Anyway, here's what I want it to do:

When "6" is pressed:
Press left click
Wait 25 ms
Release left click
Wait 25 ms
Press "r"
Wait 150 ms
Release "r"
End macro

In particular, I'm having trouble figuring out how to make AHK press and release a key at different times instead of simply sending the command. Any help would be greatly appreciated!
Hi

Code: Select all

6::

send {click down}
sleep 25
send {click up}
sleep 25
send {r down}
sleep 150
send {r up}

return
Claudius
Posts: 2
Joined: 22 Nov 2017, 13:20

Re: Request Help Writing Simple Macro

23 Nov 2017, 17:19

Thank you for the reply, the script works perfectly!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 91 guests