Page 1 of 1

MouseMove Relative In Game Cursor

Posted: 18 Apr 2019, 22:12
by Chuckl3s
I'm currently trying to automate a crafting process within a game's inventory. I'm attempting to move my in-game cursor left, then move back to the same exact spot. I'm using Relative because non-relative just shoots my cursor to the top left since the game mouse position attempts to keep resetting to 950,550 (outside of the inventory UI it's FPS view).

I thought it'd be as simple as:

MouseMove, -10, 0, 25, R
Sleep, 2000
MouseMove, 10, 0, 25, R

However the 2nd Relative always returns a slightly off from the starting point. Increasing/decreasing the 2nd Relative's X value to 11 or 9 doesn't solve it either (unless there's a way to do fractional?). I tried searching for similar posts but kept finding GetMousePos recommendations that didn't work (since it keeps wanting to pull 950,550).

Thank you all for your help and support!

Re: MouseMove Relative In Game Cursor

Posted: 19 Apr 2019, 12:38
by Evil-e
I was dealing with MouseMove just yesterday and had similar issues you describe. I have a number of games in which it works fine,
but have had trouble with the relative command

Try using SendMode, Event

Code: Select all

SendMode, Event
MouseMove, 1700, 10, 0
sleep, 250
SendMode, Event
MouseMove, 1880, 10, 10
sleep, 50
SendEvent {Click 350, -500}
sleep, 50
This command sends the mouse to a specific location, regardless of where it is when the script is run. I wrote this script to run the mouse
down toward the lower RH side of Task Bar. It then "drags" over to the time display to clear the image cache left after the game closes then
back up to the near center of screen, for convenience and is easy to spot :)

Kinda silly, but why does a man climb a mountain, anyway? :rainbow:

:morebeard:

psssst..... I also love that hand-of-god look when the mouse moves around all by itself :wtf:

Re: MouseMove Relative In Game Cursor

Posted: 20 Apr 2019, 12:29
by Chuckl3s
Thanks for the response, Evil-e!

Unfortunately in SendMode, Event the MouseMove still shoots the cursor to the top left when executing. I think this is just how the game's handling a direct mouse coordinate input.

However, thanks to you showing me SendMode, I did manage to try SendMode, Input which allows for the Relative command to be pixel perfect move going back and forth.

I managed to get it working and drag 'n drop functionality using Click, up/down.

Thanks again for your help!

Re: MouseMove Relative In Game Cursor

Posted: 20 Apr 2019, 17:05
by Evil-e
Funny.... because I had the exact same issue with the mouse going to the top of screen and moving laterally, but in the OPPOSITE direction
than scripted. It was only when I added SendMode, Event, that it moved as intended (this is the only game to have this issue with MouseMove).

The game was DiRT: 3 and is just how the games handles direct mouse input as well.

Cheers and good luck :morebeard: