Karasu Posted October 26, 2007 Posted October 26, 2007 Hi, my problem is that I use PixelSearch to determine a colour - I do this check in a while loop. In the first run it does detect the colour, but then the output becomes "000001" in Hex which is none of the colours I look for, and I believe it is not present on the screen.. I even tried that I reset the variable storing the result of the method, but it doesn't work. Any idea? Present colours are red, white, grey, and blue - their values aren't even close to this strange value. Here's the snippet: While $g < 1 $d = $d + 15 (these are coordinates, nothing relevant I believe) $c = $c + 15 $f = $f + 15 MsgBox(64, "Bigyo", $d) MsgBox(64, "Bigyo", $c) $e = PixelSearch(812, $d, 852, $f, 0x000000) ;$e = PixelGetColor(822, $d) MsgBox(64, "Bigyo", Hex($e, 6)) bla bla bla WEnd Thanks in advance everyone! Cheers, Kara
weaponx Posted October 26, 2007 Posted October 26, 2007 (edited) These lines make no sense: $e = PixelSearch(812, $d, 852, $f, 0x000000) ;$e = PixelGetColor(822, $d) MsgBox(64, "Bigyo", Hex($e, 6))PixelSearch returns an array (X, Y coordinates) upon success, so first off you should be checking the result with IsArray(), secondly you are attempting to convert said array to hex. $e = PixelSearch(812, $d, 852, $f, 0x000000) If NOT IsArray($e) Then MsgBox(0,"","Pixel not found") EndIf MsgBox(64, "Bigyo", "X:" & $e[0] & " Y:" & $e[1])EDIT: Man this topic is like deja-vu http://www.autoitscript.com/forum/index.ph...;hl=pixelsearch Edited October 26, 2007 by weaponx
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now