Zer0Velocity Posted June 6, 2008 Posted June 6, 2008 (edited) Hey guys. I need to know how to count how many times when the colour the same is found 3 times and within a certain distance from each another (+50 pixels or so). Needs to work from whole screen resolution So colour is 0xFF710C and when found colour 1 does a search by 50 pixels, then checks for 2nd using 50 pixel search from position 1. Searches again from 2nd position using 50 pixels search to get the 3 colour. Adds to the count to say found so many times.... Thanks. Edited June 6, 2008 by Zer0Velocity
aNewLyfe Posted June 6, 2008 Posted June 6, 2008 sumthin like : $found = 0 $xpos = 100 $color = 0xFF... For $i = 1 to $xpos $getcolor = pixelgetcolor($i... if $getcolor = $color then $found = $found+1 $xpos = $xpos+50 endif if $found = 3 then exitloop next Msgbox(toomany fails... i hope this helps ~ Every Living Thing is a Code Snippet of World Application ~
Zer0Velocity Posted June 6, 2008 Author Posted June 6, 2008 I have got this but for some reason the count won't go up, any ideas? HotKeySet("{NUMPADDOT}", "search") HotKeySet("{ESC}", "quit") Func search() $xpos = 100 $color = 0xFF710C $found = 0 For $i = 1 to $xpos $getcolor = pixelgetcolor( $i , $xpos ) If $getcolor = $color then Do $found = $found + 1 $xpos = $xpos + 50 Until $found = 3 Then Msgbox(0, "Count OK", $found) EndIf If $found < 3 Then ExitLoop Next Msgbox(0, "Count BAD", $found) EndFunc Func quit() Exit EndFunc WinWaitClose("")
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