Jump to content

pixelsearch help..


Recommended Posts

Ok people getting a bit stuck with pixelsearch function, if someone can help i would be most greatfull, i will try and describe this as best i can:

i want the mouse to move to and pixelsearch here ( 1143, 69, 1150, 47, 1157, 71, 1151, 96, color goes here ) are the retangle cords ok ie, left,top,right,bottom

the problem i have is there are four different colors that appear in this retangle and when found each one needs to complete a different action, how would i repeat the pixelsearch if the first color was not found then the second and so on.

pixelsearch for four different colors. Example pixelseach a retangle for PINK, BLUE, RED, GREEN, if PINK is found then do this, if PInk is'nt found continue search then if BLUE is found do this, if BLUE is'nt found continue search then if RED is found..........sorry if this is a bit long winded but trying to explain as much as possible.

Link to comment
Share on other sites

The Helpfile says PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

So format of your coordinates should be PixelSearch(1143, 47, 1157, 96, color).

Perhaps this will work ?

While 1
    $coord = PixelSearch( 0, 0, 20, 300, "*PINK*")
    If @error <> 1 Then
        ;enter functions here.
        ;
        ;
    EndIf
    $coord = PixelSearch( 0, 0, 20, 300, "*BLUE*")
    If @error <> 1 Then
        ;enter functions here.
        ;
        ;
    EndIf
    ;Continue same format for other colours
WEnd
Edited by danthe0
Link to comment
Share on other sites

The Helpfile says PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

So format of your coordinates should be PixelSearch(1143, 47, 1157, 96, color).

Perhaps this will work ?

While 1
    $coord = PixelSearch( 0, 0, 20, 300, "*PINK*")
    If @error <> 1 Then
        ;enter functions here.
        ;
        ;
    EndIf
    $coord = PixelSearch( 0, 0, 20, 300, "*BLUE*")
    If @error <> 1 Then
        ;enter functions here.
        ;
        ;
    EndIf
    ;Continue same format for other colours
WEnd

Thanks works great.

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