Категории раздела

Наш опрос

Оцените мой сайт
Всего ответов: 14

Статистика


Онлайн всего: 1
Гостей: 1
Пользователей: 0

Форма входа

Поиск

Мой сайт
Понедельник, 2026-06-22, 1:52 AM
Приветствую Вас Гость
Главная | Регистрация | Вход | RSS

Каталог файлов

Главная » Файлы » Ultima Online DRW » Stealth

Blacksmith
2012-07-09, 9:08 AM
Program Blakcmisthy_Dagger;

const
Sunduk_With_Ignots_and_Bags=$40224BBB;
Sunduk_With_Full_Bags=$403F5322;
Bag=$0E76;
Hammer=$13E3;
Ingot=$1BEF;
Dagger=$0F51;
Pig=$09BB;

var
i : byte;
k : integer;
TimeStart : TDateTime;
Neck_Bag : Cardinal;
Quantity : integer;

procedure Check_Food;
 begin
  UseObject(Sunduk_With_Ignots_and_Bags)
  wait(500);
  FindType(Pig,Sunduk_With_Ignots_and_Bags);
  if FindCount>0 then
    begin
      MoveItem(FindItem,1,Backpack,0,0,0);
      wait(250);
      UseObject(FindItem);
      FindType(Pig,Backpack);
      if FindCount=0 then AddToSystemJournal('Покушали.');
      if FindCount>0 then MoveItem(FindItem,1,Sunduk_With_Ignots_and_Bags,0,0,0);
    end
  else
    AddToSystemJournal('a Pig не был найден в сундуке.');
 end;


procedure Check_Dagger;
 begin
  if Quantity<240 then 
    begin
      FindType(Dagger,Backpack);
      if FindCount>0 then
        begin
         repeat
          MoveItem(FindItem,10,Neck_Bag,0,0,0);
          wait(250);
         until FindType(Dagger,Backpack) = 0;
        end
    end
  else
    begin
      MoveItem(Neck_Bag,1,Sunduk_With_Full_Bags,0,0,0);
      wait(250);
      Quantity:=0;
    end;
  FindType(Dagger,Ground);
   if FindCount > 0
    then  repeat
            MoveItem(FindItem,10,Neck_Bag,0,0,0);
            wait(250);
          until FindType(Dagger,Ground) = 0; 
 end;


procedure Check_Bag;
 begin
  Neck_Bag:=FindType(Bag,Backpack);
  if FindCount>0 then
    begin
      UseObject(Neck_Bag);
      wait(250);
      FindType(Dagger,Neck_Bag);
      Quantity:=FindCount;
      if Quantity>0 then AddToSystemJournal(IntToStr(Quantity)+' daggers на данный момент в мешке.');
      if Quantity=0 then 
        begin
          AddToSystemJournal('Начинаем новую партию изделий.');
          Check_Food;
        end
    end
  else
    begin
      AddToSystemJournal('Мешок не найден в backpacke. Берём новый');
      UseObject(Sunduk_With_Ignots_and_Bags); 
      wait(500);
      FindType(Bag,Sunduk_With_Ignots_and_Bags);
      if FindCount>0 then
        begin
          MoveItem(FindItem,1,Backpack,0,0,0);
          wait(1000);
        end
    end
 end;      


procedure Check_World_Save;
 begin
  if InJournal('saving')<>-1 then
   begin 
    ClearJournal;
    k:=0;
    repeat
      wait(10000)
      k:=k+1;
      AddToSystemJournal('World is saving more than '+IntToStr(k*10)+' seconds.');
    until (InJournal('data')<>-1) or (k>10)
   end
 end;


procedure Check_Connect;
 begin
  if not Connected then 
    while not Connected do 
      begin
        Connect;
        wait(1000);
      end 
 end;


procedure Check_Ingot;
 begin
  
  FindType(Ingot,Backpack);
  if (FindCount=0) OR (Count(Ingot)<50) then
    begin
      UseObject(Sunduk_With_Ignots_and_Bags);
      wait(250);
      FindType(Ingot,Sunduk_With_Ignots_and_Bags);
      if (FindCount>0) and (CountEx(Ingot,$0000,Sunduk_With_Ignots_and_Bags)>200) then
        begin
          MoveItem(FindItem,200,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали 200 ingots. Осталось ещё '+IntToStr(CountEx(Ingot,$0000,Sunduk_With_Ignots_and_Bags))+' ingots.');
          exit;
        end
      else
        AddToSystemJournal('Ошибка во время добора Ignots.');
        i:=i+1;
        exit;
    end
 end;
       
 
procedure Check_Tools;
 begin
  FindType(Hammer,Backpack);
  if FindCount=0 then 
    begin
      UseObject(Sunduk_With_Ignots_and_Bags);
      wait(500);
      FindType(Hammer,Sunduk_With_Ignots_and_Bags);    
      if FindCount>0 then
        begin
          MoveItem(FindItem,1,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали молоток из сундука.');
        end
      else
        AddToSystemJournal('Ошибка во время добора молотка.');
        exit;
    end
 end;


Begin

 ClearJournal;
 while not Dead do
   begin
     Check_Connect;
     Check_Ingot;
     Check_Tools;
     Check_Bag;

     k:=0;
     TimeStart:=Now;
    WaitMenu( 'Blacksmithing' , 'Weapons' );
    WaitMenu( 'Weapons' , 'Swords & Blades' ); 
    WaitMenu( 'Swords & Blades' , 'dagger' );
     UseObject(FindType(Ingot,Backpack));
      
     repeat 
       wait(100); 
       k := k + 1; 
       Check_World_Save;
     until (InJournalBetweenTimes('You put|failed', TimeStart, Now)<>-1) or (k > 300);
     wait(100);

     FindType(Dagger,Backpack);
     if findcount >0 then Check_Dagger;
   end    
End.

Категория: Stealth | Добавил: mypaxa
Просмотров: 847 | Загрузок: 0 | Комментарии: 1 | Рейтинг: 0.0/0
Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]