I need help WASD completing script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
casxd
Posts: 2
Joined: 05 Dec 2022, 18:10

I need help WASD completing script  Topic is solved

Post by casxd » 05 Dec 2022, 18:17

i have such a script
movement.ahk
(620 Bytes) Downloaded 16 times
Can you help me add the w and s keys in the same way next to the a and d keys?

casxd
Posts: 2
Joined: 05 Dec 2022, 18:10

Re: I need help WASD completing script

Post by casxd » 06 Dec 2022, 09:20

Code: Select all

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#NoEnv
SendMode, Input
SetBatchLines -1
CoordMode, Mouse, Screen
mouseXY(x, y){
DllCall("mouse_event",uint,0,int,x,int,y­,uint,0,int,0)
}
strafe(left){
moveCount := 5
sleepInterval := 2	
relativeMove := 5
if(left){
key := "a"
move := -relativeMove
} else {
key := "d"
move := relativeMove
}
Send, {Blind}{%key% down}
DllCall("Sleep", "UInt", 5)
Loop, %moveCount% {
mouseXY(move, 0)
DllCall("Sleep", "UInt", sleepInterval)
}
Send, {Blind}{%key% up}
}
*XButton2::
while getkeystate("XButton2","P") {
strafe(false)
strafe(true)
}

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

Post Reply

Return to “Gaming Help (v1)”