Backnor Posted September 23, 2007 Share Posted September 23, 2007 I would like to thank everyon in advance. I am wanting to know if I can have pixel search look for a range of colours or do I need to name each pixel that may be present? This is what I have so far $Target0X = 32 $Target0Y = 100 $No_Target_Col = 0 ; Black $Target1X = 63 $Target1Y = 100 $No_Target_Col = 0 ; Black $Target2X = 105 $Target2Y = 100 $No_Target_Col = 0 ; Black $Good_To_Go = 0x02E800 ; Health Good $Good_To_Go = 0x02D800 ; Health Good $Target_Colour = PixelGetColor ($Target0X, $Target0Y) IF $Target_Colour = $No_Target_Col Then Send ("{1}") $Target_Colour = PixelGetColor ($Target1X, $Target1Y) IF $Target_Colour = $No_Target_Col Then Send ("{2}") $Target_Colour = PixelGetColor ($Target2X, $Target2Y) IF $Target_Colour = $No_Target_Col Then Send ("{3}") IF $Target_Colour = $Good_To_Go Then $Fight = 1 EndIf Endif EndIf EndIf I am trying to read pixel colours of an in game health bar, I want it to read the first target area and if it returns as black then to do a big heal the next would be a smaller heal and so on. If it reads the health colour as good then it will move on to the fighting part of the script. The problem is that the healthbar uses many differant pixel colours Link to comment Share on other sites More sharing options...
qazwsx Posted September 23, 2007 Share Posted September 23, 2007 do you mean many shades? Or it can be many different colors? Link to comment Share on other sites More sharing options...
Backnor Posted September 23, 2007 Author Share Posted September 23, 2007 its many shades of the same colour Link to comment Share on other sites More sharing options...
qazwsx Posted September 24, 2007 Share Posted September 24, 2007 well pixel search can look for shades. I think its the second to last option check the help file. Link to comment Share on other sites More sharing options...
Backnor Posted September 24, 2007 Author Share Posted September 24, 2007 thank you sir! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 24, 2007 Moderators Share Posted September 24, 2007 PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) Just use the "Right/Bottom" the same as "left/top" left = x top = y So as an example:$Target0X = 32 $Target0Y = 100 $aPix = PixelSearch($Target0X, $Target0Y, $Target0X, $Target0Y, 0x02E800, 20) If IsArray($aPix) Then MsgBox(64, "info", "Found") EndIF Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Backnor Posted September 24, 2007 Author Share Posted September 24, 2007 Very good Thank you very much 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