SRL Archive - OSR Help

Get your personal healthbar status


Tombraider

2013-02-27 20:52:39

As the title states does anyone here have a method that gets the healthbar going down when you're in combat? It must be your own accurate healthbar no one elses. I hope to get some response i couldn't find any function for it nor do i know how to use the skill list fonts if anyone could help me that would be very much apreciated.

Greetings tombraider

rj

2013-02-27 20:55:13

Program testP06;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
Const
YourHealth = 10;
var
GreenP,RedP,MyHP:Integer;
Health,HealthPercent,AllP,HpPercentMissing,Missing_Health:Extended;
PercentHP:Extended;
Procedure ShowHealth;
Begin
if (RedP < 1) or (GreenP < 1) Then
Begin
Exit;
End;
AllP := (RedP + GreenP);
HpPercentMissing := (RedP/AllP);
Missing_Health := (MyHP*HpPercentMissing);
Health := ((MyHp) - (Missing_Health));
PercentHP := ((RedP/AllP)*100);
Writeln('I have about ' + ToStr(Health)+ ' HP left');
Writeln('Percent:' + ToStr(PercentHP));
End;
Procedure WriteColors;
Begin
Writeln('Green:' + IntToStr(GreenP));
Writeln('Red:' + IntToStr(RedP));
End;
Procedure CountColors;
Begin
GreenP := CountColorTolerance(65280,245,140,281,154,3);
RedP := CountColorTolerance(255,245,140,281,154,3);
End;
Begin
SetupP07Include;
ActivateClient;
Wait(500);
P07_MakeCompassNorth;
P07_MakeCameraAngleHigh;
MyHP := YourHealth;
CountColors;
WriteColors;
ShowHealth;
End.

Make sure it searches for your health bar It may be slightly off

Tombraider

2013-02-27 21:00:21

Thank you very much for your response! I have a script wich is a area full of other players around wich could get attacked aswell since the player that is attacked might be on my spot it will find his HPbar instead of mine.. could we make it more specific?

rj

2013-02-27 22:07:48

 GreenP := CountColorTolerance(65280,245,140,281,154,3);
RedP := CountColorTolerance(255,245,140,281,154,3);

Make sure that is the coords of your hp bar

Tombraider

2013-02-27 22:09:03

Shal that be accurate enough? Because when i'm standing on someones spot and he gets the hp bar he will have the same coordinates.

rj

2013-02-27 22:11:06

as long as it's on your health bar