Jump to content

Recommended Posts

Posted
7 hours ago, MrAnGel_700 said:

Script For Gold bar in 1kkk Adena?

Can u make it with right click on adena icon? If yes,then u can just add and use adena as an item to use every 1 sec in ur bot.Easier way i guess.. 

  • 3 weeks later...
Posted

Hello, how are you? I need help editing this script for the char to get close to gk, but starting with all goddard respawns, can anyone help me? Just to go next to the GK, which is where the npc buffer is, the rest I've done.

  The script is pretty basic, but all the "if" commands I tried to add made me have a runtime error! Thanks in advance!

__________________________________________________________________________________________

var Figth_Flag:boolean;
     Item: TL2Item;
     Npc: TL2Npc;
     Obj: TL2Buff;
     IdBuff: integer;
     Buffs:TL2Buff;
var L2Skill: TL2Skill;


procedure toVillage;
begin
Print('To Village');
  Delay(100);
    if (User.HP=0) then
      begin
       Delay(2000);
       Engine.GoHome;
       Engine.Facecontrol(0,False);
       Buff;
      end;
end;


procedure buff;
begin
     Print('Go Buffer');
     Engine.Settarget(30361); 
     Delay(1500);
     Engine.Settarget(30361);
     Delay(1500);
     Engine.DlgOpen;
     Delay(1500);
     Engine.DlgSel(1);  // BUFFS
     Delay(800);
     Engine.DlgSel(1);   //Wind Walk
     Delay(400);
     Engine.DlgSel(3);   //Shield
     Delay(400);
     Engine.DlgSel(5);   //Bless Body
     Delay(400);
     Engine.DlgSel(7);   //Mag Barrier
     Delay(400);
     Engine.DlgSel(8);   //Concentration
     Delay(400);
     Engine.DlgSel(9);   //zerk
     Delay(400);
     Engine.DlgSel(11);   //Acumen
     Delay(400);
     Engine.DlgSel(12);   //Empower
     Delay(400);
     Engine.DlgSel(18);   //G. Shield
     Delay(400);
     Engine.DlgSel(20);   //W magic
     Delay(400);
     Engine.DlgOpen;
     Delay(1500);
     Engine.DlgSel(2);   //SONGS
     Delay(400);
     Engine.DlgSel(1);   //Song Earth
     Delay(400);
     Engine.DlgSel(4);   //Song Warding
     Delay(400);
     Engine.DlgSel(5);   //Song wind
     Delay(400);
     Engine.DlgSel(7);   //Song Vitality
     Delay(400);
     Engine.DlgSel(9);   //Song renewal
     Delay(400);
     Engine.DlgOpen;
     Delay(1500);
     Engine.DlgSel(3);   //DANCES
     Delay(400);
     Engine.DlgSel(3);   //Dance Mystic
     Delay(400);
     Engine.DlgSel(6);   //Dance Concetration
     Delay(400);
     Engine.DlgSel(8);   //Dance Siren
     Delay(400);
     Engine.DlgSel(16);   //Malaria
     Delay(400);
     Engine.DlgOpen;
     Delay(1500);
     Engine.DlgSel(4);   //PROFECY
     Delay(400);
     Engine.DlgSel(4);   //Magnus
     Delay(400);
     Engine.DlgSel(19);   //Seraphim
     Delay(400);
     RunTo;
end;


procedure RunTo;
begin
     Print('Go Teleporte');
     Engine.MoveTo(146952, -70120, -3664);
     Delay(500);
     Engine.SetTarget(31031);  //Target do NCP GK
     Delay(1500);
     Engine.DlgOpen; // abre chat combat npc
     Delay(1500);
     Engine.DlgSel(4);
     Delay(1500);
     Engine.DlgSel(3);
     Delay(1500);
     Fight;
end;


procedure toBuff;
  begin
  IdBuff:=1204 ;  //Check BUFF
   while not User.Buffs.ById(IdBuff,obj) do begin
        Print('Check Buff');
        Engine.UseItem(736);  //Scroll Escape
        Delay(7000);
        buff;
   end;
end;


procedure Fight;
   begin
   Print('Fight zone');
    Engine.MoveTo(146952, -70120, -3664);
    Delay(500);
    Engine.MoveTo(146872, -70424, -3560);
    Delay(500);
    Engine.MoveTo(145624, -73352, -4336);
    Delay(500);
    Engine.LoadConfig('1');    //Íàçâàíèå Âàøåãî êîíôèãà
    Engine.LoadZone('zona2.zmap');   //zona de combat
    Print('Ôàðì');
    toVillage;
    Engine.Facecontrol(0,True);
