Mouse wheel moves cursor left/right along x-axis

Post gaming related scripts
danwheeler
Posts: 4
Joined: 21 Jun 2016, 22:44

Mouse wheel moves cursor left/right along x-axis

23 Jun 2016, 01:31

Hello:

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 the UCR script which is cool, but doesn't have the parameters I need to bind.

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
This code at least makes the wheel control how I want, but obviously lacks the parabola speed I need:

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
Thanks for any help!
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Mouse wheel moves cursor left/right along x-axis

29 Jun 2016, 07:04

What's this for, MWO?

MouseMove does not affect aiming in MWO properly, you need to use the mouse_event DllCall, and you need to issue lots of small mouse_event calls very quickly in order to generate smooth movement.

My RollMouse app uses this technique, so feel free to steal code from there: https://github.com/evilC/RollMouse

At some point I will look into adding a keyboard to mouse axis plugin to UCR

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 24 guests