AHK two button press script?

Good afternoon!

I was wondering if someone has an AHK script that can be used for two macros? One is on key 1 and the other macro is on key 2. Macro 1 (single target) loops while I’m pressing key 1 and stops when I release and Macro 2 (multi-target) loops while I’m pressing key 2 and stops on release?

Would appreciate any help on that.

Thanks in advance!

AHK won’t do that. All AHK will do is spam which ever key(s) you have specified. You will need to put specific macros onto those key slots on your toolbar ingame.

Thank you for the clarification. I guess then, maybe what I need to ask is how this script can be modified so it isn’t toggling and will only fire off when I press and hold the key? I’m using it now and it works fine except that I’ll forget I have to press the key a 2nd time to turn the macro off.

#IfWinActive World of Warcraft

toggle1 := 0
toggle2 := 0

SetTimer, PressKey1, 50
SetTimer, PressKey2, 50

$*1::toggle1 := !toggle1
$*2::toggle2 := !toggle2

PressKey1:
If toggle1
{
toggle2 := 0
If GetKeyState(“Control”, “P”) && GetKeyState(“Shift”)
Send +^1
Else If GetKeyState(“Control”, “P”)
Send ^1
Else If GetKeyState(“Shift”, “P”)
Send +1
Else
Send 1
}
Return

PressKey2:
If toggle2
{
toggle1 := 0
If GetKeyState(“Control”, “P”) && GetKeyState(“Shift”)
Send +^2
Else If GetKeyState(“Control”, “P”)
Send ^2
Else If GetKeyState(“Shift”, “P”)
Send +2
Else
Send 2
}
Return

#IfWinActive

I cant help you with what I don’t know - I can however refewr you to Hadronox’s repository of AHK scripts:

Have a look at his Hold macro series

Thank you Timothy!

The classic 2 key script is what I needed. I’ll just need to modify them a little to be able to use mods if included in the macro.

Appreciate that link!