Sign in to follow this  
Followers 0
GruchaBks

Stripe Length Searching

5 posts in this topic

Hi :P Is it possible to check in % how big part of the whole stripe takes light green? in original form, whole stripe takes 100px.

Posted Image

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 limit

where 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 :P Thank Yoy

Edited by GruchaBks

Share this post


Link to post
Share on other sites

func getpixelend()

For $x = 0 to 100

$col = PixelGetColor($x, 1)

if ( $col <> a light pixel color ) then

return $x

end

return 100

end

Share this post


Link to post
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
Sign in to follow this  
Followers 0