Code: Select all
Program CheckEat;
VAR Stime:TDateTime;
CONST BankBox = $
BoxInBank = $
Steak = $
procedure OpenBox(Box: Cardinal);
var opboxi: Integer;
begin
opboxi:=0;
If FindTypeEx($FFFF,$FFFF,Box,True) = 0 Then
begin
repeat
UseObject(Box);
Wait(500);
CheckSave;
AddToSystemJournal('open $'+IntToHex(Box,8));
FindTypeEx($FFFF,$FFFF,Box,True);
opboxi:=opboxi+1;
until (FindCount > 0) or (opboxi > 50);
wait(100);
end;
end;
Procedure OpenBank(Box: Cardinal);
var opboxi: Integer;
begin
opboxi:=0;
If FindTypeEx($FFFF,$FFFF,Box,True) = 0 Then
begin
repeat
UOSay('bank');
Wait(500);
CheckSave;
AddToSystemJournal('open $'+IntToHex(Box,8));
FindTypeEx($FFFF,$FFFF,Box,True);
opboxi:=opboxi+1;
until (FindCount > 0) or (opboxi > 10);
wait(100);
end;
end;
Begin
OpenBank(BankBox);
wait(500);
OpenBox(BoxInBank);
wait(500);
FindType(Steak,BoxInBank);
If FindQuantity>30 then
begin
Grab(FindItem,30);
Wait(500);
repeat
STime:=Now;
UseType(Steak,$FFFF);
wait(500);
AddToSystemJournal('Eating...Have fun!');
until (InJournalBetweenTimes('manage to eat|feel quite full after|are stuffed!|are simply too full',STime,Now)<>-1);
FindType(Steak,backpack);
If FindCount>0 then
begin
AddToSystemJournal('Огрызки кидаем обратно');
MoveItem(FindItem,0,BoxInBank,0,0,0);
Wait(500);
end;
end;
End;