Jump to content
Macro Express Forums

if pixel color in a raw is ...


icatian

Recommended Posts

hi all, i'm a newbie of this forum and also on macro express programming.

I'm trying to get a macro which check for a pixel color in a row (known x position then) and clicks when he finds that color on it.

example:

variable = myneededcolor

move mouse x-position from 300 to 900 (relative to active window)

if pixel color is = myneededcolor

stop mouse

left mouse click

else

move mouse "x1" position from 300 to 900 (another row)

 

is that possible?

Thx to all anyway :)

Link to comment
Share on other sites

Yes, it's possible. In pseudo code, the script might look something like this:

 

N1 = Width of Window

N2 = 0 // Initial X value

N3 = 100 // Y value of the row you want to search

N4 = 12345678 // Colour of target pixel

 

Repeat N1 times

Move Mouse Cursor to (N2, N3)

N5 = Pixel Colour Under the Mouse Cursor

 

If N5 = N4

// Found!

Mouse Left Click

Stop Macro

 

Else

// Not found

N2 = N2 + 1

 

End If

 

Repeat End

Link to comment
Share on other sites

thx for that script, now mouse moves right, but no click happens also over the right pixel color...

maybe is too difficult to find the right vertical row with that color!

Is it possible to set this script to find that pixel in a little box instead of a vertical row?

or also find a link (<IFMOUSE:19> cursor hand) in that box it will be suitable i think, thx for help again!!!

Link to comment
Share on other sites

i'm trying this way:

 

Macro Playback Speed: Normal Speed

Delay 1 Seconds

Variable Set Integer %N1% to 200

Variable Set Integer %N2% to 650

Variable Set Integer %N3% to 837

Repeat with Variable using %N1%

Mouse Move Screen %N2%, %N3%

If Mouse Cursor is Hand Point

Mouse Left Button Click

Macro Stop

Else

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

End If

Repeat End

 

but no click happens too :(

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