SRL Archive - OSR Help

Help Checking Health


AllAces777

2010-12-12 18:01:43

I have been through these forums for a few days now looking at health checking options, here is a list of whats available.

GetMMLevels('hp', Color) - Works ok, but returns the first 2 digits if you health is over 100

HPPercent - Never got this to work, always returned -1.

GetHp - Seen this referenced a few times, never could find it in any include files. Outdated?

There are more options out there but a bit beyond what I can do. The GetMMLevel worked the best, but I believe it was setup for when RS had a max of 100 hitpoints or health.

My main problem with using GetMMLevel() is that if your health is over 100, it returns 10 or the first 2 digits of the health.

Can anyone point me to a fix for this or another method/ function that does this?

Thanks for any help!

mormonman

2010-12-12 18:10:22

Do you care if it is reflection?

Gu3st...

2010-12-12 18:15:54

Yeah, I think you're correct; SRL is setup for 2-digit HP system…
The only solution is to update the procedures and functions. It shouldn't be a very hard fix though

AllAces777

2010-12-12 18:18:14

Thanks for verifying that. I will look over the code in the SRL and see if its something I can do, lol.

Sorry MormonMan, I'm pretty new to SCAR, so I haven't looked into Reflection at all.

Thanks for the Replies!

AllAces777

2010-12-12 18:54:36

Instead of changing the SRL includes, I just utilized the use of the Color, if its Red = danger, Green = good to fight.


procedure CheckHealth;
begin
Health:= GetMMLevels('hp', Color);
writeln('Health: ' + IntToStr(Health) + ', Color: ' + Color);
end;

Thanks for the help though!

Gu3st...

2010-12-12 18:58:17

Glad you worked out a solution :)

This is a bug that should be fixed though.. I'll look into it later (if I remember)

KingKong

2010-12-12 22:01:46

From: AllAces777
I have been through these forums for a few days now looking at health checking options, here is a list of whats available.

GetMMLevels('hp', Color) - Works ok, but returns the first 2 digits if you health is over 100

HPPercent - Never got this to work, always returned -1.

GetHp - Seen this referenced a few times, never could find it in any include files. Outdated?

There are more options out there but a bit beyond what I can do. The GetMMLevel worked the best, but I believe it was setup for when RS had a max of 100 hitpoints or health.

My main problem with using GetMMLevel() is that if your health is over 100, it returns 10 or the first 2 digits of the health.

Can anyone point me to a fix for this or another method/ function that does this?

Thanks for any help!


Why not just multiply the answer u get by 10? It won't give you the correct hp down to three digits(Eg: hp of 600, using getmmlevel() u get 60, then multiply by 10 to get 600, hp of 599 or 591, using getmmlevel() u get 59, then multiply by 10 to get 590). I think this should be fine if you are going to use in a fighting script or something because the difference is negligible

AllAces777

2010-12-12 22:04:22

Thanks for the idea. That would definitely do what would be needed. For now I think I'm just gonna use the colors. I've tested it out for awhile now and it definitely does whats needed.

Thanks again!