Jump to content

Script exchange and autologin


Caryfuk

Recommended Posts

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
Link to comment
Share on other sites

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
 

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.

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

    • Totally understood. You are right. I am not denying the time and the effort that you guys have poured in learning and developing yourselves as able devs. If I am not a learner then I would have bought a ready solution like korean client worked-out (not sure if there is. I have never tried to look for) Frankly, I have never bought any packs or some stuffs but just been working on a pure pack from l2j by myself. Actually I am not asking you guys to do everything for me. I just looked for a clue to solve my problem. (I am a korean and there is no korean community for l2j developing) I searched this forum for related articles and found some but all the instructions were just from normal users, not devs. They just shared their thoughts or opinions not apt informations. Namely, I could not get any clue for my problem.   Anyways, I already gave up to mod client due to lack of informations and knowleges. Have a good day brother.
    • Hi, I have seen in l2gold.in that there is an item that when clicked spawns a mob/raid_boss ramdom, this is edited from the ai or you have to create a mod in extender?, I am using the Dandiarena datapack.   I have seen the skill to spawn a pet with an item (dragon flaute) and I have seen the s_skill to spawn the unicorns (elemental summoner), I tried to create a s_summon of a raid boss but it threw error, for this reason I decided to come here to ask, this can help many people.   --------------------------------------------------------------------------------------------------------------------------------   SPAWN CAT: skill_begin    skill_name=[s_summon_blackcat1]    /* [쀜뀼 삣 끔 삣] */    skill_id=1111    level=1    operate_type=A1    magic_level=20    effect={{i_summon;[cat_the_cat_a];70;[crystal_d];0}}    operate_cond={{can_summon}}    is_magic=1    mp_consume1=8    mp_consume2=31    item_consume={[crystal_d];3}    cast_range=-1    effective_range=-1    skill_hit_time=15    skill_cool_time=0    skill_hit_cancel_time=0.5    reuse_delay=21600    attribute=attr_none    effect_point=0    target_type=self    affect_scope=single    affect_limit={0;0}    next_action=none    ride_state={@ride_none;@ride_wind;@ride_star;@ride_twilight}    skill_end   SPAWN ITEM (DB +10): skill_begin    skill_name=[s_en_draconic_bow_focus_10_box]    /* [Box with Draconic Bow Focus + 10] */    skill_id=10043    level=1    operate_type=A1    magic_level=1    effect={{i_add_enchanted_item;7577;10}}    is_magic=0    mp_consume2=0    item_consume={[en_draconic_bow_focus_10_box];1}    cast_range=-1    effective_range=-1    skill_hit_time=0.2    skill_cool_time=0    skill_hit_cancel_time=0    reuse_delay=0    attribute=attr_none    effect_point=0    target_type=self    affect_scope=single    affect_limit={0;0}    next_action=none    ride_state={@ride_none;@ride_wind;@ride_star;@ride_twilight}    skill_end   DRAGON FLAUTE: skill_begin    skill_name=[s_wolf_collar]    /* [Modified 15 May 2009 18:44] */    skill_id=2046    level=1    operate_type=A1    magic_level=1    effect={{i_summon_pet}}    operate_cond={{can_summon_pet};{op_not_territory;{{51341;218103;-3252;-2932};{53341;218103;-3252;-2932};{53341;220103;-3252;-2932};{51341;220103;-3252;-2932}}}}    is_magic=0    mp_consume2=0    cast_range=-1    effective_range=-1    skill_hit_time=5    skill_cool_time=0    skill_hit_cancel_time=0.5    reuse_delay=0    attribute=attr_none    effect_point=0    target_type=self    affect_scope=single    affect_limit={0;0}    next_action=none    ride_state={@ride_none}    skill_end     ITEM WITH RAMDOM DROP (GIFT/BOX): skill_begin    skill_name=[s_ingredient_box_1]    /* [샜쁽쁘 상삐] */    skill_id=2175    level=1    operate_type=A1    magic_level=1    effect={{i_restoration_random;{{{{[blood_root];2}};20};{{{[sulfur];2}};20};{{{[infernium_ore];1}};35};{{{[demons_blood];2}};25}}}}    is_magic=2    mp_consume2=0    item_consume={[ingredient_box];1}    cast_range=-1    effective_range=-1    skill_hit_time=0    skill_cool_time=0    skill_hit_cancel_time=0    reuse_delay=0    attribute=attr_none    effect_point=0    target_type=self    affect_scope=single    affect_limit={0;0}    next_action=none    ride_state={@ride_none;@ride_wind;@ride_star;@ride_twilight}    skill_end   --------------------------------------------------------------------------------------------------------------------------------   SPAWN RAID BOSS/MOB W/ ITEM: ??? HELP!     --------------------------------------------------------------------------------------------------------------------------------   I am learning how to create an OFF server, but I have many doubts, I would like you to guide me, I would appreciate it very much!    
    • Hello, is possible any effect spawn raid boss/mobs?
    • wts 100kk adena set mj light unsealed set nightmare sealed set tallum heavy unsealed set jewels tts unsealed! soul bow ITEMS C GRADE  l2reborn origins x1
    • WTB AQ Reborn Origins x1  Only middleman.  discord: Mr.Saran#1369
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock