First: the code does not complete its action stops at the "08" line
second: does not go out to generate the function "mouse_event".
(how to generate "Mouse_Event" for this to work like this:
when "{D down}" "Mouse_Event is turned to the right" (08 line)("mouse_event", "UInt", 0x01, "UInt", 80 * sens, "UInt", 0 * sens) "when" {D up} "" mouse_event "stops
when "{s down}" and {a down} "Mouse_Event" are turned to the left "(" mouse_event "," UInt ", 0x01," UInt ", -80 * sens," UInt ", 0 * sens)" when "{a up}" "mouse_event" stops and returns to the center of the screen)
Code: Select all
;Sensitivity
sens:=5/sens
XButton2 & LShift::
Action:
on := True
While GetKeyState("XButton2", "P") & GetKeyState("LShift", "P") {
DllCall("mouse_event", "UInt", 0x01, "UInt", 80*sens, "UInt", 0*sens)
sleep 99
{
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
break
}
Send {d down}
Sleep, 1050 * on
Send {d up}
DllCall("mouse_event", "UInt", 0x01, "UInt", 0*sens, "UInt", 0*sens)
sleep 99
{
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
break
}
If !on || !GetKeyState("XButton2", "P")
Break
Sleep, 40
Click, R D
sleep, 100
Sleep, 100 * on
Click, R U
If !on || !GetKeyState("XButton2", "P")
Break
Sleep, 190
DllCall("mouse_event", "UInt", 0x01, "UInt", -80*sens, "UInt", 0*sens)
sleep 99
{
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
break
}
Send {s down}
Sleep, 1 * on
Send {s up}
If !on || !GetKeyState("XButton2", "P")
Break
Send {a down}
Sleep, 1050 * on
Send {a up}
DllCall("mouse_event", "UInt", 0x01, "UInt", 0*sens, "UInt", 0*sens)
sleep 99
{
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
break
}
If !on || !GetKeyState("XButton2", "P")
Break
Sleep, 40
Click, R D
sleep, 100
Sleep, 100 * on
Click, R U
Sleep, 190 * on
}
#If on
LShift Up::
XButton2 Up::on := False
#If