ikillthechickens
2013-03-16 04:43:16
Hi, is there a method or function that gets the players current hp or hp percentage or something like that.
cheers:bart:
cheers:bart:
2013-03-16 04:43:16
2013-03-16 05:04:53
2013-03-16 05:20:11
2013-03-16 05:53:32
From: riwu
GetMMLevels('hp', {var} color) gets the Hp at the MM icon, then use your max hp to calculate the percent. Alternatively get the hp percent from the combat tab (hover over the hp bar), or calculate it based on the amount of green pixels on the bar.
2013-03-16 10:14:16
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);
P06_MakeCompassNorth;
P07_MakeCameraAngleHigh;
MyHP := YourHealth;
CountColors;
WriteColors;
ShowHealth;
End.
2013-03-16 12:55:04
2013-03-16 16:20:18
From: litoris
There is a function called HPPercent in SRL-OSR…
2013-03-17 03:19:38
From: l6bustank
Cant find it in the include 0_o … Or am I looking form the wrong place?
2013-03-17 08:26:13
From: litoris
Do you have SRL-OSR? If you do, including it at the top and then searching for it on the left frame should work.
[Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804