WoW AHK key spammer mouse4 and mouse5 doesnt work

Ask gaming related questions (AHK v1.1 and older)
Dolbaebx
Posts: 3
Joined: 02 Dec 2022, 06:38

WoW AHK key spammer mouse4 and mouse5 doesnt work

Post by Dolbaebx » 02 Dec 2022, 07:02

Hello!

Could someone please help with wow key spammer? When I try to add mouse 4 and 5 (Xbutton1, Xbutton2) it starts pressing random keys and I don't understand why maybe someone could look at what I did wrong?

Code: Select all

#ifWinActive World of Warcraft ;Checks if the World of Warcraft window is opened
#MaxThreadsPerHotkey 2 ;Used to control how many "instances" of a given hotkey or hotstring subroutine are allowed to exist simultaneously

SendTime:= 20 ; Time in milliseconds to repeat key press
$0:: ; Number 0
$^0:: ; Ctrl + 0
$+0:: ; Shift + 0
$!0:: ; Alt + 0
Loop ;Begins the code for looping/repeats
{ ;Begging code structure
if not GetKeyState("0", "P") ;Checks to see if a key is pressed down
break ; Terminates the Loop
if GetKeyState("Ctrl", "P") ;Checks if Ctrl is pressed
Send ^0 ;Sends Ctrl + 0
else if GetKeyState("Shift", "P") ;Checks if Shift is pressed
Send +0 ;Sends Shift + 0
else if GetKeyState("Alt", "P") ;Checks if Alt is pressed
Send !1 ;Sends Alt + 0
else ;Checks if Number 1 is pressed
Send 1 ;Sends Number 1
sleep %SendTime% ;Sends whatever sendTime value is set as
} ;Ending code structure
return

$Xbutton2::
$^Xbutton2::
$+Xbutton2::
$!Xbutton2::
Loop{
if not GetKeyState("Xbutton2", "P")
break
if GetKeyState("ctrl", "P")
Send ^Xbutton2 
else if GetKeyState("Shift", "P")
Send +Xbutton2 
else if GetKeyState("Alt", "P")
Send !Xbutton2 
else
Send Xbutton2 
sleep %SendTime%
}
return

$Xbutton1::
$^Xbutton1::
$+Xbutton1::
$!Xbutton1::
Loop{
if not GetKeyState("Xbutton1", "P")
break
if GetKeyState("ctrl", "P")
Send ^Xbutton1 
else if GetKeyState("Shift", "P")
Send +Xbutton1 
else if GetKeyState("Alt", "P")
Send !Xbutton1 
else
Send Xbutton1 
sleep %SendTime%
}
return

f12::Suspend
^f12::Reload
End::ExitApp

[Mod action: Moved topic from “Bug Reports” which is for reporting AHK bugs, not help with debugging your scripts.]

User avatar
mikeyww
Posts: 27072
Joined: 09 Sep 2014, 18:38

Re: WoW AHK key spammer mouse4 and mouse5 doesnt work

Post by mikeyww » 02 Dec 2022, 08:24

I did not try the script, but to send a key would be like

Code: Select all

Send +{XButton2}
Explained: Key names

Dolbaebx
Posts: 3
Joined: 02 Dec 2022, 06:38

Re: WoW AHK key spammer mouse4 and mouse5 doesnt work

Post by Dolbaebx » 02 Dec 2022, 14:26

It worked! Thank you so much!

Post Reply

Return to “Gaming Help (v1)”