Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Tinkering. Dragon World

Only working scripts
Post Reply
Scripts Writer
Novice
Novice
Posts: 130
Joined: 06.05.2008 18:03

Tinkering. Dragon World

Post by Scripts Writer »

Скрипт прокачки Tinkering на clock part для Dragon World.
В одном сундуке Iron инги,Tinker инструменты, a Pig(еда). В другой будем складывать каждые 50 полученных итемов.
Сундуки должны быть в досягаемости для персонажа.

Code: Select all

Program Tinker_Necklace;

const
Sunduk_With_Iron_and_Tools=$404C3CCF;
Sunduk_With_Clock=$404CAA07;
Tools=$1EBC;
Ingot=$1BEF;
Pig=$09BB;
Clock=$104F;

var
k : integer;
TimeStart : TDateTime;


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_Iron;
 begin
  FindType(Ingot,Backpack);
  if (FindCount=0) OR (Count(Ingot)<50) then
    begin
      UseObject(Sunduk_With_Iron_and_Tools);
      wait(250);
      FindType(Ingot,Sunduk_With_Iron_and_Tools);
      if (FindCount>0) and (CountEx(Ingot,$0000,Sunduk_With_Iron_and_Tools)>200) then
        begin
          MoveItem(FindItem,200,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали 200 iron ingots. На данный момент имеем '+IntToStr(Count(Ingot))+' штук. Осталось ещё '+IntToStr(CountEx(Ingot,$0000,Sunduk_With_Iron_and_Tools))+' iron ingots.');
        end
      else
        AddToSystemJournal('Ошибка во время добора Iron Ignots.');
    end
 end;
       
 
procedure Check_Tools;
 begin
  FindType(Tools,Backpack);
  if FindCount=0 then 
    begin
      UseObject(Sunduk_With_Iron_and_Tools);
      wait(250);
      FindType(Tools,Sunduk_With_Iron_and_Tools);    
      if FindCount>0 then
        begin
          MoveItem(FindItem,1,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали Tinker tools из сундука.');
        end
      else
        AddToSystemJournal('Ошибка во время добора Tinker tools.');
    end
 end;


procedure Check_Food;
 begin
  UseObject(Sunduk_With_Iron_and_Tools)
  wait(250);
  FindType(Pig,Sunduk_With_Iron_and_Tools);
  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_Iron_and_Tools,0,0,0);
    end
  else
    AddToSystemJournal('a Pig не был найден в сундуке.');
 end;


Begin

 ClearJournal;
 while not Dead do
   begin
     Check_Connect;
     if InJournal('hungry')=1 then Check_Food;
     Check_Iron;
     Check_Tools;
     
     k:=0;
     TimeStart:=Now;
     WaitMenu( 'Tinkering' , 'Parts' );
     WaitMenu( 'Parts' , 'clock' );
     UseObject(FindType(Tools,Backpack));
      
     repeat 
       wait(100); 
       k := k + 1; 
       Check_World_Save;
     until (InJournalBetweenTimes('You put|failed', TimeStart, Now)<>-1) or (k > 300);
     wait(100);

     if Count(Clock)>50 then 
       begin
         MoveItem(FindItem,GetQuantity(FindItem),Sunduk_With_Clock,0,0,0);
         wait(250);
       end
     else
       AddToSystemJournal(IntToStr(Count(Clock))+' parts of a clock на данный момент в мешке.');
   end    
End.


Mr.Ripley
Posts: 7
Joined: 11.10.2010 0:40

Post by Mr.Ripley »

Помогите со скриптом переделывал его себе под Локпики ....чтоб локпиков наделать вроде все айди и тайпы вставил все названия вписал ... Запускаю скрипт он берёт метал и тинкертулс и всё ...
19:14:41 [Locpik]: Добрали 200 iron ingots. На данный момент имеем 200 штук ОСталось ещё¸ 113 iron ingots.
19:14:42 [Locpik]: Добрали Tinker tools из сундука.
19:15:14 [Locpik]: 0 Lockpic на данный момент в мешке
19:15:47 [Locpik]: 0 Lockpic на данный момент в мешке

Вот скрипт

Code: Select all

Program Tinker_Necklace;

const
Sunduk_With_Iron_and_Tools=$6536861A;
Sunduk_With_Lockpic=$64803C5D;
Tools=$1EB9;
Ingot=$1BF2;
Pig=$097B;
Lockpic=$14FB;

var
k : integer;
TimeStart : TDateTime;


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_Iron;
 begin
  FindType(Ingot,Backpack);
  if (FindCount=0) OR (Count(Ingot)<50) then
    begin
      UseObject(Sunduk_With_Iron_and_Tools);
      wait(250);
      FindType(Ingot,Sunduk_With_Iron_and_Tools);
      if (FindCount>0) and (CountEx(Ingot,$0000,Sunduk_With_Iron_and_Tools)>200) then
        begin
          MoveItem(FindItem,200,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали 200 iron ingots. На данный момент имеем '+IntToStr(Count(Ingot))+' штук. Осталось ещё '+IntToStr(CountEx(Ingot,$0000,Sunduk_With_Iron_and_Tools))+' iron ingots.');
        end
      else
        AddToSystemJournal('Ошибка во время добора Iron Ignots.');
    end
 end;
       
 
procedure Check_Tools;
 begin
  FindType(Tools,Backpack);
  if FindCount=0 then
    begin
      UseObject(Sunduk_With_Iron_and_Tools);
      wait(250);
      FindType(Tools,Sunduk_With_Iron_and_Tools);   
      if FindCount>0 then
        begin
          MoveItem(FindItem,1,Backpack,0,0,0);
          wait(250);
          AddToSystemJournal('Добрали Tinker tools из сундука.');
        end
      else
        AddToSystemJournal('Ошибка во время добора Tinker tools.');
    end
 end;


procedure Check_Food;
 begin
  UseObject(Sunduk_With_Iron_and_Tools)
  wait(250);
  FindType(Pig,Sunduk_With_Iron_and_Tools);
  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_Iron_and_Tools,0,0,0);
    end
  else
    AddToSystemJournal('a Pig не был найден в сундуке.');
 end;


Begin

 ClearJournal;
 while not Dead do
   begin
     Check_Connect;
     if InJournal('hungry')=1 then Check_Food;
     Check_Iron;
     Check_Tools;
     
     k:=0;
     TimeStart:=Now;
     WaitMenu( 'Tinkering' , 'Tools' );
     WaitMenu( 'Tools' , 'Lockpic' );
     UseObject(FindType(Tools,Backpack));
     
     repeat
       wait(100);
       k := k + 1;
       Check_World_Save;
     until (InJournalBetweenTimes('You put|failed', TimeStart, Now)<>-1) or (k > 300);
     wait(100);

     if Count(Lockpic)>50 then
       begin
         MoveItem(FindItem,GetQuantity(FindItem),Sunduk_With_Lockpic,0,0,0);
         wait(250);
       end
     else
       AddToSystemJournal(IntToStr(Count(Lockpic))+'  Lockpic на данный момент в мешке.');
   end   
End. 
RaTaMaHaTTa
Novice
Novice
Posts: 89
Joined: 16.06.2008 12:22
Location: <||TORCHKI||>
Contact:

Post by RaTaMaHaTTa »

Code: Select all

     WaitMenu( 'Tinkering' , 'Tools' );
     WaitMenu( 'Tools' , 'lockpick' );
Ну в принципе у тебя везде слово lockpick без к на конце.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Post by Vizit0r »

плевать, главное чтоб "lockpic" было вслове(фразе) пункта меню.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply