Carpentry
Program Carpentry;
{$Include 'all.inc'}
var
i : Integer;
ctime, n : TDateTime;
const
madeitem = $0DF0; //Black staff
saw = $1035;
logs = $1BDD;
boxtype = $0E7D; //type of box to put in
//Настройки
UseLore = 1; //Arms training
ToBoxes = 1; //0 - not to arrange in boxes, 1 - every penny counts!
procedure PackItems;
var
tmpid : Cardinal;
begin
tmpid := FindType(madeitem, backpack);
if FindQuantity > 0 then MoveItem(tmpid, 1, FindType(boxtype, backpack), 0, 0, 0);
end;
procedure MoveToBoxes;
var
boxid : Cardinal;
begin
FindType(boxtype, backpack);
UseObject(FindItem);
if (FindCount > 0) then
begin
boxid := FindItem;
if CountEx($ffff, $ffff, boxid) > 499 then
begin
drophere(boxid);
wait(500);
ignore(boxid);
end;
PackItems;
end;
end;
procedure ArmsLore;
var
d, t: TDateTime;
begin
d:=StrToTime('0:00:11');
if ((now - n) > d) or (n = 0) then
begin
t:=now;
FindType($0F51,backpack);
if FindCount > 0 then
begin
WaitTargetType($0F51)
end;
FindType($0F43,backpack);
if FindCount > 0 then
begin
WaitTargetType($0F43)
end;
UseSkill('Arms Lore');
WaitJournalLineSystem(t, 'This|tell', 3000);
if TargetPresent then CancelTarget;
n:=now;
end;
end;
begin
ctime := Now;
while not Dead do
begin
if Connected then
begin
SetARStatus(true);
Hungry(1, backpack);
waitmenu('to make', 'Staffs and Poles');
waitmenu('to make', 'Black Staff');
for i := 0 to 50 do
begin
FindType(logs, backpack);
if FindCount() > 0 then
Begin
if GetQuantity(FindItem) >= 12 then
Begin
CancelTarget;
usetype(saw, $ffff);
WaitTargetObject(FindItem);
end
else
DropHere(FindItem); // throw away the logs if not enough, freak out!
end;
wait(4100);
if UseLore = 1 then ArmsLore;
if ToBoxes = 1 then MoveToBoxes;
end;
end;
end;
end.