I haven't tested this at all, but in theory it should work.
Just put this procedure like near the top of the script and everytime you want it to check the health put "CheckHealth;" in some random spots in other procedures and it will check it and eat for you.
Also, at the top of the script you may see something that says "const", if you do add this after "const"(if you don't see "const" just add this stuff at the top of the script and put "const" at the top of it):
Simba Code:
EatAt = 100; //insert the hp percent that you want to eat at.
FirstInvSlot = 1; //First Inventory slot with with food in it?
DirectionToRun = 'N'; //Direction to run away if out of food - 'N' 'E' 'S' or 'W'
^^that is the stuff that you will need to edit for your personal preference, be sure to have your food in the last few inventory slots because it will start at the "FirstInvSlot" and eat going down.
vv Add this procedure somewhere towards the top of your script
Simba Code:
Procedure CheckHealth; //Keep food in last few inventory slots
var
SlotNum:integer;
begin
if (HPPercent < EatAt) then
begin
Writeln('Health is at ' + inttostr(HPPercent) + '. Eating!');
if (SlotNum < 1) then
SlotNum := FirstInvSlot;
if (SlotNum < 28) then
begin
InvMouse(SlotNum,1);
SlotNum := SlotNum+1;
end;
if (SlotNum >= 28) then
begin
Writeln('Health is low and out of food! Running away!');
RunAway(DirectionToRun, True, 2, 5000);
ExitToLobby;
TerminateScript;
end;
end;
end;
I'm not sure how accurate this is, like I said, I didn't test it. But here's my attempt. let me know how it goes.
If you have trouble putting it into the script that you're using, just post the script and I will put it in for you.
Good Luck! (: