Jump to content
Sign in to follow this  
t1g3r

pixelsearch help..

Recommended Posts

t1g3r

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.

Share this post


Link to post
Share on other sites
danthe0

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

Share this post


Link to post
Share on other sites
t1g3r

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.

Share this post


Link to post
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
Sign in to follow this  

×