SRL Archive - OSR Help

Making script check how much health player got


pwnedbymeh

2013-05-11 14:26:14

Im having problem making my script check health and eat if health is low enough.

here is my eating procedure if it helps
procedure eat;
var
x, y, salmon: Integer;
begin
salmon := DTMFromString('mkwEAAHicE2ZgYOAFYhYgZgZiNgYI4ABibiDmB2IhIBYFYgkglgFiSShbFCoHUsMDxFxQWhwqxgtVIw6lhZHUckLtYobaB7ObBUqD5LfYgXQxUglTD1DLRThcBQCvuQMw');
If findDTM (salmon, X, Y, MSX1, MSY1, MSX2, MSY2) then
Writeln('Found salmon');
MMouse(x, y, 3, 3);
If IsUpText('at salm') Then
Writeln('Eating salmon');
Mouse(x, y, 0, 0, True);
end;

jelknab

2013-05-11 14:31:47

if (GetSkillInfo('hitpoints', true) < MinHitPoints) then eat;

pwnedbymeh

2013-05-11 14:58:58

From: jelknab
if (GetSkillInfo('hitpoints', true) < MinHitPoints) then eat;

if (GetSkillInfo('hitpoints', true) < 10) then eat;

like this?

jelknab

2013-05-11 15:09:32

If you want it to eat when you've less then 10 hp then yes.

Haxz

2013-05-11 15:10:44

I think you can use HPPercent.