How to change bound key? Also Strafe script.
So I have a strafe script that is supposedly bound to mouse4 and I want to change the button from mouse4 to something else but I can't figure out how to do so. Here is the script:
#NoEnv
SendMode, Input
SetBatchLines -1
CoordMode, Mouse, Screen
mouseXY(x, y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,in t,0)
}
strafe(left)
{
moveCount := 35
sleepInterval := 2
relativeMove := 6
if (left)
{
key := "a"
move := -relativeMove
} else
{
key := "d"
move := relativeMove
}
send {%key% down}
DllCall("Sleep", "UInt", 5)
Loop, %moveCount%
{
mouseXY(move, 0)
DllCall("Sleep", "UInt", sleepInterval)
}
send {%key% up}
}
$XButton1::
while getkeystate("XButton1","P")
{
strafe(false)
strafe(true)
}
return
Thanks in advance.
#NoEnv
SendMode, Input
SetBatchLines -1
CoordMode, Mouse, Screen
mouseXY(x, y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,in t,0)
}
strafe(left)
{
moveCount := 35
sleepInterval := 2
relativeMove := 6
if (left)
{
key := "a"
move := -relativeMove
} else
{
key := "d"
move := relativeMove
}
send {%key% down}
DllCall("Sleep", "UInt", 5)
Loop, %moveCount%
{
mouseXY(move, 0)
DllCall("Sleep", "UInt", sleepInterval)
}
send {%key% up}
}
$XButton1::
while getkeystate("XButton1","P")
{
strafe(false)
strafe(true)
}
return
Thanks in advance.