Jump to content
Macro Express Forums

Help with Pixel Macro


asmd23
 Share

Recommended Posts

Hello all,

 

I'm trying to put together a very basic macro and was wondering if I could get some help. Here's what I'm trying to do.

 

I want ME to scan a specific portion of my screen(a rectangular area) and check for two possible colors. So for instance, if it finds Blue I want it to do one thing, and if it finds Red then do another. I've found the Mouse Locator and I have the pixel colors I want to search for as well as the coordinates of where to search for, I'm just not sure how to write the actual script.

 

Any help is highly appreciated!

Link to comment
Share on other sites

You will need to use the Get Pixel Color command to capture the color at the location. The value is stored in an integer variable that you can then compare.

 

Get Pixel Color

If %N1% = XXXXX

Do this

End If

If %N1% = YYYYY

Do this

End If

 

You can use the Mouse Locator to determine the colors.

Link to comment
Share on other sites

Hi,

 

I would just use a couple of If Variable statements. Check the coordinate and see if it matches one of the two If statements. If it does, the macro completes the steps you defined for the red or blue match. Otherwise it ignores the steps.

 

If Variable %N1% = 11111

Do the steps for red

End If

If Variable %N1% = 22222

Do the steps for blue

End If

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...