Hey guys,
Working on a script that can move the mouse down for three or four seconds. The script will be used inside a game, and the goal is to get the camera looking directly downward.
Important note: The game is locking the cursor to the middle of the screen (I presume), and I have seen people post scripts with DllCall + "mouse_event", and I've seen people post scripts with MouseMove. Just looking to have enough control to: ensure it happens long enough to have the camera looking directly downward.
Thanks for your help in advance!
Moving the Mouse Down for a Few Seconds
-
- Posts: 2
- Joined: 26 Jan 2016, 14:24
Re: Moving the Mouse Down for a Few Seconds
MouseMove is fundamentally to do with cursor position on the screen (even with the R option) - therefore, if you use MouseMove to move the mouse down 10 pixels, and the mouse cursor is already at the bottom of the screen, it does nothing.
Furthermore, many games are utterly unconcerned by the position of the desktop cursor - instead they read raw "delta" information, which is the actual signals coming from the mouse. These will typically be small and frequent (ie if you move 10 units in 100ms, it would report something like 10 moves of 1 unit, once every 10ms).
So I would recommend mouse_event, its very simple to use and much more useful in these situations. You may well have to call it multiple times in a loop (eg 100 small moves of 1 instead of 1 move of 100) but that's real simple.
Furthermore, many games are utterly unconcerned by the position of the desktop cursor - instead they read raw "delta" information, which is the actual signals coming from the mouse. These will typically be small and frequent (ie if you move 10 units in 100ms, it would report something like 10 moves of 1 unit, once every 10ms).
So I would recommend mouse_event, its very simple to use and much more useful in these situations. You may well have to call it multiple times in a loop (eg 100 small moves of 1 instead of 1 move of 100) but that's real simple.
-
- Posts: 2
- Joined: 26 Jan 2016, 14:24
Re: Moving the Mouse Down for a Few Seconds
Thanks for the quick response. Would I have to Sleep within my loop between each small movement?
I presume within the loop, I would just call the code below with x=0 and y=1 or y=-1 (depending on which one works to move the camera downward)
I presume within the loop, I would just call the code below with x=0 and y=1 or y=-1 (depending on which one works to move the camera downward)
DllCall("mouse_event", uint, 1, int, x, int, y, uint, 0, int, 0)
Re: Moving the Mouse Down for a Few Seconds
Yup, it's that simple.
You may need a sleep, you may not. You may be able to do the whole movement in one call. Depends on the game and the use-case.
You may need a sleep, you may not. You may be able to do the whole movement in one call. Depends on the game and the use-case.
Who is online
Users browsing this forum: No registered users and 26 guests