Jump to content

Pixel Searching any red.


Recommended Posts

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 by gui529
Link to comment
Share on other sites

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 by gui529
Link to comment
Share on other sites

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 by Qousio
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...