Getting Pixel Info & Comparing It QM_Reject Junior Member Posts: 8 Threads: 4 Joined: Jul 2008 07-24-2008, 06:45 AM Ok I dont think many would be able to do this so mainly this question is for Gint. but any one else free feel to help. What is the best way i could get the pixel of a window and compare it in a contious string untill it is changed, so that i know the window has changed? I dont really know how to explain it but basically i want it to do this. [best way i can explain] get the pixel of window 1. then inside a contious string get it again and keep comparing itself until it has changed. Then to stop when it has changed. I'd appreciate it greatly if someone could show me an example how to do this please. Reply Reply Crankyhobo Junior Member Posts: 12 Threads: 6 Joined: Jul 2008 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 Code: ```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 0```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: Code: `if(r1=100 && g1=100 && b1=100)`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: Code: `out "%i %i %i" r1 g1 b1`Then you just would keep running the check function until it returns true Function is_there Code: ```rep ,if(is_there(windo)) ,,break ,else ,,wait 1``` Reply Reply QM_Reject Junior Member Posts: 8 Threads: 4 Joined: Jul 2008 07-24-2008, 07:32 AM tyvm bro this will be helpful Reply Reply Gintaras Administrator Posts: 10,939 Threads: 125 Joined: Dec 2002 07-24-2008, 07:41 AM See also: floating toolbar -> windows, controls -> find image -> wait until something changes if there is no 'wait until something changes', install QM 2.3.0, http://www.quickmacros.com/history.html Reply Reply QM_Reject Junior Member Posts: 8 Threads: 4 Joined: Jul 2008 07-24-2008, 08:38 AM ok that is a way just not how i needed, is there something that i can use in qm to get pixel? Reply Reply Gintaras Administrator Posts: 10,939 Threads: 125 Joined: Dec 2002 07-24-2008, 01:48 PM try floating toolbar -> wait -> wait for color or use rep and pixel (read in qm help) Reply Reply « Next Oldest | Next Newest »