Rif Posted September 17, 2009 Report Share Posted September 17, 2009 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? Quote Link to comment Share on other sites More sharing options...
rberq Posted September 17, 2009 Report Share Posted September 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
Brain Virus Posted September 17, 2009 Report Share Posted September 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
kevin Posted September 17, 2009 Report Share Posted September 17, 2009 Take a look at the Schmoooove macro shared by Ian Steele on our Shared Macros page. It was designed to do exactly what you want. While you're at it, you may also want to look through the macros on our Sample Macros page. Quote Link to comment Share on other sites More sharing options...
Rif Posted September 18, 2009 Author Report Share Posted September 18, 2009 Wow, guys! This is far more feedback than I would have ever guessed I would have received. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.