kcd-clan Posted April 8, 2013 Share Posted April 8, 2013 (edited) The code can be used for any changing pixels. If something has a variable of a color, like flame then it will check around for similar. Depending on the product searching it may need a increase or decrees in the step value. When I beta tested this i was always getting a return and could not figure out why. After i adjusted the step it worked perfect. I increase the step it always returning. if never returning i decrees step. still trying to perfect it. Usage example. While $t = 0 $coord = PixelSearch($gLeft,$gTop, $gRight, $gBottom, Hex(0x0000FF),10) If Not @error Then $colorck = colorzone($coord[0],$coord[1],10,0,2) If $colorck Then MsgBox(0, "Yes", "Seems to be the same.") EndIf EndIf Function. ; 5x5 compair(500,500,5,5) ;xxxxx o is center and reading point. ;xxxxx compairing all colors in the radius ;xxoxx if color is in range of 5 offset for none int returns in the radius then return true ;xxxxx try and use even numbers for best result ;xxxxx It will round otherwise ; Func colorzone($x1, $y1, $square, $offset, $step = 0) $x2 = $x1 - Int($square / 2) $y2 = $y1 - Int($square / 2) $x3 = $x1 + Int($square / 2) $y4 = $y1 + Int($square / 2) $var = PixelGetColor($x1, $y1) $coord = PixelSearch($x2, $y2, $x3, $y4, $var, $offset, $step) If Not @error Then Return True Else Return False EndIf EndFunc ;==>compair ENJOY!! Edited April 8, 2013 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone() Link to comment Share on other sites More sharing options...
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