Camping for DW
Posted: 14.05.2005 16:00
				
				Code: Select all
Program knidling;
var
i,n:integer;
d:Cardinal;
procedure Hungry(NeededLevel : Integer); {ïðîâåðêà ãîëîäà îò Ìèðàëåêñà!!!} 
var HArray : array [0..10] of String; 
    CurrentLevel : Integer; 
    HasError : Boolean; 
    TimeSayHungry : TDateTime; 
    FoodID : Cardinal; 
    i,c,difference : Integer; 
begin 
if (NeededLevel < 0) or (NeededLevel > 10) then Exit; 
   HArray[0] := 'You are absolutely stuffed!'; 
   HArray[1] := 'You are stuffed'; 
   HArray[2] := 'hungry at all'; 
   HArray[3] := 'You are a little hungry'; 
   HArray[4] := 'You are somewhat hungry'; 
   HArray[5] := 'You are REALLY hungry'; 
   HArray[6] := 'Your stomash hurts'; 
   HArray[7] := 'Your stomash hurts and you feel dizzy'; 
   HArray[8] := 'You are starving'; 
   HArray[9] := 'You are almost dying of hunger'; 
   HArray[10] := 'You are DYING of hunger...'; 
HasError := true; 
TimeSayHungry := Now; 
UOSay('.hungry'); 
wait(100); 
i:=0; 
while i < 100 do 
   begin 
   for c := 0 to 10 do 
   if InJournalBetweenTimes(HArray[c],TimeSayHungry,Now) >= 0 then 
   begin 
   CurrentLevel := c; 
   HasError := false; 
   i := 100; 
   end; 
   wait(100); 
   i := i + 1; 
   end; 
if HasError then 
   begin 
   AddToSystemJournal('Error with Hungry: Lag? Conection error? Something else?'); 
   Exit; 
   end; 
difference := CurrentLevel - NeededLevel; 
if difference > 0 then for i := 1 to difference do 
   begin 
   wait(5000)
   FoodID := FindType($097B,backpack); 
   if FoodID <> $00 then UseObject(FoodID) 
   else AddToSystemJournal('No Food in Backpack');
   FoodID := FindType($097B,ground);
   if FoodID <> $00 then UseObject(FoodID)
   else AddToSystemJournal('No Food');
   wait(200); 
   end; 
end; 
begin
i:=0;
d := FindType($0DE1,ground); 
while i<1000 do
	begin
	d := FindType($0DE1,ground);
	if d<>$00 then UseObject(d)
	else IgnoreReset;
	i:=i+1;
	if i>=100 then
		begin
		i:=0;
		Hungry(1);
		end;
	wait(1000)
	n:=InJournal('camp')
	if n>0 then
		begin
		Ignore(d);
		ClearJournal;
		end;
	end;
end.