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

Carpentry_fishing_pole DRW

Only working scripts
Post Reply
RaTaMaHaTTa
Novice
Novice
Posts: 89
Joined: 16.06.2008 12:22
Location: <||TORCHKI||>
Contact:

Carpentry_fishing_pole DRW

Post by RaTaMaHaTTa »

Решил выложить скрипт Scripts Writer'a на некласы передалаланный под удочки. Думаю комунебуть прегодится.


Code: Select all

Program Carpentry_fishing_pole;

const
Sunduk_With_logs_and_Tools=$403EDF5F;
Sunduk_With_Empty_Bags=$403F226C;
Sunduk_With_Full_Bags=$403F2266;
Bag=$0E76;
Tools=$1034;
log=$1BDD;
Pig=$09BB;
Pole=$0DBF;
color=$-1;


var
k, l : integer;
TimeStart : TDateTime;
poles_Bag : Cardinal;


procedure Check_Pole;
 begin
   FindType(Pole,Backpack);
   if FindCount>0 then 
     begin
       MoveItem(FindItem,1,poles_bag,0,0,0);
       wait(500);
     end
 end;

 procedure Check_Hidden;
begin
 if not Hidden then
  begin
   while not Hidden do
    begin
      SetWarMode(False);
      useskill('Hiding');
      wait(3600);
    end
    AddToSystemJournal('Спрятались.');
  end
end;


procedure Get_Bag;
 begin
   FindType(Bag,Backpack);
   if FindCount=0 then
     begin
       UseObject(Sunduk_With_Empty_Bags); 
       wait(1000);
       FindType(Bag,Sunduk_With_Empty_Bags);
       if FindCount>0 then
         begin
           MoveItem(FindItem,1,Backpack,0,0,0);
           wait(1000);
           UseObject(FindItem);
           wait(1000);
         end
     end   
   poles_bag:=FindType(Bag,Backpack);
 end; 


procedure Out_Bag;
 begin
 AddToSystemJournal('Мешок заполнен берём новый');
   FindType(Bag,Backpack);
   if FindCount>0 then
     begin
       MoveItem(FindItem,1,Sunduk_With_Full_Bags,0,0,0); 
       wait(1000)
     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>30)
   end
 end;


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


procedure Check_logs;
 begin
  FindType(log,Backpack);
  if (FindCount=0) OR (Count(log)<5) then
    begin
      UseObject(Sunduk_With_logs_and_Tools);
      wait(1000);
      FindType(log,Sunduk_With_logs_and_Tools);
      if (FindCount>0) and (CountEx(log,color,Sunduk_With_logs_and_Tools)>100) then
        begin
          MoveItem(FindType(log,Sunduk_With_logs_and_Tools),100,Backpack,0,0,0);
          wait(1000);
          AddToSystemJournal('Добрали 100 логов. На данный момент имеем '+IntToStr(Count(log))+' штук. Осталось ещё '+IntToStr(CountEx(log,color,Sunduk_With_logs_and_Tools))+' Логов. l='+IntToStr(l)+'; Count='+IntToStr(Count(Pole))+';');
        end
      else
        AddToSystemJournal('Ошибка во время добора Логов.');
        exit;
    end
   FindType(log,Ground);
   if FindCount>0 then
     begin
       MoveItem(FindItem,0,Sunduk_With_logs_and_Tools,0,0,0);
       wait(500);
     end
 end;


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


procedure Check_Last_Bag;
  begin
    FindType(Bag,Backpack);
    if FindCount>0 then
      begin
        UseObject(FindItem);
        wait(500)
        poles_bag:=FindType(Bag,Backpack);  
        FindType(Pole,poles_bag);
        l:=FindCount;
        AddToSystemJournal('В мешке '+IntToStr(l)+' Удочек.');
      end
  end;  


Begin
 ClearJournal;
 CancelMenu;
 AutoMenu( 'Carpentry' , 'Weapons & Tools' );
 AutoMenu( 'Weapons & Tools' , 'fishing pole' );
 while not Dead do
   begin
     Check_Last_Bag;
     Get_Bag;
     repeat
       if Weight>700 then exit;
       Check_logs;
       k:=0;
       TimeStart:=Now;
       UseObject(FindType(Tools,Backpack));
       repeat 
         wait(100); 
         k := k + 1; 
         Check_World_Save;
         Check_Hidden;
       until (InJournalBetweenTimes('You put|failed', TimeStart, Now)<>-1) or (k > 300);
       wait(100);
    if InJournal('put')<>-1 then 
         begin
           AddToSystemJournal(IntToStr(CountEx(Pole,$0000,poles_bag))+'  удочек на данный момент в мешке.');
           l:=l+1;
           Check_Pole; 
         end
       ClearJournal;
     until l>=201  
     if l>=201 then 
       begin
         l:=0;
         Out_Bag;
       end
   end    
End.
Last edited by RaTaMaHaTTa on 11.07.2008 13:52, edited 1 time in total.
Scripts Writer
Novice
Novice
Posts: 130
Joined: 06.05.2008 18:03

Post by Scripts Writer »

Поправь Check_World_Save до k>30
Unholy
Novice
Novice
Posts: 119
Joined: 23.06.2008 2:26
Location: DRW

Post by Unholy »

Scripts Writer wrote:Поправь Check_World_Save до k>30
А кто первый на форуме это заметил) :roll:
RaTaMaHaTTa
Novice
Novice
Posts: 89
Joined: 16.06.2008 12:22
Location: <||TORCHKI||>
Contact:

Post by RaTaMaHaTTa »

Unholy wrote:
Scripts Writer wrote:Поправь Check_World_Save до k>30
А кто первый на форуме это заметил) :roll:
Впринцепе у меня и с 10 проблем небыло.
v26RuS
Novice
Novice
Posts: 61
Joined: 18.05.2008 16:07
Location: DRW
Contact:

Post by v26RuS »

Можно немного еще изменить процедуру

Code: Select all

procedure Check_Pole; 
 begin 
   FindType(Pole,Backpack); 
   if FindCount>0 then 
     begin 
       MoveItem(FindItem,1,poles_bag,0,0,0); 
       wait(500); 
     end 
 end;
на

Code: Select all

procedure Check_Pole; 
 begin 
   FindType(Pole,Backpack); 
   if FindCount>0 then 
     begin 
       while FindCount <> 0 do
       begin
         MoveItem(FindItem,1,poles_bag,0,0,0); 
         l := l+1;
         wait(800); 
         FindType(Pole,Backpack);
         end 
     end 
 end;
но тогда еще придеться изменить и здесь

Code: Select all

    if InJournal('put')<>-1 then 
         begin 
           AddToSystemJournal(IntToStr(CountEx(Pole,$0000,poles_bag))+'  удочек на данный момент в мешке.'); 
           Check_Pole; 
         end
При данном раскладе если во время падания удочки был какойто лаг или еще что-то и скрипт не заметил падания удочки в пак в следующий раз он ее найдет и переместит записав все как нужно.

Взято из скрипта Scripts Writer (Neclace)
Невозможное возможнО!
Post Reply