Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pixel help
#1
I'm dabbling in pixel recognition and what I want to do is check 3 pixels on my screen and if any one of them is of 3 preset values perform a function.
what I have is along these lines:

if ((pixel(100 150)=0xFFAAFF)||(pixel(100 150)=0x1A6786)||(pixel(100 150)=0x0102FF)||(pixel(110 150)=0xFFAAFF)||(pixel(110 150)=0x1A6786)||(pixel(110 150)=0x0102FF)||(pixel(120 140)=0xFFAAFF)||(pixel(120 140)=0x1A6786)||(pixel(120 140)=0x0102FF))

The problem I have with this is that i'm pretty sure there must be a more efficient way of doing this check
#2
Hello rob im not exactly sure what you are looking for but this is a pixel code i use. Its not too hard to use, the number is the pixel code that its looking for, simply add extra ifs more diff pixels. To get the pixel color get the xy and change the numbers from the example in the int. the before the if Col... put out Col and in the output you will get a new code for color swap the codes and then when it sees that pixel it will out window found. Hope this was helpful, enjoy.

Function Pixel4Rob
Code:
Copy      Help
int Col = pixel(667 230 "window name")
int R G B

ColorToRGB(Col &R &G &B)
if(Col = 7039968)
,out "Window Found"
else
,ret
#3
Macro Macro1432
Code:
Copy      Help
int a1 b1 c1 a2 b2 c2
a1=pixel(100 150)
b1=pixel(110 150)
c1=pixel(120 140)
a2=0xFFAAFF
b2=0x1A6786
c2=0x0102FF

if a1=a2 || a1=b2 || a1=c2 || b1=a2 || b1=b2 || b1=c2 || c1=a2 || c1=b2 || c1=c2
,out "yes"
#4
perfect, thanks for that!


Forum Jump:


Users browsing this thread: 1 Guest(s)