Jump to content

Recommended Posts

Posted (edited)

Hello All pls can someone check and tell me why that sript dont repeat funcion? I mean autologin and Exchange AA. If i stop and play script than work but dont repeat automaticaly

 


uses SysUtils;

const
buff_ID:integer = 7029;

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 = 'caryfuk2';   //user  put it bwtw 'user'
  password = 'Dkservis123';  //password  same here 'password'
  gamePath = 'C:\Users\klamt\Documents\l2tower(1)\L2Tower.exe'; //example c/programfile/l2hi5/systeml2.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);
      
      Engine.EnterText(login);
      Engine.UseKey('Tab');
      Delay(300);
      Engine.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);

      Engine.FaceControl(0,true);
Delay(1000);
      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);
    end;
  end;
end;

const
  MANDILS = 60006;            // Mandil's Fan
  SWORD = 66491;
  BOW = 30007;
  ARMA = BOW;               // ARMA EN USO
  DROP = 9143;             //RUNE DROP
  XP = 23172;               //RUNE XP
  AA = 5575;

 {
--------------------------------------------------------------------------------
  Check if the character needs buffs
--------------------------------------------------------------------------------
}
function Rebuff: Boolean;
var buff: TL2Buff;
begin
Result:=false;
    if not User.Buffs.ByID(7042, buff) then begin
        Result:=true;
        Print('Buffs are needed...');
        

      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);  
      Delay(100);
      Engine.FaceControl(0,false);
      Delay(1000);

// Se tiene que equipar en mandils y bufearse gore.

Engine.UseItem(MANDILS); // Equipar Arma de buff
    Delay(1000);
Engine.UseSkill(7093); //Master's Blessing - Improve Movement
    Delay(500);
Engine.UseSkill(7092); //Master's Blessing - Improve Shield Defense
    Delay(500);
Engine.UseSkill(7091); //Master's Blessing - Improve Critical
    Delay(500);
Engine.UseSkill(7090); //Master's Blessing - Improve Condition
    Delay(500);
Engine.UseSkill(7089); //Master's Blessing - Improve Magic
    Delay(500);
Engine.UseSkill(7088); //Master's Blessing - Improve Combat
    Delay(500);
Engine.UseSkill(7064); //Master's Blessing - Chant of Victory
    Delay(500);    
Engine.UseSkill(7060); //Master's Blessing - Clarity
    Delay(500);    
Engine.UseSkill(7057); //Master's Blessing - Greater Might
    Delay(500);    
Engine.UseSkill(7056); //Master's Blessing - Berserker Spirit
    Delay(500);
Engine.UseSkill(7055); //Master's Blessing - Wind Walk
    Delay(500);
Engine.UseSkill(7053); //Master's Blessing - Vampiric Rage
    Delay(500);
Engine.UseSkill(7052); //Master's Blessing - Magic Barrier
    Delay(500);
Engine.UseSkill(7051); //Master's Blessing - Shield
    Delay(500);
Engine.UseSkill(7050); //Master's Blessing - Might
    Delay(500);
Engine.UseSkill(7048); //Master's Blessing - Acumen
    Delay(500);    
Engine.UseSkill(7047); //Master's Blessing - Agility
    Delay(500);    
Engine.UseSkill(7046); //Master's Blessing - Blessed Soul
    Delay(500);    
Engine.UseSkill(7045); //Master's Blessing - Blessed Body
    Delay(500);    
Engine.UseSkill(7044); //Master's Blessing - Guidance
    Delay(500);    
Engine.UseSkill(7043); //Master's Blessing - Haste
    Delay(500);    
Engine.UseSkill(7042); //Master's Blessing - Death Whisper
    Delay(500);
Engine.UseSkill(7041); //Master's Blessing - Focus
    Delay(500);
    
    
Engine.UseSkill(778); //Golem Armor
    Delay(500);
Engine.UseSkill(807); //Over Hit
    Delay(500);
Engine.UseSkill(619); //Transform Dispel
    Delay(3000);
Engine.UseItem(66020); //Transform lvl 5
    Delay(1000);
Engine.UseSkill(60076); //P atak
    Delay(1000);
Engine.UseSkill(60077); //P def
    Delay(3000);
Engine.UseSkill(619); //Transform Dispel
    Delay(2000);
Engine.UseSkill(813); //Vanguard
    Delay(500);
Engine.UseSkill(956); //Boost Morale
    Delay(500);
Engine.UseSkill(838); //Transform Dispel
    Delay(3000);

Engine.UseItem(BOW); // Equipar ARMA
Delay(1000);
    

Engine.FaceControl(0,true);

      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);

   end;
   end;

   {
    --------------------------------------------------------------------------------
      Check if the character needs buffs - Buffer for Premium
    --------------------------------------------------------------------------------
    }
    
    function Rebufff: boolean;
    var
      buff: TL2Buff;
    begin
      Rebufff := false;
      // check for any buff that you use
      if  not User.Buffs.ByID(4702, Buff)  then
      begin

      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);  

    Engine.FaceControl(0,false);
    Delay(16000);
    
    Engine.EnterText ('.buffer');       //only for premium user
    Delay(500);


    Engine.BypassToServer('Aiobuff_showProfiles_buffforme');
    Delay (500) ;
    Engine.BypassToServer('Aiobuff_buffforme_ buff'); //rename "buf" for your name scheme buffer
    Delay(500);
    
    Engine.FaceControl(0,true);

      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);

    end;
    end;

    {
--------------------------------------------------------------------------------
  Check if the character needs buffs - Newbie Potion lvl2
--------------------------------------------------------------------------------
}
function Potion: boolean;
var
  buff: TL2Buff;