end;


//-----------------------------------------------------------------------------
begin    //repete novamente o script
Print('repete novamente');
  repeat
   toBuff;
   toVillage;
  until Engine.Status = lsOffline;
  Delay(5000);
end.

  • 2 weeks later...
Posted (edited)

uses SysUtils;

const
buff_ID:integer = 1204;

var
loggedIn:boolean;
 
function ShellExecuteW(hwnd: integer; lpOperation, lpFile, lpParameters, lpDirectory: PChar;  nShowCmd:

integer): integer; stdcall;
  external 'Shell32.dll';
 
function keybd_event(bVk, bScan: byte; dwFlags, dwExtraInfo: integer): integer; stdcall;
  external 'user32.dll';

function ShowWindow(hwnd:cardinal; action:integer):boolean; stdcall;
external 'user32.dll';
 
procedure disconnectMonitor;
const
  login = 'lgn';
  password = 'psw';
  gamePath = 'D:\LINEAGE2INTERLUDE\L2INT5\systemORG\l2.exe';
begin
  while engine.Delay(3000) do begin  
    if (Engine.Status = lsOffline) or (Engine.Status = lsOff) then begin
      loggedIn:=true;
      print('dc');
      Engine.FaceControl(0, false);
      Delay(1000);
      Engine.GameClose;
      Delay(1000);
      ShellExecuteW(0, 'open', PChar(gamePath), nil, nil, 0);
      Delay(15000);
      enterText(login);
      Engine.UseKey('Tab');
      Delay(300);
      enterText(password);
      Delay(300);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(10000);
      ShowWindow(engine.gamewindow, 6);
    end;
  end;
end;
 
procedure enterText(const text: string);
var
  i: cardinal;
  upperCase: boolean;
begin
  for i:= 1 to length(text) do begin
    if isDigit(text) then
      Engine.UseKey(text)
    else begin
      upperCase:= text = UpCase(text);
      if upperCase then begin
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
          Engine.UseKey(text);
          delay(10);
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
      end else
        Engine.UseKey(text);
    end;
    Delay(50);
  end;
end;
 
function isDigit(ch: char): boolean;
const
  digits = '013456789';
var
  i: cardinal;
begin
  result:= false;
  for i:= 0 to length(digits) do
    if digits = ch then begin
      result:= true;
      exit;
    end;
end;

function buffCheck: Boolean;
var buff: TL2Buff;
begin
Result:=false;
    if not User.Buffs.ByID(buff_ID, buff) then begin
        Result:=true;
        Print('Buffs are needed...');
        if Engine.SetTarget(31600) then begin //NPC ID
           delay(1111);
        Engine.DlgOpen;
        Delay(1000);
        Engine.DlgSel(9);
        Delay(1000);
        Print('Buffed.');
        Engine.BypassToServer('custom_dobuff ProfBuffs FARM');
       delay(7000);
     Engine.CancelTarget;
    delay(1000);
           Print('Buffed.');
        end else begin
           if (user.target.valid) and (user.target.attackable) then
           while not user.target.dead do delay(50);
           Engine.FaceControl(0, false);
           print('No buffer - doing soe...');
           if engine.entertext('/unstuck') and engine.delay(1111) then
           while user.cast.endtime <> 0 do delay(2222);
           delay(5555);
        end;
    end;
end;

function deadCheck: Boolean;
begin
Result:=false;
    if User.Dead then begin
        Result:=true;
        Print('Dead. Pressing to village.');
        Delay(1000);
        Engine.FaceControl(0,false);
        Engine.GoHome;
        Delay(5555);
    end;
