Jump to content

АвТОзаТоЧкА--- авто-gracia_final +1.


SokQ

Recommended Posts

//  авто-gracia_final +1.

//  хроники  Грация ФИНАЛ

//  Соцдействие ДА открыть управление скриптом

//  в пати чат пишем уровень заточки

//  можно менять в процесе работы скрипта

//  заточить один предмет чтоб запомнить чем и что точить

//  дальше скрипт сам точит до указаного уровня заточки

//  все предметы ОДИНАКОВЫЕ  с  ПЕРВЫМ  заточеным

//  предметы точатся добавляя по +1 на предмет

//  т.е если у вас предметы с  одинаковым уровнем заточки например 0

//  будет точится первый предмет до +1, потом второй до +1 и т.д

//  если предмет при заточки блесс скрол слетел на 0 или на уровень как у вас на сервере

//  то будет точиться он пока несравняется с остальными

//  и т.д

//  пока недостигнете заданого уровня заточки

//  если предметов более 1 то один остается

//  АВТОР ==>>>> TAMBIK

program Enchant_gracia;

  const

//===========================================

 

  myname='TAMBIK'; //<<== пишем свой НИК

 

  max=80;//<<== колличество ячеек в рюкзаке

 

   

//===========================================

    HTML='<html><body><center>'+

'<img src="L2UI_CH3.herotower_deco width=256 height=32>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<font color="04fbfb">Cкрипт автозаточка для gracia_final</font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=1>'+

'<font color="04fbfb">системные сообщения</font><br>'+

'<button value="в к л" action="bypass -3"      width=80 height=15  back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">            </font><br>'+

'<button value=" в ы к л " action="bypass -4" width=80 height=15  back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">            </font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=4>'+

'<font color="04fbfb">АВТОЗАТОЧКА</font><br>'+

'<font color="04fbfb">            </font><br>'+

'<button value="П У С К" action="bypass  -pusk"    width=100 height=15 back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">          </font><br>'+

'<button value="С Т О П" action="bypass  -stop"    width=100 height=20 back="sek.cbui94"  fore="sek.cbui92">'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="04fbfb">          </font><br>'+

'<img src="L2UI.SquareWhite" width=260 height=1>'+

'<img src="L2UI.Squarewidth" width=260 height=4>'+

'<img src="L2UI.SquareWhite" width=60 height=1>'+

'<img src="L2UI.Squarewidth" width=60 height=4>'+

'<font color="LEVEL">Автор TAMBIK</font><br>'+

'</center></body></html>';

//==========================================

  var

    BaseItems:array[1..max,1..11] of integer;

    Baselvl:array[0..max] of integer;

    Timer01: TTimer;

    Timer02: TTimer;

    Timer03: TTimer;

 

    mytext:string;

    Bypass:string;

    autostart,start,autoMsg:Boolean;

    flag : Boolean;

    t,l,d,x,y,ii,i:integer;

 

    ListSize,ItemEnch:word;

    textID,itemID:integer;

    enchantObjectID:integer;

    enchantID,skrolObjectID:integer;

    ItemOID,objectOID:integer; 

    sumskrol,sumitemID,sumitem:integer;

    maxlvl,minlvl,enchlvl,selectlvl:integer;

    skrolID,skrolObj:integer;

    minEnchitem:integer;

    object,index : integer;

//==========================================

//  ShowHTML(HTML);

Procedure ShowHTML( _html : string );

begin

  buf:=#$19;

  WriteD(5);

  WriteS(_HTML);

  SendToClientEx(myname);

  end;

//========================

procedure ActionUse;

begin

    Bypass:=ReadS(2);

    case Bypass of

  '-3':begin  autoMsg:=true; end;

  '-4':begin  autoMsg:=false; end;

  '-pusk':begin

  if (autostart=false) then SendMsg2( 'предмет незаточен или пакеты неприняты !' );

  if (maxlvl=0) then SendMsg2( '  Неуказан Уровень Заточки  !' );

    SendMsg2( '_______________________________' );

  if autostart and  (maxlvl>0)  then begin

        buf:=hstr('14');

        SendToServerEx(myname);

      SendMsg2( '        ! ! !  П О Е Х А Л И    ! ! !' );

      SendMsg2( '_______________________________' );

      start:=true;

      Timer01.enabled:=true;// вкл таймер выбора свитка

      end;

    end;

  '-stop':begin

    deleteBase;

    start:=false;

    enchantID:=0;

    ItemEnch:=0;

      minlvl:=0;

    sumitem:=0;

    Timer01.enabled:=false;

    Timer02.enabled:=false;

    Timer03.enabled:=false;

    SendMsg2( '        ! ! !  С Т О П  ! ! ! ' );

    stopselectskrol;

    index :=0;

