Jump to content

Recommended Posts

Posted

Hello i need help to past anti dissarm script to Farm script. Any1 can help me?

const
 BUFF_ID = 28015; //COV
 SCROLL_OF_SCAPE = 736; //SOE
 TPDelay = 30 * 1000; // Time to wait after teleporting, change according to your computer
 debug = false;

type
    TCity = (DWARVEN = 0, ORC = 1, DARK_ELVEN = 2, ELVEN = 3, KAMAEL = 4,
        TALKING_ISLAND = 5, HEINE = 6, DION = 7, GIRAN = 8, ADEN = 9, GODDARD = 10,
        GLUDIO = 11, GLUDIN = 12, SHTUTTGART = 13, RUNE = 14, OREN = 15, HUNTER = 16,
        NON_CITY = 17, PRIMEVAL_ISLE = 18);

procedure ToGk;
begin
    if User.InRange(110912,219584,-3664, 250, 150) then begin
      Engine.MoveTo(110912,219584,-3664);
      Engine.MoveTo(111154,219735,-3675);
      Engine.MoveTo(111176,219395,-3546);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(111888,219584,-3664, 250, 150) then begin
      Engine.MoveTo(111888,219584,-3664);
      Engine.MoveTo(111617,219703,-3674);
      Engine.MoveTo(111591,219371,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(112064,219792,-3664, 250, 150) then begin
      Engine.MoveTo(112064,219792,-3664);
      Engine.MoveTo(111665,219800,-3675);
      Engine.MoveTo(111580,219329,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(107808,217856,-3672, 250, 150) then begin
      Engine.MoveTo(107808,217856,-3672);
      Engine.MoveTo(107769,217524,-3673);
      Engine.MoveTo(109387,217509,-3747);
      Engine.MoveTo(110037,217257,-3747);
      Engine.MoveTo(110072,219029,-3477);
      Engine.MoveTo(111202,219130,-3541);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(110896,220768,-3664, 250, 150) then begin
      Engine.MoveTo(110896,220768,-3664);
      Engine.MoveTo(111191,219621,-3663);
      Engine.MoveTo(111190,219303,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(110768,219824,-3664, 250, 150) then begin
      Engine.MoveTo(110768,219824,-3664);
      Engine.MoveTo(111163,219763,-3671);
      Engine.MoveTo(111199,219319,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(112112,220576,-3664, 250, 150) then begin
      Engine.MoveTo(112112,220576,-3664);
      Engine.MoveTo(111600,219666,-3669);
      Engine.MoveTo(111586,219305,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(110688,220576,-3664, 250, 150) then begin
      Engine.MoveTo(110688,220576,-3664);
      Engine.MoveTo(111183,219655,-3669);
      Engine.MoveTo(111201,219292,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(108032,218048,-3672, 250, 150) then begin
      Engine.MoveTo(108032,218048,-3672);
      Engine.MoveTo(107862,218003,-3673);
      Engine.MoveTo(107840,217532,-3673);
      Engine.MoveTo(109383,217465,-3747);
      Engine.MoveTo(110036,217280,-3747);
      Engine.MoveTo(110096,219040,-3478);
      Engine.MoveTo(111086,219100,-3541);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(107568,218256,-3672, 250, 150) then begin
      Engine.MoveTo(107568,218256,-3672);
      Engine.MoveTo(107542,217872,-3673);
      Engine.MoveTo(107840,217532,-3673);
      Engine.MoveTo(109383,217465,-3747);
      Engine.MoveTo(110036,217280,-3747);
      Engine.MoveTo(110096,219040,-3478);
      Engine.MoveTo(111086,219100,-3541);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(107552,218000,-3672, 250, 150) then begin
      Engine.MoveTo(107552,218000,-3672);
      Engine.MoveTo(107862,218003,-3673);
      Engine.MoveTo(107840,217532,-3673);
      Engine.MoveTo(109383,217465,-3747);
      Engine.MoveTo(110036,217280,-3747);
      Engine.MoveTo(110096,219040,-3478);
      Engine.MoveTo(111086,219100,-3541);
      Engine.MoveTo(111387,219387,-3544);
    end;
    if User.InRange(111856,220752,-3664, 250, 150) then begin
      Engine.MoveTo(111856,220752,-3664);
      Engine.MoveTo(111573,219730,-3675);
      Engine.MoveTo(111589,219342,-3544);
      Engine.MoveTo(111387,219387,-3544);
    end;
end;

function  isDead: boolean;
begin
  isDead := false;
  if (debug) then print('Check is Dead');
  if  User.Dead  then
  begin
    Delay (10000); // In case of resurrection
  end;
  if  User.Dead  then
  begin
    isDead := true;
    Engine.FaceControl (0,false);
    Print ('Dead. Pressing to village.');
    Engine.GoHome;
    Delay (5000);
  end;
end;

function  GetCity (shouldGoHome: boolean = true; inCityEvt: boolean = false): TCity;
var
  City: TCity;
begin
  City := NON_CITY;
  if User.InRange (147509, 25928, User.Z, 5000, 100)       then City := ADEN;
  if User.InRange (11416, 16856, User.Z, 5000, 100)        then City := DARK_ELVEN;
  if User.InRange (18591, 144708, User.Z, 5000, 100)       then City := DION;
  if User.InRange (116569, -179848, User.Z, 7000, 100)     then City := DWARVEN;
  if User.InRange (44904, 49800, User.Z, 7000, 100)        then City := ELVEN;
  if User.InRange (82876, 148960, User.Z, 5000, 100)       then City := GIRAN;
  if User.InRange (-81311, 152663, User.Z, 5000, 100)      then City := GLUDIN;
  if User.InRange (-14236, 123701, User.Z, 5000, 100)      then City := GLUDIO;
  if User.InRange (147713, -56202, User.Z, 5000, 100)      then City := GODDARD;
  if User.InRange (111434, 220426, User.Z, 5000, 100)      then City := HEINE;
  if User.InRange (117144, 76824, User.Z, 5000, 100)       then City := HUNTER;
  if User.InRange (-45080, -113576, User.Z, 5000, 100)     then City := ORC;
  if User.InRange (81150, 54880, User.Z, 5000, 100)        then City := OREN;
  if User.InRange (43838, -48222, User.Z, 5000, 100) or
    User.InRange (38283, -48102, User.Z, 5000, 100)        then City := RUNE;
  if User.InRange (88041, -142502, User. Z, 5000, 100)     then City := SHTUTTGART;
  if User.InRange (-83139, 243145, User.Z, 5000, 100)      then City := TALKING_ISLAND;

  // If it isn't in one of the previous locations then goHome and try again
  if (City = NON_CITY) and (shouldGoHome) then
  begin
    GoHome (-1, -1, inCityEvt);
    City := GetCity;
  end;
  Result := City;
end;


function  needsBuffs: boolean;
var
  buff: TL2Buff;
begin
  needsBuffs := false;
  if (debug) then print('Check for buffs');
  if  not User.Buffs.ByID (BUFF_ID, Buff)  or
    User.Buffs.ById (BUFF_ID, buff)  and  (buff.EndTime < 60 * 1000)  then
  begin
    print('Check Buffs [True]');
    needsBuffs := true;
  end;
end;

procedure  GoHome (ItemID: integer = -1; skillID: integer = -1; move: boolean = false);
var
  Skill: TL2Skill;
  Item: TL2Item;
  City: TCity;
begin
  print('Go Home');
  if  not User.Dead  then
  begin
    City := GetCity (false, false);
    if  City = NON_CITY  then
    begin
    // Use the item past as parameter
    if  (itemID <> -1)  and  Inventory.User.ByID(itemID, Item)  then
    begin
      Engine.UseItem (itemID);
      Delay (User.Cast.EndTime + TPDelay);
    end;

    // Use skill to teleport if no item past as parameter
    if  (skillID <> -1)  and  (itemID = -1)  and  SkillList.ByID(skillID, Skill)  then
    begin
      Engine.UseSkill(skillID);
      Delay (User.Cast.EndTime + TPDelay);
    end;

    // Use SoE if no item or skill provided
    if  (skillID = -1)  and  (itemID = -1) and  Inventory.User.ByID(SCROLL_OF_SCAPE, Item)  then
    begin
      Engine.UseItem (Item);
      Delay (User.Cast.EndTime + TPDelay);
    end;

    end; //non city
  end; //user dead
end;


procedure  GetBuffs;
begin
  print('GetBuffs');
  Engine.SetTarget(36600); // NPC ID
  Engine.MoveToTarget;
  Delay(500);
  Engine.DlgOpen;
  Delay(500);
  Engine.DlgSel(1);   //Warriors
  Delay(500);
end;

procedure  movetofarm;
begin
  Print ('Teleport to FoS Center');
  Engine.SetTarget (30233);
  Engine.DlgOpen;
  Delay (500);
  Engine.DlgSel(1);
  Delay (500);
  Engine.DlgSel(7);
  Delay (5*1000);
  Print ('Moving to spot');
    if user.InRange(73024, 118485, -3696, 300) then begin      
      Engine.MoveTo(73477, 118144, -3720);
      Engine.MoveTo(75061, 117686, -3736);
      Engine.MoveTo(79457, 115940, -3720);
      Engine.MoveTo(81710, 116517, -3208);
      Engine.MoveTo(83528, 117819, -2992);
      Engine.MoveTo(83528, 118887, -3032);
      Engine.MoveTo(86700, 119885, -3072);
      Engine.MoveTo(88981, 119261, -3056);
end;
 
  Engine.Facecontrol (0, true); // turn on bot interface
  Engine.Facecontrol (1, true); // turn on target select interface
end;

{  START  }

begin
  //Engine.LoadConfig ('fos_holy'); //User.Name
  while  true  do
  begin
    if  isDead or needsBuffs  then
    begin
      Engine.FaceControl (1,false); // turn off bot interface
      while  User.InCombat  do Delay (3 * 1000);
      GoHome;
      ToGK;
      GetBuffs;
      //teleport;
      movetofarm;
      Print ('Finished');
    end;
    delay(30000);
  end;      
end.
 

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

    • I'll give you my wallet if you want, haha
    • To make up for some of the waiting time we’re hosting a 3v3 Tournament on open Beta, and this time we’re raising the stakes with a $1,300 prize pool 💰   🏆 PRIZE POOL BREAKDOWN (Over 2000$ Worth of prices total)   🥇 1st Place — $700 🥈 2nd Place —$300 🥉 3rd Place — $200 🏅 4th Place — $100  5th -6th Place - $100 in Gold Coins each    All Participating Teams: $50 in Gold!   All Prices will be Paid out instantly after the tour, no waiting time and conditions. This is not simply a marketing move, we want to give back to the community.   📅 Date: Wednesday 06.05.2026 ⏰ Time: 20:00 Central European Timezone (Berlin) 📍Format: 3v3   ⚔️Why join? Cash Prices for top 4 and rewards for all participants Payments to winners sent out straight after the tournament - No waiting time or rules that you have to play live server to obtain the reward. Clean format, smooth matches, and solid prize pool and a chance to experience our brand new files   📝How to join: Form your 3-player team Group Leader Sign up here: ⁠📍・3v3-tour-registration (Include Name of Group, Name of Group Leader)   Be ready on match day!     A separate post with rules for the tournament and class setups will follow shortly.   Tag your teammates, lock in your roster, and get ready to compete. We'll be happy to see you on the OBT!   💬 Questions? Ask in ⁠🎫・ticket or send us a message   See you on L2Dark! 😏   Discord: https://discord.gg/FAJwnFpb8M
    • You should check if that condition is supported by your current sources. You can find this in  DocumentBase#parsePlayerCondition If it isnt there and you want to follow the same pattern of the other item conditions, create a custom condition to parse the classId (or multiple class ids) (there are examples to copy the code). Alternatively, you can create your own condition handler. Your condition should look like this: <cond msgId="1518"> <player classId="ADVENTURER,PALADIN" /> </cond> or <cond msgId="1518"> <player classId="93,5" /> </cond>  
    • it's Interlude client forgot to mention
    • idk if acis have this option, but you can put inside item smth like that atleast on H5         <cond msgId="1518">             <player class_id_restriction="93, 101, 108, 117" /> <!-- Dagger Masters -->         </cond>
  • 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..