Jump to content

Problem with pixel change


Recommended Posts

First off thanks phillip123adams for your help, after putting in the code for checking against an error I got it to work.

So ive wrriten a script to find a pixel with a color of red with a small search area(about 1/5 or less of the screen). Then when it locates the color it waits until a small area around the pixel(a 10 pixel area) to change to a white or shade of white. When it changes a mouseclick("right") is sent. This all works correctly except one thing. About 1/3 of the time the program never finds the red pixel even though the red pixel is there for 20 seconds. Ive given it a shade variance of 60 so it can pick up anything close to red. When it works, it works great but for some reason it just gets hung some times. So any ideas?

And I got another question when you do a pixelsearch does it only run one time unless you loop it?

Link to comment
Share on other sites

First off thanks phillip123adams for your help, after putting in the code for checking against an error I got it to work.

So ive wrriten a script to find a pixel with a color of red with a small search area(about 1/5 or less of the screen).  Then when it locates the color it waits until a small area around the pixel(a 10 pixel area) to change to a white or shade of white.  When it changes a mouseclick("right") is sent.  This all works correctly except one thing.  About 1/3 of the time the program never finds the red pixel even though the red pixel is there for 20 seconds.  Ive given it a shade variance of 60 so it can pick up anything close to red.  When it works, it works great but for some reason it just gets hung some times. So any ideas?

And I got another question when you do a pixelsearch does it only run one time unless you loop it?

<{POST_SNAPBACK}>

@1st question

Difficult to know without seeing that particular part of your script. I assume the loop takes less than 20 seconds (no long sleep periods). If you are skipping any pixels, that might cause the failure as the desired color may have shifted positions. Try getting a screen shots, and when it fails verify the color.

@2nd Question

PixelSearch makes one pass and then stops. A loop is required to do additional searches.

Phillip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...