for ii:=1 to max do

  Baselvl[ii]:=-1;

  end;

end;

end;

//===========================================

procedure SendMsg2(msg:string);

begin

  buf:=#$4A;

  WriteD(0);

  WriteD(3);

  WriteS('');

  WriteS(msg);

  SendToClientEx(myname);

end;

//===========================================

procedure Resultmaxlvl;

var

  i:integer;

begin

    i:=2;

    mytext:=ReadS(i);

    textID:=ReadD(i);

if (textID=3)  then begin

    maxlvl:=StrToInt(mytext);

SendMsg2( '  установлен Уровень Заточки: '+IntToStr(maxlvl)+'' );

end;

end;

//..............................................................................

procedure ItemList;

var

  i, j, k: integer;

  count,x:integer;

begin

  count:=0;

  x:=0;

  y:=0;

  j:=4; //пропускаем дo ListSize

  ListSize:=ReadH(j);

  count:=round((Length(pck)-5) / ListSize);// длина блока

  for i:=1 to ListSize do

  if (i<=ListSize) then begin

      BaseItems[i,1]:=ReadH(j);  //ItemType1- 1:одето броня. 0:бижа. 4:в рюкзаке

      BaseItems[i,2]:=ReadD(j);  //ObjectID

      BaseItems[i,3]:=ReadD(j);  //ItemID

      BaseItems[i,4]:=ReadD(j);  //LocationSlot

      BaseItems[i,5]:=ReadD(j);  //  Amount:

      BaseItems[i,6]:=ReadD(j);  //  Amount:

      BaseItems[i,7]:=ReadH(j);//ItemType2

      BaseItems[i,8]:=ReadH(j);// CustomType1

      BaseItems[i,9]:=ReadH(j);//isEquipped:

      BaseItems[i,10]:=ReadD(j);//BodyPart

      BaseItems[i,11]:=ReadH(j);//EnchantLevel

            inc(x); // счетчик

            //y := пропускаем до следущего блока

    y:=count*x-(j-6);// . 6= длина ListSize + 4 байта пропуска в начале пакета

            inc(j,y);

  end else for k:=1 to 11 do BaseItems[i,k]:=0; // забиваем нулями

        addenchantitemID;

 

if (skrolID>0)  then begin

    sumskrol:=Getitem(skrolID,3,5);//считаем SKROL

if autoMsg  then SendMsg2 ('  SKROL ... c  ID : '+IntToStr(skrolID)+' =  '+IntToStr(sumskrol)+' ШТ ');

if start and (0<sumskrol) then  Timer01.enabled:=true;// вкл таймер выбора свитка

if (sumskrol=0)  then  begin

  SendMsg2 ('........ НЕДОСТАТОЧНО  SKROL........  ');

  SendMsg2 ('___ О С Т А Н О В Л Е Н О ___ ');

  start:=false;

end;

end;

end;

//=============================

procedure EnchantResult;

  begin

  deleteBase;

  index :=0;

for ii:=1 to max do

  Baselvl[ii]:=-1;

  end;

//=============================

procedure deleteBase;

var

  i,j,k:integer; 

begin

    for i:=1 to max do

      BaseItems[i,1]:=0;

      BaseItems[i,2]:=0; //ObjectID 

      BaseItems[i,3]:=0;  //ItemID

      BaseItems[i,4]:=0; 

      BaseItems[i,5]:=0;

      BaseItems[i,6]:=0;

      BaseItems[i,7]:=0;

      BaseItems[i,8]:=0;

      BaseItems[i,9]:=0;

      BaseItems[i,10]:=0;

      BaseItems[i,11]:=0;

      inc(j,y); 

end;       

//===========================

function Getitem(Obj,up,down:integer): integer;

var

  i: integer;

begin

Result:= 0; //В начале у нас 0

  for i:=1 to max do

    if (BaseItems[i,up]=Obj) then begin

      Result:=BaseItems[i,down];

  end;

end;

//===========================

function Getsumitem(Obj,up,down:integer): integer;

var

  i: integer;

begin

Result:= 0; //В начале у нас 0

  for i:=1 to max do

    if (BaseItems[i,up]=Obj)  then begin

      Result:=Result+BaseItems[i,down];

  end;

end;

//=============================

 

// добавляем в базу  ЛВЛ заточки

procedure  addenchantitemID;

begin

        for i:=1 to max do

if (BaseItems[i,3] = ItemOID)  then  begin

        enchlvl:=BaseItems[i,11];

    flag:=false;

          for ii:=1 to max do

  if (Baselvl[ii] = enchlvl) then  begin // текущий  уже есть в массиве,

      flag := true;

        BREAK; { прекращаем цикл }

          end;

