Jump to content
Macro Express Forums

Pixel Check Help


Shawn00_88
 Share

Recommended Posts

If you didn't read my other post I'm new to Macro express but learning pretty quick.

Problem is that with my program I'm using ME3 on it usually pops up 4 window's at this certain point in my macro but not always sometimes it is only popping up 3, i figured if i put in a pixel check as follows it should work or am i misunderstanding something

 

Get Pixel Screen Coords: 600, 190 into %N51%

If Variable %N51% = 12632256

mouse move screen 30, 220

mouse left click button

End if

 

I have tried with and without delays, this is the ONLY time N51 is used however the macro is doing the left click regardless if the 4th window is up or down and the pixel colors are different

if only 3 window's pop up clicking 30,220 would open the fourth. 3 window's pixel color is 12632256

when 4 window's open pixel color is 13071630

Link to comment
Share on other sites

Only thing that jumps out at me here is, you are checking a pixel location relative to the screen as opposed to the window. If the window is full-screen that may not matter.

 

You said you tried it with a delay before checking color, to make sure there was time for the window to open prior to your pixel check???

 

Some color values will change on a PC running 16-bit vs. 24-bit vs. 32-bit color, so if it works on one PC and fails on another, check that.

Link to comment
Share on other sites

I fixed it, i believe i had a delay in a wrong spot. When the guy from the company we are doing this for comes back from vacation he's going to be amazed lol Considering when i talked to him the day before he went on vacation i am almost sure i sounded like an Idiot and he wont be back until the 8th of September.

 

Ideally we want this to run without requiring someone to have to check each computer every 5-10 minute's and i think we are getting there. I run the macro on 8 computers and normally if a computer goes 10 accounts without stopping its amazing but today one computer went 35 without stopping and i have exported this patch yet because there's still a thing or two I'm tweaking. Even with the macro on fast it takes 3-5 minutes to run 1 account, if i have to make an account its more like 10-20 =( lol

Link to comment
Share on other sites

If it's a timing issue, perhaps your pixel check is happening before the next window has opened.

For an uncertain timing like this, I generally use a repeat loop. It's also easier (and more forgiving on different PCs) if you don't code for an exact color. For example, the following logic allows a nominal ten seconds for the new window to open, then does the click if it hasn't opened in that time. It doesn't ALWAYS wait the full ten seconds; the maximum "wasted" wait time is 250ms if the color changes because the new window has loaded.

 

GET PIXEL COLOR INTO N90 (from the original window)

REPEAT 40 TIMES

GET PIXEL COLOR INTO N91

IF N90 <> N91

REPEAT EXIT (color has changed)

END IF

DELAY 250 MILLISECONDS

REPEAT END

IF N90 = N91 (there has been no color change)

CLICK TO OPEN WINDOW

END IF

 

The repeat loop will be exited either by a color change, or by the expiration of 10 seconds without change. We don't really know which, so that's why the N90 to N91 compare is repeated after exiting the loop.

Link to comment
Share on other sites

thanks will try that instead =), now i just have to figure out how to copy something that can be in multiple locations and that have the same pixel color as the other account numbers i dont want copied..... example

 

when i search by social for canceled accounts it gives me 0-5 on screen, i have the macro set to go through them on a loop with #, variable location however when it finds one that is in collections i want it to copy that one which until now i have only copied from fixed locations Is this possible?

our program is like

account #| name | type | status |

account #| name | type | status |

account #| name | type | status |

account #| name | type | status |

 

Also it has to be copied on that window i have yet to find a place once i open the account for it to get the Account # which i would be able to copy it from because i have successfully put in a copy from a window in an open account

 

Did i mention thanks =) :ph34r:

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