Code: Select all
program bc;
const
containerID = $4026416B; // конт с логами и шафтами
logType = $1BDD;
arrowType = $0F3F;
shaftType = $1BD4;
featherType = $1BD1;
timeDelay = 1.0/(24*60*12);
var
cTime: tdatetime;
begin
automenu('What do you want', 'shaft');
automenu('Select arrow type', 'arrow');
while NOT dead do begin
wait(100);
if findtype(logType, backpack) = 0 then begin
useobject(backpack);
checklag(70000);
wait(300);
end;
if (findtype(shaftType, backpack) > 0) AND (findquantity > 100) then begin
moveitem(finditem, 0, containerID, 0, 0, 0);
checklag(70000);
wait(300);
end;
if findtype(logType, backpack) = 0 then begin
if findtypeex(logType, $0000, containerID, false) = 0 then begin
useobject(containerID);
checklag(70000);
wait(3000);
end;
while findtypeex(logType, $0000, containerID, false) = 0 do begin
addtosystemjournal('Кончились логи в сундуке.');
wait(20000);
useobject(containerID);
checklag(70000);
wait(3000);
end;
moveitem(finditem, 2, backpack, 0, 0, 0);
checklag(70000);
wait(300);
//findtype(logType, backpack);
moveitem(finditem, 1, containerID, 0, 0, 0);
checklag(70000);
wait(300);
end;
if (injournalbetweentimes('You put', cTime, now) >= 0) OR (cTime+timeDelay <= now) then begin
if targetpresent then
canceltarget;
cTime := now;
waittargettype(logType);
useobject(objatlayer(rhandlayer));
end;
end;
end.