if (flag = false) then begin

        for ii:=1 to max do

  if (Baselvl[ii]=-1) then begin // добавим  в массив,

        Baselvl[ii]:=enchlvl; 

          index :=ii;

      BREAK; { прекращаем цикл }

  end;

end;

end;

end;

//==========================

procedure ChooseInventory;

var

OID, lvl:integer;

begin

  if (ItemOID>0) and start then  begin

          sumitemID:=0;

      sumitemID:=Getsumitem(ItemOID,3,5); // считаем предметы для заточки

              minlvl:=Baselvl[1];

      for ii:=2  to  index  do 

  if  Baselvl[ii] < minlvl  then 

        minlvl:=Baselvl[ii];// мин заточка

        objectOID:=0;

if (sumitemID > sumitem) then objectOID:=GetObjectID(ItemOID);//находим по ItemID  предмет с ObjectID

if (objectOID = 0)  then begin

              start:=false;

      SendMsg2('Больше предметов c ID : '+IntToStr(ItemOID)+' для заточки НЕТ ! ! ! ! ');

          lvl:=0;

        for i:=1 to max do

  if (BaseItems[i,3] = ItemOID) then  begin

        OID:=BaseItems[i,2];

        lvl:=BaseItems[i,11];

SendMsg2('Предмет  c ID : '+IntToStr(ItemOID)+'  с ObjectID : '+IntToStr(OID)+'  заточен до : '+IntToStr(lvl)+' ');

  end;

end;

end;

end;

//=========================

//находим enchantID предмета по  ItemID для заточки

function GetObjectID(ItemOID:integer) : integer;

var

  ID,i:integer;

begin

enchantID:= 0;

  ItemEnch:=0; 

  Result:= 0;

if autoMsg  then  SendMsg2( '*******************************************' );

if (ItemOID>0) then begin

if autoMsg  then  SendMsg2 ('    ищем ObjectID предмета с ID  :  ' +IntToStr(ItemOID)+' ');

if autoMsg  then  SendMsg2('------------------------------' );

 

    for i:=1 to max do

if (BaseItems[i,3] = ItemOID) and (BaseItems[i,11] = minlvl) and (BaseItems[i,11] < maxlvl) then begin

    enchantID:=BaseItems[i,2];

      Result:=BaseItems[i,2];

    ItemEnch:=BaseItems[i,11];

if autoMsg  then  SendMsg2('  ..... найден предмет для заточки  ..... ');

if autoMsg  then  SendMsg2(' ID  : '+IntToStr(ItemOID)+' и ObjectID : '+IntToStr(enchantID)+'  заточен до : '+IntToStr(ItemEnch)+'');

if autoMsg  then  SendMsg2('------------------------------' );

    if (enchantID>0) then  Timer02.enabled:=true;

      Break;  // прерываем дальнейший перебор массива.

end;

end;

end;

//==========================

procedure stopselectskrol;

begin

  buf:=hstr('D04E00');

SendToServerEx(myname);

end;

//===================================

procedure OnTimer01(Sender: TObject);

begin

  buf:=#$19;

  WriteD(skrolObjectID);

  WriteD(0);

  SendToServerEx(myname);

Timer01.enabled:=false;

  end;

//--------------------------

procedure OnTimer02(Sender: TObject);

begin

  buf:=hstr('D04C00');

  WriteD(enchantID);

  SendToServerEx(myname);

  Timer02.enabled:=false;

  Timer03.enabled:=true;

  end;

procedure OnTimer03(Sender: TObject);

begin

  buf:=#$5F;

  WriteD(enchantID);

  WriteD(0);

  SendToServerEx(myname);

  Timer03.enabled:=false;

if autoMsg  then SendMsg2('      .....    Точим Предмет    ..... ');

if autoMsg  then SendMsg2( ' ID :  '+IntToStr(ItemOID)+' и ObjectID : '+IntToStr(enchantID)+'  -  до  :  '+IntToStr(maxlvl)+'' );

if autoMsg  then SendMsg2( '_______________________________' );

end;

//-----------------------------------------

procedure Init;

begin

  minlvl:=0;    maxlvl:=0;  enchlvl:=0; ItemEnch:=0;

  sumskrol:=0;  sumitem:=0; sumitemID:=0;

  objectOID:=0; object:=0;  enchantObjectID:=0;

  enchantID:=0; skrolObjectID:=0;

  skrolID:=0;  itemID:=0; ItemOID:=0;

  t:=0;l:=0;d:=0;index :=0;

 

  flag:=false;

  autostart:=false;

  start:=false;

  autoMsg:=true;

 

  Timer01:=TTimer.Create(nil);

  Timer01.OnTimer:=@OnTimer01;

  Timer01.enabled:=false;

  Timer01.interval:=400; //<<== время  выбора свитка

 

  Timer02:=TTimer.Create(nil);

  Timer02.OnTimer:=@OnTimer02;

  Timer02.enabled:=false;

  Timer02.interval:=400; //<<== время  выбора предмета

 

  Timer03:=TTimer.Create(nil);

  Timer03.OnTimer:=@OnTimer03;

  Timer03.enabled:=false;

  Timer03.interval:=4500; //<<== время между заточкой 

 

