faq/stealth/blacksmithy.txt · Last modified: 2020/10/11 14:10 by r2d2
 

Blacksmithy

Turn off the autoloop (.options). If the stack doesn't have enough ingots to forge breastplate (25) - the stack is thrown under your feet.

With smelting

The script is using smelting, so you need tongs.

Program Blacksmithy;
{$Include 'all.inc'}

var
ctime, n : TDateTime;
resource, forgeid : Cardinal;

const
plate = $1415;
bs = $13E3;
ingots = $1BF2;
dagger = $0F51;
tongs = $0FBB;
forge = $0FB1;
UseLore = 1; //1 - to train Arms Lore, 0 - no.

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;
    UseSkill('Arms Lore');
    WaitJournalLineSystem(t, 'This|tell', 3000);
    if TargetPresent then CancelTarget;
    n:=now;
  end;
end;

begin
  forgeid := FindType(forge,ground);
  ctime := Now;
  while not Dead do
  begin
    if Connected then
    begin
      SetARStatus(true);
      Hungry(1, backpack);
      waitmenu('to make', 'Armors');
      waitmenu('kind of', 'Platemail');
      waitmenu('to make', 'Breastplate');
      resource := FindType(ingots, backpack);
      if FindCount() > 0 then
      Begin
        if GetQuantity(resource) >= 25 then
        Begin
          CancelTarget;
          usetype(bs, $ffff);
          WaitTargetObject(resource);
        end
        else
        DropHere(resource);
      end;
      wait(5100);
      if InJournalBetweenTimes('Success',ctime,Now) <> -1 then
      begin
        repeat FindType(plate,backpack);
          if FindCount > 0 then
          begin
            WaitTargetObject(FindItem);
            UseType(tongs,$ffff);
            Wait(300);
            WaitTargetObject(forgeid);
            Wait(3100);
          end;
        until (FindCount < 1) or Dead;
      end;
      wait(500);
      ClearJournal;
      if UseLore = 1 then ArmsLore;
    end;
  end;
end.
Arranged in boxes
Program Blacksmithy;
{$Include 'all.inc'}

var
i : Integer;
ctime, n : TDateTime;
resource : Cardinal;

const
scythe = $23C8;
bplate = $1415;
bs = $13E3;
ingots = $1BF2;
dagger = $0F51;
boxtype = $0E7D;

//Настройки
UseLore = 1;
ToBoxes = 1;
ToDo = 1; //0 - bplate; 1 - scythe;

procedure PackItems;
var
tmpid : Cardinal;

begin
  if ToDo = 0 then tmpid := FindType(bplate, backpack);
  if ToDo = 1 then tmpid := FindType(scythe, 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);
      for i:=0 to 50 do
      begin
        if ToDo = 0 then begin waitmenu('to make', 'Armors'); waitmenu('kind of', 'Platemail'); waitmenu('to make', 'Breastplate'); end;
        if ToDo = 1 then begin waitmenu('to make', 'Weapons'); waitmenu('kind of', 'Swords'); waitmenu('to make', 'Scythe'); end;
        resource := FindType(ingots, backpack);
        if FindCount() > 0 then
        Begin
          if GetQuantity(resource) >= 25 then
          Begin
            CancelTarget;
            usetype(bs, $ffff);
            WaitTargetObject(resource);
          end
          else
          DropHere(resource);
        end;
        wait(5100);
        if UseLore = 1 then ArmsLore;
        if ToBoxes = 1 then MoveToBoxes;
      end;
      AddToSystemJournal('Ingots left: ' + IntToStr(GetQuantity(resource)));
    end;
  end;
end.
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki