Sign in to follow this  
Followers 0
Yobear

Prioritizing color search*

2 posts in this topic

I've got the search for a color/parameter language down on a script I'm running.

What I'd like to do now rate the hexidecimal values of color in tiers as to which action is taken.

I.e.

Scans and sees all green squares, mouse clicks a certain point on the screen. (lowest priority)

Scans and sees a yellow square amidst the green. Clicks that square (second priority)

Scans and sees a red square. Clicks that square (top priority).

Is this possible?

Share this post


Link to post
Share on other sites



If it's a few specific colors you could so something like this.

$green = PixelSearch( 0, 0, 20, 300, 0x00FF00)
$yellow = PixelSearch( 0, 0, 20, 300, 0xFFFF00)
$red = PixelSearch( 0, 0, 20, 300, 0xFF0000)

If IsArray($red) Then
    ;Do some stuff.
ElseIf IsArray($yellow) Then
    ;Do some other stuff.
ElseIf IsArray($green)
    ;Do something totally different.
Else
    ;Sorry Cap we couldn't find what you was looking for.
EndIf

[size="1"]Please stop confusing "how to" with "how do"[/size]

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  
Followers 0