AHK switching target ingame wow

Hey!

Wonder if someone know why AHK switching target ingame WOW, while pressing one button with AHK if there is multi targets around. Not always, just sometimes

Im using this right now.

SetKeyDelay, 25 ; Keystroke is sent four times per second
#MaxHotkeysPerInterval 1000000000000 ; Rate of hotkey activations beyond which a warning dialog will be displayed.
; Increase it to delay the warning message.
^!n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return
#ifWinActive World of Warcraft
{
;Pause::Suspend
$1::
Loop
{
if not GetKeyState(“1”, “P”)
break
Send 1
}
return
$2::
Loop
{
if not GetKeyState(“2”, “P”)
break
Send 2
}
return
}

AHK does not switch targets, it listens/intercepts the key inputs you tell it to look for then sends that output modified, to wow, that’s the limit to its interaction with the client.

You may need to look in the wow keybinds for anything which uses ctrl-n but it’s not AHK doing it

Thanks for the answer. Havn´t done anything ingame with keybinds, its just starts auto switching like crazy for new target while I click button 1 for a ability and have one enemy selected. Dont need too be incombat with new targets :slight_smile: maybe SetKeyDelay, 25 too low…

Maybe you should look at the macro since that controls the actions you take in game.
SetKeyDelay is only the repeat key speed, in this case it’s sending 1 or 2, the macro sends the ingame actions

Have notice more and more, that problem I got is AHK getting a loop bug that never ends. On computer desk it jumps around depends on what number it got stuck on 1-6, WOW it switch target while pressing again. Im new using AHK and unsure about scripting. Im using 1-6 buttons in wow too lower the globe cooldown on spells.

Have tryed diffent script same thing, something I miss?