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
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • ⚡ Fast order delivery is active 24/7! Upgrade your personal Gmail to Gemini Pro with full 2TB storage and premium Google One features today.
    • Update M54: Global HP/MP/CP consumable handling expanded beyond combat-only usage. Offensive mage idle recovery with learned skill Battle Heal. Spellhowler/Storm Screamer prioritizes Hurricane, using Vampiric Claw mostly below 90% HP. Major structural refactor initialized: Added category/class organization such as Archer, Dagger, Tank, Mage, Healer, Support and Specialized class files. Further structural cleanup. Extracted combat memory/state and more class-policy logic from the main controller. Added global stuck/inactivity watchdog for bots blocked by terrain/geodata. Added unreachable dropped ground-item timeout/temporary blacklist. Reworked Necromancer/Soultaker PvP: Dominator level 78+ maintains learned Arcane Power toggle on. Overlord/Dominator level 44+ maintains learned Soul Guard toggle automatically. Stability/scalability update: Bot controller ticks staggered instead of all starting in the same phase: Same 350 ms update rate retained Reduces simultaneous AI workload bursts. Removed the old manual aggressive-monster EVT_AGGRESSION bridge. Phantoms now use native Lucera setActive() behavior so monsters aggro them naturally. Reduced unnecessary NPC scans and native AI event pressure. Added saved-bot equipment overrides using a separate database table:         lucera_autobots_items Existing lucera_autobots remains the main saved-bot identity/state table. Equipment rows are linked to saved bots through bot_id. Added optional convenience view to show bot name together with equipment overrides:         lucera_autobots_items_view Added editable equipment slots in columns: Weapon Shield Helmet Chest Legs Gloves Boots Necklace Left/Right Earrings Left/Right Rings Equipment override values: 0 = use normal class/level profile item -1 = force slot empty >0 = equip that Item ID Custom equipment works only for saved database bots. Default class/level equipment profiles remain unchanged. Supports custom equipment from No Grade to S Grade, regardless of the bot's current level. Added validation for invalid item IDs and incompatible equipment slots. Added handling for: Two-handed weapons vs shields Full-body armor vs separate leggings Added all-grade Soulshots and Spiritshots to bot inventory/replenishment so custom lower-grade weapons still use the correct shots. Mage profiles that already use Blessed Spiritshots keep that behavior with all relevant grades available. First save the bot normally so it exists in table:         lucera_autobots Then open:         lucera_autobots_items Find the row with the same bot_id and edit only the equipment slots you want. Example: weapon_id = 6608 shield_id = -1 helmet_id = 0 chest_id = 0 legs_id = 0 gloves_id = 0 boots_id = 0 This means: weapon_id 6608 → custom weapon shield_id -1 → no shield all 0 values → keep normal default profile equipment After editing the DB, despawn and respawn the saved bot so M54 reloads its equipment overrides. Do not edit bot_id. Use it only to identify which saved bot the equipment row belongs to.   DOWNLOAD
    • It will be multi client so it will detect the client from the files and adapt the packets and asset loading. I am aiming for C4 and H5 after IL
    • this is just to simplify your life, time, and can be done for free by yourself just watch some tutorials, in case you don't wanna waste time check it out!   https://l2getwork.art   https://l2getwork.art/showcase.html  
    • Good job! Any chance for it to be downgradeable or at least compatible with older chronicles?
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..