gui529 Posted April 22, 2009 Share Posted April 22, 2009 (edited) I been working on a bot for a game. I wanted it to Go back to town once the weapon i use is broken. When a weapon is broken you get a picture of a faded red broken sword on your screen but since its a redish see throught I cant get a fixed color if Im moving.. Is there a way to make bot react to ALL colorations of red in a specific area(not a single dot pixel) ? ;$weaponbrokencolor = PixelGetColor( 250,650 );=======SOME RED PIXEL FROM THE PICTURE ;if $weaponbrokencolor = X then;=======================ANY RED pixel call("Town") ;endif Edited April 22, 2009 by gui529 Link to comment Share on other sites More sharing options...
MrMitchell Posted April 22, 2009 Share Posted April 22, 2009 The HelpFile for PixelSearch has an example of how to search for variations of red in a particular area of the screen...wonder if that could help you? Link to comment Share on other sites More sharing options...
gui529 Posted April 22, 2009 Author Share Posted April 22, 2009 (edited) i looked at it before but i dont really get it.... ; Find a pure red pixel in the range 0,0-20,300 $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 100 ) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf PixelSearch(left,top,right,bottom,color,shadevariation) ....how i set it to ALL red variations Edited April 22, 2009 by gui529 Link to comment Share on other sites More sharing options...
Qousio Posted April 22, 2009 Share Posted April 22, 2009 (edited) i looked at it before but i dont really get it.... ; Find a pure red pixel in the range 0,0-20,300 $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 100 ) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf PixelSearch(left,top,right,bottom,color,shadevariation) ....how i set it to ALL red variations Obviously you should pick the red colour that suits you most, and enter a shadevariation. The higher the variation the more colours it will respond to. You should also keep in mind that a very high shadevariation will also search for other colours, like blue/black/green/yellow etc... Edited April 22, 2009 by Qousio 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