I and a n00b in need of an aiming script (aiming equates to robot's torso turning). Currently moving my mouse while holding down the LButton turns the torso accordingly. This works okay, but can fall short when quick movements are needed and I'm hoping to bind this mouse movement to the mouse's scrolling wheel.
- The torso only requires movement on the x-axis.
I want to control that x-axis movement via my mouse's WheelUp (left movement) and WheelDown (right movement).
I'd also like this function - the faster I scroll the faster the torso turns, ramps up in speed (i.e. slow Wheel scrolling = small precise aiming movements, and quick Wheel scrolling = fast torso turns)
I also need the pointer to snap back to screen center after scrolling has stopped for 500 milliseconds, to reset it.
I tried altering a script I found that has elements of what I need, but it uses buttons:
Code: Select all
WheelUp::
WheelDown::
R := 0
Loop{
X := 0
MouseMove, X := GetKeyState("WheelUp") ? -++R*10 : GetKeyState("WheelDown") ? ++R*10 : X
, Y := GetKeyState("Up","P") ? -++R : GetKeyState("Down","P") ? ++R : Y
}until !X && !Y
return
Code: Select all
WheelUp::
MouseGetPos, x, y
MouseMove, x-10, y
Sleep 250
return
WheelDown::
MouseGetPos, x, y
MouseMove, x+10, y
Sleep 250
return