GruchaBks Posted March 17, 2009 Share Posted March 17, 2009 Hi Is it possible to check in % how big part of the whole stripe takes light green? in original form, whole stripe takes 100px. Link to comment Share on other sites More sharing options...
foster74 Posted March 17, 2009 Share Posted March 17, 2009 Where is this stripe from? A website or game or? You could use PixelSearch, but there may be an easier way depending on where it is appearing. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 17, 2009 Share Posted March 17, 2009 Make a loop that checks pixels from the left edge of the health bar to right edge of the health bar. for each iteration of the loop . check if color is yellow then continue . if a color is green then break the loop, you have found your limit where the loop has stopped divided by the maximum total iterations is the percentage of your total health. github.com/jvanegmond Link to comment Share on other sites More sharing options...
GruchaBks Posted March 17, 2009 Author Share Posted March 17, 2009 (edited) Make a loop that checks pixels from the left edge of the health bar to right edge of the health bar. for each iteration of the loop . check if color is yellow then continue . if a color is green then break the loop, you have found your limitwhere the loop has stopped divided by the maximum total iterations is the percentage of your total health.It isnt hp bar, its exp bar. I need the function which returns me ammount of light green pixels frm the left edge of the bar. Your idea: 1,1: light (go farther) 2,1: light (go farter) 3,1: light..... 50,1: dark. So light bar have 49px? return 49, how?@Manadar:I modifed Your code a bit and works Thank Yoy Edited March 17, 2009 by GruchaBks Link to comment Share on other sites More sharing options...
jvanegmond Posted March 17, 2009 Share Posted March 17, 2009 func getpixelend() For $x = 0 to 100 $col = PixelGetColor($x, 1) if ( $col <> a light pixel color ) then return $x end return 100 end github.com/jvanegmond 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