07-24-2008, 07:29 AM
This may be helpful, i have no idea if this is the 'best' way im sure Gintaras will correct me.
Function is_there
Basically, when you run this, it checks the color of two pixels at the specified locations relative to the window W1. It checks to see if the pixels for both fit within the specified R values. It has so many checks because the colors can change in my case but you could just do something like:
But of course you also need to know what color you're supposed to find. You can figure that out with a graphics app color picker or running it and dumping it to the output ie:
Then you just would keep running the check function until it returns true
Function is_there
Function is_there
function# int'windo [&retvar]
int w1 = act(windo)
int r1 g1 b1
int r2 g2 b2
// Pixel Locations
int p1x = 512
int p1y = 556
int p2x = 565
int p2y = 556
// Get Pixel Colors
int p1col = pixel(p1x p1y w1)
int p2col = pixel(p2x p2y w1)
// Convert Colors
ColorToRGB(p1col &r1 &g1 &b1)
ColorToRGB(p2col &r2 &g2 &b2)
// Check Colors
if(r1=198 or r1=189 or r1=214 or r1=222 or r1=206 or r1=247)
,if(r2=198 or r2=189 or r2=214 or r2=222 or r2=206 or r2=247)
,,if(&retvar) retvar = 1
,,ret 1
,,
if(&retvar) retvar = 0
ret 0But of course you also need to know what color you're supposed to find. You can figure that out with a graphics app color picker or running it and dumping it to the output ie:
Then you just would keep running the check function until it returns true
Function is_there