end;
procedure farmAndBack;
begin
while true do begin
delay(1111);
if not loggedIn then begin
if engine.status = lsonline then begin
//---------------------------------------------------
// Goddard
//---------------------------------------------------
    if User.InRange(146272, -58176, -2976, 250, 150) then begin // Near storage
      Print ('11');
      Engine.MoveTo(147221, -58386, -2980);
      Engine.MoveTo(147653, -58034, -2980);
      Engine.MoveTo(147936, -55368, -2760); //near GK
    end;
    if User.InRange(145264, -57680, -2976, 250, 150) then begin // Near storage 2
      Print ('12');
      Engine.MoveTo(145588, -56926, -3007);
      Engine.MoveTo(146673, -56095, -2807);
      Engine.MoveTo(147543, -56054, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(145696, -57696, -2976, 250, 150) then begin // Near storage 3
      Print ('13');
      Engine.MoveTo(145510, -56930, -3007);
      Engine.MoveTo(146499, -56202, -2807);
      Engine.MoveTo(147481, -56031, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(144944, -55392, -2976, 250, 150) then begin // The very edge
      Print ('14');
      Engine.MoveTo(145153, -56813, -3007);
      Engine.MoveTo(145569, -56855, -3007);
      Engine.MoveTo(146467, -56271, -2807);
      Engine.MoveTo(147566, -56034, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(144752, -56752, -2976, 250, 150) then begin // The very edge
      Print ('15');
      Engine.MoveTo(145534, -56884, -3007);
      Engine.MoveTo(146265, -56418, -2807);
      Engine.MoveTo(147407, -56063, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    // East stairs
    if User.InRange(149872, -57424, -2976, 250, 150) then begin
      Print ('16');
      Engine.MoveTo(149897, -56910, -2979);
      Engine.MoveTo(149230, -56412, -2779);
      Engine.MoveTo(147939, -55999, -2772);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(149120, -58064, -2976, 250, 150 )then begin // score
      Print ('17');
      Engine.MoveTo(147706, -58107, -3007);
      Engine.MoveTo(147751, -56737, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(150400, -56752, -2976, 250, 150) then begin // The very edge
      Print ('18');
      Engine.MoveTo(149935, -56870, -3007);
      Engine.MoveTo(149139, -56390, -2807);
      Engine.MoveTo(147929, -56063, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(150704, -55744, -2976, 250, 150) then begin // The very edge 2
      Print ('19');
      Engine.MoveTo(149935, -56870, -3007);
      Engine.MoveTo(149139, -56390, -2807);
      Engine.MoveTo(147929, -56063, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(147700, -58400, -2976, 500, 150)  then begin
      Print ('20');
      Engine.MoveTo(147727, -57141, -2807);
      Print ('Climbing the stairs')
    end;
    if User.InRange(147727, -57141, -2807, 250, 150)  then begin
      Print ('21');
      Engine.MoveTo(147757, -55301, -2759);
      Print ('Moving to the church');
    end;
    if User.InRange(148288, -58304, -2976, 250, 150) then begin // Bottom center stairs slightly to the right
      Print ('22');
      Engine.MoveTo(147738, -58050, -3007);
      Engine.MoveTo(147727, -57141, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(147232, -58480, -2976, 250, 150) then begin  // Bottom center stairs to the left
      Print ('23');
      Engine.MoveTo(147677, -58063, -3007);
      Engine.MoveTo(147727, -57141, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(149088, -56256, -2776, 250, 150) then begin
      Print ('24');
      Engine.MoveTo(147854, -56054, -2807);
      Engine.MoveTo(147934, -55354, -2760);
    end;
    // Area
    if User.InRange(146832, -55904, -2776, 250, 150) then begin // Area to the left of the stairs
      Print ('25');
      Engine.MoveTo(147529, -56046, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(146368, -56256, -2776, 250, 150) then begin // Area to the left of the stairs 2
      Print ('26');
      Engine.MoveTo(147529, -56046, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(147664, -56464, -2776, 250, 150) then begin // Center area
      Print ('27');
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(147680, -56928, -2776, 250, 150) then begin // Center area 2
      Print ('28');
      Engine.MoveTo(147810, -56110, -2807);
      Engine.MoveTo(147936, -55368, -2760);
    end;
    if User.InRange(148560, -55904, -2776, 250, 150) then begin // Area to the right of the stairs
      Print ('29');
      Engine.MoveTo(147908, -55980, -2773);
      Engine.MoveTo(147936, -55368, -2760); //near GK
    end;
    // East
    if User.InRange(150200, -57100, -2976, 600, 200) then begin
      Print ('30');
      Engine.MoveTo(149897, -56910, -2979); // go to the base of the stairs
      Engine.MoveTo(149230, -56412, -2779); // climb the stairs
      Engine.MoveTo(147637, -56074, -2776); // go to the center
      Engine.MoveTo(147728, -55332, -2728); // go to the gatekeeper
    end;
    if User.InRange(144960, -56224, -2976, 250, 150) then begin
      Print ('31');
      Engine.MoveTo(145458, -56853, -2979);
      Engine.MoveTo(146343, -56326, -2779);
      Engine.MoveTo(147625, -55995, -2772);
      Engine.MoveTo(147936, -55368, -2760); // Move near gk
    end;
    if User.InRange(144496, -55088, -2976, 250, 150) then begin
      Print ('32');
      Engine.MoveTo(145327, -56873, -2979);
      Engine.MoveTo(146337, -56445, -2779);
      Engine.MoveTo(147533, -55963, -2766);
      Engine.MoveTo(147936, -55368, -2760); // Move near gk
    end;
    if User.InRange(145392, -56960, -2976, 250, 150) then begin
      Print ('33');
      Engine.MoveTo(146347, -56305, -2779);
      Engine.MoveTo(147514, -56003, -2772);
      Engine.MoveTo(147936, -55368, -2760); // Move near gk
    end;

    if user.inrange(147963, -55257, -2736, 500) then begin
        buffCheck;
    end;                                                
    
    if user.inrange(147963, -55257, -2736, 150) and User.Buffs.ByID(buff_ID, buffCheck) then begin
        //teleport
        engine.settarget(31275);
        delay(1111);
        engine.dlgopen;
        delay(1111);
        engine.dlgsel(1);
        delay(1111);
        engine.dlgsel(4);
        Delay(5000);
    engine.settarget(31320);
    delay(1111);
    engine.dlgopen;
    delay(1111);
    engine.dlgsel(1);
    delay(1111);
    engine.dlgsel(13);
    delay(1111);
    end;    
                
    if User.InRange(123756, -75015, -2897, 250, 150) then begin // Near storage
      Print ('WoA');
      Engine.MoveTo(122794, -74830, -2883);
      Engine.MoveTo(122042, -74800, -3073); //example
      Engine.MoveTo(120707, -74865, -3268);
      Engine.MoveTo(120821, -76343, -3268);
      Engine.MoveTo(120018, -76400, -3268);
      Engine.MoveTo(119010, -76415, -3396);
     engine.useskill(337);
    delay(1000);
    Engine.Facecontrol(0,True);
        while (not (deadCheck or buffCheck)) and (engine.status = lsonline) do delay(2000);
    end;
end;
end else begin
if engine.status = lsonline then begin
if engine.entertext('/unstuck') and engine.delay(1111) then
while user.cast.endtime <> 0 do delay(2222);
delay(5555);
loggedIn:=false;
end;
end;
end;
end;

begin
if engine.status <> lsonline then loggedIn:= true else loggedIn:= false;
  Script.NewThread(@disconnectMonitor);
  Script.NewThread(@farmAndBack);
deadCheck;
end.

==========================================================================

 

After a few deads the char doesnt come back to the town. Can you tell me where is the problem ? Sometimes runs 4 houres sometimes 1h. The char is dead and dont comes back to the town.

Edited by elevator
Posted
On 26/5/2017 at 11:50 AM, adr.bot said:

var
  adena:tl2item;
begin
  while engine.delay(555) do begin
  inventory.user.byid(57, adena);
    if assigned(adena) and (adena.count > 5 * 1000000) then begin // more than 5kk
      while not user.target.dead do delay(11);
      engine.facecontrol(0,false); delay(555);
      engine.entertext('.deposit'); delay(555);
      engine.facecontrol(0,true);
    end;
  end;
end.

how can i change the delay? i have chatban now. xd

Posted
2 hours ago, arturo134 said:

delay(xxxx);

delay(changethisvalue);

thanks.

 

18 hours ago, PaRaNoiC* said:

lf one script for auto pick up for drop events at giran.

autorun with pickup. its easy but i dont know code. who can made for me?

you know how to make this?

Posted (edited)

I have a problem with auto login script posted here in this topic. The script works fine on cracked version 1.71. I bought yesterday licence for newest adrenaline and the script doesnt work :/. Somebody had the same problem ? When the login and password should be entered nothing happens. Somebody can help me ?

 

===========================================================================================================================

 

uses SysUtils;

const
buff_ID:integer = 1204;

var
loggedIn:boolean;
 
function ShellExecuteW(hwnd: integer; lpOperation, lpFile, lpParameters, lpDirectory: PChar;  nShowCmd: integer): integer; stdcall;
  external 'Shell32.dll';
 
function keybd_event(bVk, bScan: byte; dwFlags, dwExtraInfo: integer): integer; stdcall;
  external 'user32.dll';

function ShowWindow(hwnd:cardinal; action:integer):boolean; stdcall;
external 'user32.dll';
 
procedure disconnectMonitor;
const
  login = 'LGN';
  password = 'PSW';
  gamePath = 'D:\LINEAGE2INTERLUDE\L2INT5\systemORG\l2.exe';
begin
  while engine.Delay(3000) do begin  
    if (Engine.Status = lsOffline) or (Engine.Status = lsOff) then begin
      loggedIn:=true;
      print('dc');
      Engine.GameClose;
      Delay(1000);
      ShellExecuteW(0, 'open', PChar(gamePath), nil, nil, 0);
      Delay(15000);
      enterText(login);
      Engine.UseKey('Tab');
      Delay(300);
      enterText(password);
      Delay(300);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(2000);
      Engine.UseKey('Enter');
      Delay(10000);
      ShowWindow(engine.gamewindow, 6);
    end;
  end;
end;
 
procedure enterText(const text: string);
var
  i: cardinal;
  upperCase: boolean;
begin
  for i:= 1 to length(text) do begin
    if isDigit(text) then
      Engine.UseKey(text)
    else begin
      upperCase:= text = UpCase(text);
      if upperCase then begin
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
          Engine.UseKey(text);
          delay(10);
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
      end else
        Engine.UseKey(text);
    end;
    Delay(50);
  end;
end;
 
function isDigit(ch: char): boolean;
const
  digits = '013456789';
var
  i: cardinal;
begin
  result:= false;
  for i:= 0 to length(digits) do
    if digits = ch then begin
      result:= true;
      exit;
    end;
end;
                     
begin
if engine.status <> lsonline then loggedIn:= true else loggedIn:= false;
  Script.NewThread(@disconnectMonitor);
end.

Edited by elevator
  • 2 weeks later...
Posted
On 9/27/2017 at 8:16 AM, the_martines said:

Is there a way to automate the creation of player shops? I mean selling/buing materials and soulshots.

uses SysUtils;
function BetterInt32ToHex(input: Integer): string;
var
  i, j: integer;
  p: string;
  bbI : array[1.. sizeof(integer)] of byte;
begin
  p := '';
  Move(input, bbI[1], SizeOf(Integer));
  for j := Low(bbI) to High(bbI) do
  begin
    p := p + IntToHex(bbI[j],2) + ' ';
  end;
  Result := p;
end;

function StringToHex(S: String): string;
var I: Integer;
begin
  Result:= '';
  for I := 1 to length (S) do
    Result:= Result+IntToHex(ord(S[i]),2) + ' 00 ';
end;

function OpenPrivateStoreSell(itemList: array of Integer; msg: string; packageSale: Boolean): boolean;
var
  packet: string;
  i, j, t: Integer;
  l: Extended;
  item: TL2Item;
begin
  packet := '97 ';
  packet := packet + StringToHex(msg) + '00 00';
  //Print(packet);
  Engine.SendToServer(packet);
  packet := '31 '; // Packet ID
  if(packageSale) then packet := packet + BetterInt32ToHex(1) else packet := packet + BetterInt32ToHex(0); // Package Sale
  l := Length(itemList);
  packet := packet + BetterInt32ToHex(Length(itemList) div 3);
  for i := 0 to Length(itemList) - 1 do
  begin
    j := i + 1;
    t := i + 2;
    if(Inventory.User.ByID(itemList[i], item)) then
    begin
      packet := packet + BetterInt32ToHex(item.OID);
      packet := packet + BetterInt32ToHex(itemList[j]) + '00 00 00 00 '; // Max 2.1b
      packet := packet + BetterInt32ToHex(itemList[t]) + '00 00 00 00 '; // Max 2.1b
    end;
    i := i +2;
  end;
  //Print(packet);
  Engine.SendToServer(packet);
end;

begin
OpenPrivateStoreSell([5591, 50, 5000, 5592, 50, 10000, 7575, 1, 50000000], 'message', true);
end.

Kinda old post I'm replying to but it might help someone else. Engine.OpenPrivateStore doesn't seem to work so I wrote this real quick cause I needed to use that function.  

OpenPrivateStoreSell(array of Integers (itemId, amount, price), string message, boolean packagesale);  

Price and amount are 32 bit, didn't bother making a 64 bit version of the BetterIntToHex function, which I'm so glad I wrote because it returns the proper formatting that Lineage 2 uses for it's packets.

Also there aren't any checks like if you actually have the item in your inventory or the amount you are selling or if the adena you gain will go over the adena max (2.147b bit in interlude, 99b in gracia through h5, 999b in classic) so make sure you call the function correctly. If I fell like it I will add those checks and maybe some configuration ini or something but I don't think many people will need this script at all.

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.




×
×
  • Create New...