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.]