SRL Archive - OSR Help

Health points


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:

riwu

2013-03-16 05:04:53

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.

ikillthechickens

2013-03-16 05:20:11

GetMMLevels works for 07?

Justin

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.


That will only work for EoC, He want's this in OSR.

rj

2013-03-16 10:14:16

You may have to change the coords around a little bit:

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.

litoris

2013-03-16 12:55:04

There is a function called HPPercent in SRL-OSR…

l6bustank

2013-03-16 16:20:18

From: litoris
There is a function called HPPercent in SRL-OSR…

Cant find it in the include 0_o … Or am I looking form the wrong place?

litoris

2013-03-17 03:19:38

From: l6bustank
Cant find it in the include 0_o … Or am I looking form the wrong place?


Do you have SRL-OSR? If you do, including it at the top and then searching for it on the left frame should work.

l6bustank

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.

under SRL-OSR do you mean the unofficial 07-include or is there sth else I dont know about?

E: Downloaded the include from Github and also placed the fonts uploaded here: http://villavu.com/forum/showthread.php?t=98324 to C:/Simba/Fonts, but… I still get this error:
[Error] C:\Simba\Includes\SRL-OSR/SRL/core/text.simba(805:13): Unknown identifier 'UpChars07' at line 804

What should I do about it?