Bowcraft

Скрипт на стрелы\болты:

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

var
i : Integer;

Const
ShaftsType = $1BD4;
FeathersType = $1BD1;
arrowtype = 'bolt'; //'bolt' или 'arrow'

procedure FullDisconnect;
begin
  SetARStatus(false);
  Disconnect;
end;

procedure CheckShafts;
var k : Integer;
begin
  WaitConnection(3000);
  CheckSave;
  findtype(ShaftsType, ground);
  if (findfullquantity >= 100) then
  Exit;
  Disconnect;
  wait(5000);
  WaitConnection(3000);
  AddToSystemJournal('Мало Shafts! Ждем, пока ктото подкинет');
  while findquantity < 100 do
  begin
    WaitConnection(3000);
    CheckSave;
    UOSay('У меня мало Shafts! Подкиньте кто-то Shafts!');
    k := 0;
    while (k < 20) and (findquantity < 100) do
    begin
      wait(10000);
      k := k + 1;
      findtype(ShaftsType, ground);
    end;
    hungry(1, ground);
    wait(1000);
    findtype(ShaftsType, ground);
  end;
  AddToSystemJournal('Shafts появились! Продолжаем работать дальше!');
end;

procedure CheckFeathers;
var k : Integer;
begin
  WaitConnection(3000);
  CheckSave;
  findtype(FeathersType, ground);
  if (findfullquantity >= 100) then
  Exit;
  Disconnect;
  wait(5000);
  WaitConnection(3000);
  AddToSystemJournal('Мало Feathers! Ждем, пока ктото подкинет');
  while findquantity < 100 do
  begin
    WaitConnection(3000);
    CheckSave;
    UOSay('У меня мало Feathers! Подкиньте кто-то Feathers!');
    k := 0;
    while (k < 20) and (findquantity < 100) do
    begin
      wait(10000);
      k := k + 1;
      findtype(FeathersType, ground);
    end;
    hungry(1, ground);
    wait(1000);
    findtype(FeathersType, ground);
  end;
  AddToSystemJournal('Feathers появились! Продолжаем работать дальше!');
end;

function GrabShafts : Boolean;
var c : Integer;
stime : TDateTime;
Shaft : Cardinal;
begin
  Shaft := FindType(ShaftsType,ground);
  if Shaft = 0 then
  begin
    AddToSystemJournal('Error with grab Shafts. Shafts not finded at ground');
    result := false;
    Exit;
  end;
  stime := Now;
  Grab(Shaft, 1);
  repeat
    c := InJournalBetweenTimes('performing|doing', stime, Now);
    wait(100);
  until (Now > stime + (1.0/1440)) or (c >= 0) or (FindType(ShaftsType,backpack) <> 0);
  wait(100);
  result := true;
end;

procedure Make;
var c : Integer;
stime : TDateTime;
Shafts : Cardinal;
Feather : Cardinal;
begin
  if GrabShafts = false then
  begin
    wait(1000);
    Exit;
  end;
  Shafts := FindType(ShaftsType,backpack);
  if Shafts = 0 then
  begin
    AddToSystemJournal('Error with make arrows. Shafts not finded at ground');
    Exit;
  end;
  Feather := FindType(FeathersType,ground);
  stime := Now;
  UseObject(Shafts);
  WaitTargetObject(Feather);
  wait(200);
  repeat
    c := InJournalBetweenTimes('performing|doing', stime, Now);
    InJournalBetweenTimes('create|make|destroy', stime, Now);
    wait(100);
  until (LineCount >= 1) or (Now > stime + (1.0/1440)) or (c >= 0);
  wait(100);
end;

Begin
  AutoMenu('create', arrowtype);
  FindDistance := 2;
  WaitConnection(3000);
  CheckSave;
  wait(5000);
  SetARStatus(true);
  while true do
  begin
    FindType(FeathersType,ground);
    AddToSystemJournal('Осталось '+IntToStr(FindFullQuantity)+' перьев.');
    WaitConnection(3000);
    CheckSave;
    CheckTargetError(5, 2);
    CheckShafts;
    CheckFeathers;
    Hungry(1,ground);
    wait(1000);
    i := 0;
    while i < 200 do
    begin
      Make;
      i := i + 1;
    end;
  end;
End.
 
faq/stealth/bowcraft.txt · Последние изменения: 2019/11/18 15:43 — tsatsur
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki