SRL Archive - News and General

New HP Bars, Sudgested Fixes?


Lance

2009-05-28 23:01:14

im sorry i donno if anyones already talked about this.. but i havent found anyting in the runscape updates section. ok so im gonna try to make a new InFight function / Hp bar detection. i took some screen shots of the new HP bar:


ok so Example1 shows a compleatly green and red HP bar, and the color outline of them. Green: 10496, Red:198716. now example 3 shows us how the outline on the HP bar changes (this will make things alittle harder, if it was just a black outline i woulda just surched for a black dtm.)
due to the color changeing.. the only thing i can think of useing is a DDTM, or maby a TPA of fixed points? if anyone has some sudgestions of ways to make this more efficiant please tell me ;D

Naum

2009-05-28 23:02:46

I have all the colors:

Color Picked: 524453 at (387, 314)
Color Picked: 590002 at (521, 418)
Color Picked: 594402 at (386, 315)
Color Picked: 401121 at (383, 315)
Color Picked: 590010 at (382, 316)
Color Picked: 131211 at (383, 318)
Color Picked: 724439 at (387, 315)
Color Picked: 262299 at (366, 314)
Color Picked: 724439 at (552, 430)
Color Picked: 655809 at (553, 430)
Color Picked: 330180 at (438, 438)

{--}

Color Picked: 37659 at (520, 316)
Color Picked: 50027 at (519, 317)
Color Picked: 46132 at (516, 318)
Color Picked: 39194 at (504, 320)
Color Picked: 45868 at (519, 318)
Color Picked: 54691 at (476, 318)
Color Picked: 50820 at (475, 318)
Color Picked: 43039 at (494, 320)
Color Picked: 47721 at (476, 316)

Top ones are green bottom ones are red ;)

Put them in all together find an average color + Tol and bham you have it ;)

Btw, AFAIK - 198716 is the outline of your bar.

Shuttleu

2009-05-28 23:04:46

just make a small bitmap of say 7 * 3 of the very left of the bar which will always be green apart from when you die (which by then you wont be in the fight anymore)

~shut

Lance

2009-05-28 23:06:12

haha so you think just a simple FindColorTolerance will suffice?

Edit: oh i hadnt thought of that shut ill see which one works better ;D

Naum

2009-05-28 23:06:28

I got an Idea, Do

1)Get TPA Bounds of the black outline then do a GetColorsBox to find the colors :)

Edit: Yea FindColors should do it.

Lance

2009-05-28 23:09:20

Nauman there is no black outline, the outline of the hp bar changes as the colors change. but sure ill try that just FindColors i ssuppose it would be the fastest. DDTM's.. what was i thinking? XD

Edit: actualy, if there is an enemy or another person standing by you, find color would catch there HP bar aswell… your enemies HP bar will go over top of yours. so if they are on the space to your left, then the green tip of the left side of yoru bar will be hidden by the red of there bar. so it might be more efficiant to surch for your enemys bar than your own…

Edit: heres a picture of the hp bar behign hidden:

Naum

2009-05-28 23:11:28

There is a black outline, and if it does change have more than 1 color.

Edit: Lance not a bad idea, though this could backfire if say your in a Cow field, other people are killing cows but you aren't and the script detects a HP bar.

Lance

2009-05-28 23:22:33

yeah this is kinda got me stumped haha. i cant think of a fail proof way of detecting the right HP bar, unless we look for the enemies by using reflection to check which direction your charicture is facing, and then looked for a HP bar within 50 pix of your position in that direction..

Infantry001

2009-05-28 23:54:28

But if you're using reflection anyways, you can just get the HP from there XD

Naike

2009-05-28 23:56:35

Already fixed InFight and IsFightAt.
Not much to worry about.

Take a look in the puplic svn section ;D

Lance

2009-05-29 00:02:18

ok lol thanks

marpis

2009-05-29 01:21:05

everyone ignored my function :'(

Smartzkid

2009-05-29 04:07:31

Use a DTM of the last full-height row in the bar (dtm the pixel at the top of the outline & at the bottom)

Cazax

2009-05-29 04:38:45

Please try my fix: http://www.villavu.com/forum/showthread.php?p=576294#post576294

DeSnob

2009-05-29 05:16:06

There are also new flags, and dungeon symbols :\

Naum

2009-05-29 12:48:01

Yeah, Cazax did exactly what I explained :)

Wizzup?

2009-05-29 14:40:46

From: lancerawks
haha so you think just a simple FindColorTolerance will suffice?

Edit: oh i hadnt thought of that shut ill see which one works better ;D


Yes. I've made functions with that before. FindColorsTolerance should suffice.
EDIT: Seems like it has been done already. Will comment on that thread.