How to change bound key? Also Strafe script.

Posts 1–4 of 4 · Page 1 of 1
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}
}

$h:: ;<------Here lets change the "$XButton1::" to "$h::" (now mouse4 is changed to h)
while getkeystate("h","P") ;<--------and change it here too
{
strafe(false)
strafe(true)
}
return
//2Short456
Looks Nice! I hope you finish it! I'll be waiting
Solved....

Also moved to Coding & Resources as it isn't a relase.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?