begin
  Potion := false;
  // check for any buff that you use
  if  not User.Buffs.ByID(60001, Buff)  then
  begin

 
Engine.UseKey('f9');

end;
end;

{
--------------------------------------------------------------------------------
  Check if the character needs buffs - Vesper potion
--------------------------------------------------------------------------------
}
function Potion1: boolean;
var
  buff: TL2Buff;
begin
  Potion1 := false;
  // check for any buff that you use
  if  not User.Buffs.ByID(23344, Buff)  then
  begin

 
Engine.UseKey('f8');

end;
end;

{
--------------------------------------------------------------------------------
  Check if the character needs buffs - Super Buff
--------------------------------------------------------------------------------
}

function SuperBuff: boolean;
var
  buff: TL2Buff;
begin
  SuperBuff := false;
  // check for any buff that you use
  if  not User.Buffs.ByID(60098, Buff)  then
  begin

 
Engine.UseSkill(60098); //Super Might
    Delay(500);
Engine.UseSkill(60101); //Super Defence
    Delay(500);
Engine.UseSkill(60102); //Super Damage
    Delay(500);

end;
end;

{
--------------------------------------------------------------------------------
  Check if the character needs AA -> Golden Apiga
--------------------------------------------------------------------------------
}
function CheckItemCount (const itemID: Integer; const quest: Boolean = False) : Integer;
var tempItem: TL2Item;
begin
   if quest then Inventory.Quest.ByID(itemID, tempItem)
   else Inventory.User.ByID(itemID, tempItem);
   Result := tempItem.Count;
end;

var Item:TL2Item;

 


procedure VymenaAA;      //THIS IS CALLED BY THE REPEAT LINES BELOW!!

begin
if (CheckItemCount(5575) > 1000000000) and not Inventory.User.ByID(17406,Item)  /// check amount runes and rune in inventory
then begin

      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);

Engine.FaceControl(0,false);     //Stops Arenaline
Delay (1000);


Engine.MoveTo(-16013,-45946,-10720);    //Spot
Delay(200);
Engine.MoveTo(-16269,-45825,-10720);    //Spot
Delay(200);
Engine.MoveTo(-16172,-45479,-10720);    //Spot
Delay(200);


 
Engine.EnterText ('/target GM Shop');      //sets target
Delay(500);
Engine.EnterText ('/target GM Shop');      //again to go
Delay(500);                               //time to reach it and dialog apear

Engine.DlgSel (4);
Delay (1000) ;
Engine.NPCExchange(9143, 1);       // Golden Apiga
Delay(500);


Engine.MoveTo(-16184,-45969,-10720);    //Spot
Delay(200);
Engine.MoveTo(-15257,-45364,-10720);    //Spot
Delay(200);

 


Engine.FaceControl(0,true);
Delay(1000);
      Engine.UseKey('f11');
      Delay(2000);
      Engine.EnterText('//pause off');
      Delay(1000);
    
end;
end;

 

 

 

 
procedure enterText(const text: string);
var
  i: cardinal;
  upperCase: boolean;
begin
  for i:= 1 to length(text) do begin
    if isDigit(text[i]) then
      Engine.UseKey(text[i])
    else begin
      upperCase:= text[i] = UpCase(text[i]);
      if upperCase then begin
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
          Engine.UseKey(text[i]);
          delay(10);
          keybd_event(20, 0, 1, 0);
          keybd_event(20, 0, 2, 0);
      end else
        Engine.UseKey(text[i]);
    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[i] = ch then begin
      result:= true;
      exit;
    end;
end;


                      


 begin
if engine.status <> lsonline then loggedIn:= true else loggedIn:= false;
  Script.NewThread(@disconnectMonitor);
  Script.NewThread(@Rebuff);
  Script.NewThread(@Rebufff);
  Script.NewThread(@Potion);
  Script.NewThread(@Potion1);
  Script.NewThread(@SuperBuff);
  Script.NewThread(@VymenaAA);
 
end.


//-----------------------------------------------------------------------------
begin    //THIS REPEAT ALL THE TIME IN THE SCRIPT.
repeat
Rebuff;
Rebufff;
Potion;
Potion1;
SuperBuff;
VymenaAA;
disconnectMonitor;

 

 


  until Engine.Status = lsOffline;
                  Engine.FaceControl(0,true);
  Delay(2000);
end.

 

 

 

 

 

Edited by Caryfuk
Posted

my eyes >.< pls, use code highlighting

the problem is: u have 2 blocks of main

begin 
  ... 
end.

script use only first, where u spawn threads
but second is skipped, where loop is used
contact our tech supports (https://adrenalinebot.com/en/#contacts) - they probably will make it work
 

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...