SRL Archive - OSR Help

how to implement eating?


Ilya

2012-12-02 02:07:11

My eating procedures aren't working.
Is it the HPPercent that is broken?
Because the inventory spots haven't changed, and uptext is working fine?
What are possible ways around it?
Thanks
-Ilya

YoHoJo

2012-12-02 02:16:37

So do you need help with eating procedure?
Or help with making and eating function?

You can check yourself if HP function is working by doing something like
WriteLn(IntToStr(HPPercent));
Not sure if that's the exact right way, but you should get the picture.

As for earing, make a DTM of the food, search for it, and click it.
Check you my YouTube channel YoHoJoSRL to see a video tutorial on how to make DTMs and use them.

Ilya

2012-12-02 03:26:37

i would love help with making an eating function here is roughly what i have now.

procedure Hungry;
var
c, T, i, x, y: Integer;


begin
if (HPPercent < RandomRange(50, 70)) and LoggedIn then
begin
if not InvEmpty then
for c := 0 to 2 do
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
if WaitUptext('Eat', 100) then
begin
Mouse(x, y, 0, 0, false);
if WaitOption('Eat', 100) then
begin
Writeln('Eating.')
t := GetSystemTime;
while ExistsItem(i) and ((GetSystemTime - t) < 2000) do
wait(20);
end;
Exit;
end;
end;
end;
end;

Ilya

2012-12-02 04:07:23

Never mind, what i had was working, i had conflicting vars.
Thanks tho!!

Laimonas171

2012-12-02 06:29:10

From: YoHoJo
So do you need help with eating procedure?
Or help with making and eating function?

You can check yourself if HP function is working by doing something like
WriteLn(IntToStr(HPPercent));
Not sure if that's the exact right way, but you should get the picture.

As for earing, make a DTM of the food, search for it, and click it.
Check you my YouTube channel YoHoJoSRL to see a video tutorial on how to make DTMs and use them.


I'm pretty sure not necesary to change var type if you printing only one var at line.

WriteLn(IntToStr(HPPercent));
AND this one
WriteLn(HPPercent);

should give same output :D (unleas you add)
WriteLn(IntToStr(HPPercent) + 'something'); then it's probably gives back error :D

Rezozo

2012-12-02 08:58:09

Gwag you got it fixed :D
~Rez

Sirenia

2012-12-03 04:39:14

program new implements Eating;

Nah kidding, but this is what I used in a old script, eats lobs at bank :)
procedure Eat;
var
x, y, Tried: integer;
begin
if CurrentHP < EatAt then
begin
FindDTM(Lobster, X, Y, MSX1, MSY1, MSX2, MSY2);
Mouse(X, Y, 7, 7, false);
WaitOption('10', 1500);
Wait(1000 + random(200));
repeat
FindDTM(Lobster, X, Y, MIX1, MIY1, MIX2, MIY2);
Mouse(X, Y, 7, 7, false);
WaitOption('at', 1500);
Wait(1000 + random(200));
Inc(Tried);
Inc(lobstersEaten);
until (CurrentHP = TotalHP) or (Tried > 10)

if FindDTM(Lobster, X, Y, MIX1, MIY1, MIX2, MIY2)then
begin
Mouse(X, Y, 7, 7, false);
WaitOption('ll', 1500);
Wait(500 + random(200));
end;
end;
end;

Ilya

2012-12-03 10:10:06

Well I also noticed that the HPPercent is messed up too. At 86 HP my account has 500+% HP, so I had to set eating at ~200.