SRL Archive - SRL Archives

EatFood


JPHamlett

2009-08-22 06:46:10

Ive seen a few requests for a Eating procedure so i decided to make on quick if its already done then srry




{*******************************************************************************
procedure EatFood(i: Integer);
By: J_pizzle
Description: Eats food at given position (1-28)
*******************************************************************************}
function EatItem(i: Integer): Boolean;
begin
Result := False;
if ExistsItem(i) then
begin
MouseItem(i, False);
if (WaitOptionEx('Eat', 'action', Clickleft, 250)) then
begin
Result := True;
Wait(RandomRange(50, 200));
end;
end;
end;

senrath

2009-08-22 11:15:05

Seems pretty good, although I would add an option for right or left clicking, so it would look something like this:
function EatItem(ItemPos: Integer, Left: Boolean): Boolean;
begin
Result := False;
if ExistsItem(ItemPos) then
begin
MouseItem(ItemPos, Left);
Result := Left;
if (Result) then Exit;
if (WaitOptionEx('Eat', 'action', Clickleft, 250)) then
begin
Result := True;
Wait(RandomRange(50, 200));
end;
end;
end;