SRL Archive - OSR Help

if (HPPercent < 786) then


gaetano

2011-12-27 20:55:43

I need help with this script that I am making. Just having problems with this one procedure


program SecretForNow;

{$DEFINE SMART}
{$i SRL\SRL.scar}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := 'dfgd';
Pass := 'sdfsdf';
Pin := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Runecrafting';
Active := True;
end;
end;



procedure SetupChar;

begin

SetAngle(True);
MakeCompass('S');
Retaliate(True);
end;


procedure WalkToPad;

Begin
if (HPPercent < 786) then

begin
Mouse(651, 37, 1, 1, True);

End;
End;



Begin

Smart_Server:=35;
SetupSRL;
DeclarePlayers
Repeat
WalkToPad;
Until (false)
End.

I need it so that if it is under the (#) Hp, itll run to the co-ord's but with this script, It will run to the co-ord's even with full hp. I need help, please :)

Thank you.

YoHoJo

2011-12-27 20:59:28

That's because HPPercent is a PERCENT.
So 0-100% are only things that will work, no such thing as 786%?!

So make it like HpPercent < 25
That way if you have less than 25% of your HP left, it will run.

Brandon

2011-12-27 21:00:35

Umm I don't know if you know this.. but your doing if % < 786.. 786%?! Edit: Ahh got ninja'd -_-

try this:


Function HPLevel: Integer;
var
ColourString: String;
HP: Integer;
begin
HP:= GetMMLevels('HP', ColourString);
Result:= HP;
end;

Function CheckHP: Boolean;
begin
if (HPLevel < 786) then
//do whatever you want..
end;

DemiseScythe

2011-12-27 21:04:14

I had trouble with this and HPPercent was returning true for less than 50% when I had 990/990 lp.

I am using this to check if one needs eating:


if FindColorTolerance(x, y, 255, 724, 27, 745, 44, 5) then
begin
//Do this
end;

This will detect the red numbers next to the hp counter. These numbers turn red when you are under 25% of your max lp, replace 255 with the color for orange and it will eat between 25% and 50%. This is what I came up to counter HPPercent not working right. The 255 is the color and 5 is the tolerance.

gaetano

2011-12-27 21:22:39

Thanks everyone! :)

Haha it works :)

I just put 50%, now I have to implement an anti ban incase it dies >.<

Can someone help me add this into the script? like

if run percentage is over 50, turn run on? I couldn't find it anywhere.

Sorry for the triple post but,

I got the run statement, but how do I make it so that it only clicks the run symbol once?


procedure RunOn;
begin
if not (LoggedIn) then
Exit;
begin
if RunEnergy(55) then
begin
Mouse(728, 111, 1, 1, True);
end;
end;
end;