Jump to content
Macro Express Forums

Slow macro playback with Windows 10


Recommended Posts

I am using MEP 4.6.2.1 on my two virtual machines at work. They both share the same macro files. One of them was recently updated to Windows 10 (The other is a Windows 7 machine) and I am finding MEP to be extremely slow for some functions. The Script Editor is pretty much unusable and stops responding just as soon as it is opened. Another issue I am struggling with is with a macro that moves the mouse a few pixels at a time to find the right color. The macro uses a loop to move up, down, left, and right hundred of times or until it finds the right spot. This works just fine in Windows 7, but in Windows 10, there is tremendous lag. I've tried increasing the playback speed of the macro to no avail. 

 

Is it just something with the version compatibility with the OS, or something else that I should be looking at?

Link to comment
Share on other sites

I don't think I'll be much help, but I had one thought. What is the performance like of that macro on a real Windows 10 machine of the same version (E.G. 1903 (current))? This will help you determine if it's a VM/real issue.

Another thought. Run it as an admin. I doubt it will make any difference, but it's quick to try. 

Link to comment
Share on other sites

For the pixel search, consider whether it's feasible to decrease the number of pixels your script checks. For example, instead of testing every pixel, test every 50 or 100 pixels.

If the pixel checking routine tests the colour beneath the mouse pointer, make the script run more quickly by rewriting the script to check pixels based on their X-Y coordinates. Something like this:

 

Variable Set Integer %x% to 100 // Initial x coordinate relative to the window
Variable Set Integer %y% to 100 // Initial y coordinate relative to the window
Repeat Start (Repeat 1000 times)
  Get Pixel Color at (%x%, %y%) Relative to Current Window into %Colour%
  Variable Modify Integer %x%: Increment // Increment the x value to check the next pixel to the right
End Repeat

If it's feasible to check one in every 100 pixels along the horizontal line, substitute this line for the one that increments:

 

  Variable Modify Integer: %x% = %x% + 100 // Skip the next 100 pixels	
	

 

Link to comment
Share on other sites

I too found mouse operations much slower when i made the (big) jump from XP to Win 10 pro a few years ago.

 

If you can upload a non-confidential test macro I'll run it and report back on performance.

 

I always use the co-ordinate method that Alan described whenever possible.

 

Link to comment
Share on other sites

If all else fails, you could try a pixel scan with an external script.

 

Another thought is you don't need to move the mouse to get the pixel colors. I wouldn't. I'd scan until I found the correct color then click the mouse at those coordinates. 

 

Sorry. I know it still doesn't help any of your other slowness issues. 

Link to comment
Share on other sites

3 hours ago, Cory said:

I don't think I'll be much help, but I had one thought. What is the performance like of that macro on a real Windows 10 machine of the same version (E.G. 1903 (current))? This will help you determine if it's a VM/real issue.

Another thought. Run it as an admin. I doubt it will make any difference, but it's quick to try. 

 

2 hours ago, Cory said:

Ensure the color depth didn't change. 

 

I wish I could test this, but I don't have a W10 machine. Not only that, but there are so many work-related security barriers that there's no good way for me to get my macros off my work pc to post here short of transcribing them by hand. I can't even access this forum 😪. Checked the color depth but they are the same on both VMs. I can't run MEP as admin. Thanks for the input.

Link to comment
Share on other sites

2 hours ago, acantor said:

For the pixel search, consider whether it's feasible to decrease the number of pixels your script checks. For example, instead of testing every pixel, test every 50 or 100 pixels.

If the pixel checking routine tests the colour beneath the mouse pointer, make the script run more quickly by rewriting the script to check pixels based on their X-Y coordinates. Something like this:

 


Variable Set Integer %x% to 100 // Initial x coordinate relative to the window
Variable Set Integer %y% to 100 // Initial y coordinate relative to the window
Repeat Start (Repeat 1000 times)
  Get Pixel Color at (%x%, %y%) Relative to Current Window into %Colour%
  Variable Modify Integer %x%: Increment // Increment the x value to check the next pixel to the right
End Repeat

If it's feasible to check one in every 100 pixels along the horizontal line, substitute this line for the one that increments:

 


  Variable Modify Integer: %x% = %x% + 100 // Skip the next 100 pixels	
	

 

 

Thanks Alan! I am going to try implementing this method and see how it works out. It seems like it would be much more efficient and reliable... I'm embarrassed for not having thought of it and instead relying on mouse moves 🤣

Link to comment
Share on other sites

2 hours ago, terrypin said:

I too found mouse operations much slower when i made the (big) jump from XP to Win 10 pro a few years ago.

 

If you can upload a non-confidential test macro I'll run it and report back on performance.

 

I always use the co-ordinate method that Alan described whenever possible.

 

 

I'm glad I'm not the only one who has experienced a slow down with regards to mouse operations in W10. Unfortunately I can't access this forum at work and have no good/acceptable way of sending a sample macro to myself. But as you pointed out, the coordinate method sounds like a better solution and I am going to test that out!

Link to comment
Share on other sites

Checking pixels by coordinates does seem to be much faster than checking pixels under the mouse pointer. But it's not always viable. In some applications, the target only gets its colour when the mouse pointer is hovering above the target.

 

One workaround I have tried is to hunt for a pixel colour of the border that surrounds the colour-changing target. Sometimes these borders measure as little as 1 pixel wide.

 

 

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...
×
×
  • Create New...