Jump to content
Macro Express Forums

Mouse Move (Gradual)


Rif
 Share

Recommended Posts

I know of the "mouse move" command. However, it would be nicer to smoothly move the mouse pointer from one set of coordinates to another. What I have is a random point 1 and a random point 2 - always 'mostly' random. I need a way to slide the mouse over from point 1 to 2. It is not acceptable to "jump". Right now, I don't mind if it's a straight line.

 

Is there an easy way to do this that handles all four quadrants?

Link to comment
Share on other sites

Here's a very basic example that moves from coordinates 200,200 to 700,700. Works smoothest if you set ME to use the high-speed timer. You would have to calculate the repeat count based on beginning and end points. And the stepping for one of the two variables would seldom be '+1' in each pass through the loop -- if you were moving down only 300, and across 500, for example, you would want to add to N1 in only 3 out of every 5 passes through the loop.

 

Variable Set Integer %N1% to 200

Variable Set Integer %N2% to 200

Repeat Start (Repeat 500 times)

Mouse Move Window %N1%, %N2%

Variable Modify Integer: %N1% = %N1% + 1

Variable Modify Integer: %N2% = %N2% + 1

Delay 3 Milliseconds

Repeat End

Link to comment
Share on other sites

Here is something rough that I came up with.

 

Its accurate within 4 pixels.

(it scrolls 5 pixels at a time, you can adjust that to make it even smoother, and it will be more accurate, but it will be slower, which may or may not be the ticket for you)

 

To see it in action:

 

1. Run the macro, then click anywhere on the screen. Keep the mouse still for a half second.

2. Move to some other random location on the screen and click there. Again wait a half beat.

3. The macro will jump back to point 1 and then scroll over to point 2

4. When its within 4 pixels, it will display a Dialog box stating the macro is complete.

 

Mouse_Scroll_To_Random.mex

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...