SendMsg2( '  в пати чат пишем уровень заточки' );

SendMsg2( '    заточить предмет  !  !' );

SendMsg2( '  Соцдействие  ДА - откр окно управления ' );

SendMsg2( '------------------------------------- ' );

  buf:=hstr('14');

  SendToServerEx(myname);

  for ii:=1 to max do

      Baselvl[ii]:=-1;

end;

procedure Free;

begin

  Timer01.free;

  Timer02.free;

  Timer03.free;

end;

//=========================

begin

//не обрабатываем пустые пакеты

  if pck='' then exit;

if FromServer and (pck[1]=#$87) then  EnchantResult;

if FromServer and (pck[1]=#$11) then ItemList;

if FromServer and (pck[1]=#$7C) then ChooseInventory;

if FromClient and (pck[1]=#$49) then begin Resultmaxlvl;pck:='';exit;end;    //

if FromClient and (pck[1]=#$56) and (ReadD(2)=24) then begin

          ShowHTML(HTML); pck:='';exit; end;

if FromClient and (pck[1]=#$23)  then begin ActionUse; pck:='';exit;end;    //

begin

if (start=false) and FromClient then 

    case pck[1] of

#$19:begin

        stopselectskrol;

        buf:=hstr('14');

        SendToServerEx(myname);

      t:=1;

    skrolObjectID:=ReadD(2);

    skrolID:= Getitem(skrolObjectID,2,3);//находим по ObjectID скрол с ItemID

    SendMsg2(' .................' );

    SendMsg2('  активирован SKROL  ID : '+IntToStr(skrolID)+' ' );

    SendMsg2(' .................' );

          end;

#$D0:if  ReadH(2)=76 then  begin

      l:=1;

      SendMsg2('    окно выбора предмета ' );

      SendMsg2(' .................' );

    end;

#$5F:begin

      d:=1;

    enchantObjectID:=ReadD(2);

    if  (t=1) and (l=1) and (d=1) then begin

        autostart:=true;

      ItemOID:= Getitem(enchantObjectID,2,3);//находим по ObjectID предмет с ItemID

    SendMsg2 ('  ID предмета :  '+IntToStr(ItemOID)+'  для заточки');

  sumitemID:=0;

  sumitem:=0;

  sumitemID:=Getsumitem(ItemOID,3,5); // считаем предметы для заточки

  SendMsg2 (' Предметов для заточки с  ID :  '+IntToStr(ItemOID)+'  =  '+IntToStr(sumitemID)+' ШТ ');

      if (sumitemID > 1) then sumitem:=1;

      stopselectskrol;

      end;

    end;

  end;

end;

end.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • New locations pool! Try it and make your effency greater with Asocks.com!
    • Greetings, Adventurers! 🎉 Announcement: L2 Noxis OBT Server Launch! 🎉 Adventurers of Aden, the moment you’ve been waiting for is here! We are thrilled to announce the official launch of the L2 Noxis Open Beta Test (OBT) Server! Gear up and get ready to embark on an epic journey in the world of Lineage 2 with a plethora of new and exciting features: 🔥 Features of L2 Noxis: Path of Rogue server: Modern Auto-Hunting System: Enjoy a seamless and modern auto-hunting experience, just like in the Essence chronicle. Free To Play Structure: Earn Einhasad's Golden Coins and Tarot cards through various in-game activities, making your adventure rewarding and enjoyable. Long-Term Project: Join us in a long-term commitment to provide a stable, exciting, and evolving gaming environment. Robust Anti-Cheat System: Play with confidence knowing that we have implemented a top-notch anti-cheat system to ensure a fair and balanced gaming experience. Newest Chronicle - Lineage 2: Path of Rogue: Experience the latest chronicle with new content, challenges, and adventures. New Classes: Unleash the power of the Death Knight and the mystical abilities of the Shinemaker. Discover new skills, abilities, and strategies with these exciting classes. Enhanced Rates: Enjoy 2x experience points and 2x adena drop rate, making your progression faster and more rewarding. Join us on this incredible journey and be among the first to experience the wonders of the L2 Noxis server. Gather your friends, form alliances, and conquer the lands of Aden!   📅 Launch Date: [July 10, 2024]   Stay tuned for more updates and get ready to explore, battle, and thrive in the world of L2 Noxis! For more information and instructions how to join the OBT, visit our official website: L2Noxis.com See you in Aden, warriors! 🌟     L2 Noxis Team  
  • Topics

×
×
  • Create New...