Example AutoHotkey Script.

Here is a script I made some modifications to that will allow you to bind 2 different macros to 2 different keys, and will also detect if you are using a mod button.
Ctrl + F1 will enable and disable the script. In addition, the script will only run when WOW is the active window. Original script was from BackwardPawn back in 2009.

to use: copy script and save as macroscript.ahk (or whatever)
change all instances of 2 or 4 to whatever key you use for the macro.
double click to run with AHK installed. You wont get a message saying its running but you can see it in your statusbar.


^F1::Suspend ; ctrl + F1   ; Activate or deactivate script 
#ifWinActive World of Warcraft  ; Only run if window 'World of Warcraft' is active
{
	$2::  ; If 2 is pressed
	$^2:: ; If 2+control is pressed
	$+2:: ; If 2+shift is pressed
	$!2:: ; If 2+alt is pressed
		Loop ; If any of the above is true then loop below
    			{
				if not GetKeyState("2", "P") ; If 2 is not pressed then break the loop
					break
				if GetKeyState("LCtrl", "P") ; If left control is pressed then send control+2
					Send ^e
				else if GetKeyState("LShift", "P") ; If left shift is pressed then send shift+2
					Send +e
				else if GetKeyState("LAlt", "P") ; If left alt is pressed then send alt+2
					Send !2
				else
					Send 2 ; If 2 is pressed with no other modifiers send 2
				sleep 80 ; Time in milliseconds between key repeats
			 }
		return
	$4::  ; If 4 is pressed
	$^4:: ; If 4+control is pressed
	$+4:: ; If 4+shift is pressed
	$!4:: ; If 4+alt is pressed
		Loop ; If any of the above is true then loop below
    			{
				if not GetKeyState("4", "P") ; If 4 is not pressed then break the loop
					break
				if GetKeyState("LCtrl", "P") ; If left control is pressed then send control+4
					Send ^e
				else if GetKeyState("LShift", "P") ; If left shift is pressed then send shift+4
					Send +e
				else if GetKeyState("LAlt", "P") ; If left alt is pressed then send alt+4
					Send !4
				else
					Send 4 ; If 4 is pressed with no other modifiers send 4
				sleep 80 ; Time in milliseconds between key repeats
			 }
		return
}

2 Likes