Jump to content

Recommended Posts

Posted

 

SetTarget(const Name: string): Boolean; overload; Set target by name

const Name : string - name is a constant and naturally also a string, not an integer for example.

Boolean - true or false. See: https://en.wikipedia.org/wiki/Boolean_data_type

overload - no idea.

 

Way to use that command in your script:

begin

SetTarget('Mycharname')

end.

 

Targets whatever with name 'Mycharname'

Posted (edited)

EDIT: I try edit script for buy all, buff, and go to imperial tomb, but idk why dont work, i think is any problem in Buy mana part, but i read 30 times and dont know where is error :/ Char move to this coordinates: 147727, -58521, -2981, he buff and buy ss, but after just do nothing.

var MP, Shot: TL2Item;
buff: TL2Buff;
function buffCheck: Boolean;
begin
  Engine.MoveTo(147727, -58521, -2981);
        delay(1000);
  Engine.MoveTo(147746, -55697, -2742);
    if (not User.Buffs.ByID(1062, buff) or (buff.endtime<300000)) then begin //1062 wich buff id checking
        Result:=true;
        Delay(1000);
  Engine.SetTarget('buffer');                                      ///buffer
   engine.dlgopen;
    Delay(1000);
    Engine.BypassToServer('Quest 555_NPCBuffer cast 4373 x x'); 
        Delay(1000);
    end;
Result:=false;
end;

function BuyMP:boolean;
begin
if not Inventory.User.ByID(728, MP) or (MP.count<800) then begin //728 mp id ,10 or less then buy MP so probably change it for your count
result:=true;
        Delay(1000);
  Engine.SetTarget('Sellena');                                      ///gmshop
   engine.dlgopen;
    Delay(1000);
  Engine.DlgSel('Potion');
        delay(1000);
        Engine.NpcExchange(728, 1100);  //728 mp id, 2 is count how many buy it
        delay(1000);
        end;
        result:=false;
  Engine.CancelTarget;
end;

function BuyShot:boolean;
begin
if not Inventory.User.ByID(3951, Shot) or (Shot.count<4500) then begin //1463 is d grade shot id, change for your shot id, 900 or less then buy shots
result:=true;
        Delay(1000);
  Engine.SetTarget('Sellena');                                      ///gmshop
   engine.dlgopen;
        Delay(1000);
  Engine.DlgSel('Soulshots');
        Delay(1000);
        Engine.NpcExchange(3951, 12);   //3951 id, 50 is count wich buy
        delay(1000);
        end;
        result:=false;
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(10000);
    end;
end;

begin
while true do begin
delay(150);
                    //town coordinates     range                 //buff id wich check                        //shot id                              //mp id
    if user.inrange(144925, -56215, -2974, 5000) and User.Buffs.ByID(1062, buffCheck) and Inventory.User.ByID(1463, BuyShot) and Inventory.User.ByID(728, BuyMP) then begin
        Print('Teleport.');
        delay(1000);
  Engine.SetTarget('Marianne');                                      ///gatekeeper
   engine.dlgopen;
        delay(1000);
  Engine.DlgSel('Towns Areas');
        delay(1000);
  Engine.DlgSel('Goddard Area');
        delay(1000);
  Engine.DlgSel('Imperial Tomb');
        delay(1000);
    end;                      
                             
    if user.inrange(-181346, -75785, -2731, 300) then begin  //coordinates after teleport
        Print('Moving');
        Engine.MoveTo(177893, -75352, -2728);      //path to spot
        Engine.MoveTo(177956, -78138, -3379);
        Engine.MoveTo(177947, -80965, -4026);
        Print('ON!');
        Delay(500);
        Engine.FaceControl(0, true);  //turn on bot
        while not deadCheck do delay(1000); //while not dead, do nothing and wait.
    end;
end;
end.

Think problem is i need buy from same npc ss/mana.

Edited by CristianPascual
Posted

Correct me if I'm wrong, but where do you call functions: buyShot, buyMp and buffCheck in your loop???

 

 

At first: put Result:= false after "begin" in each function. Change range from 5000 to like 15000(if still won't work make path to get closer to the teleport NPC).

 

Also I recommend to put this:

delay(150);
                    //town coordinates     range                 //buff id wich check                        //shot id                              //mp id
    if user.inrange(144925, -56215, -2974, 5000) and User.Buffs.ByID(1062, buffCheck) and Inventory.User.ByID(1463, BuyShot) and Inventory.User.ByID(728, BuyMP) then begin
        Print('Teleport.');
        delay(1000);
  Engine.SetTarget('Marianne');                                      ///gatekeeper
   engine.dlgopen;
        delay(1000);
  Engine.DlgSel('Towns Areas');
        delay(1000);
  Engine.DlgSel('Goddard Area');
        delay(1000);
  Engine.DlgSel('Imperial Tomb');
        delay(1000);
    end;   

in a function, and call this function after rbf or shopping is done.

Posted

i guess he play interlude

 

Nope, is L2 H5, server is l2stars. Dont know what l2pack use this server.

 

 

Correct me if I'm wrong, but where do you call functions: buyShot, buyMp and buffCheck in your loop???

 

 

At first: put Result:= false after "begin" in each function. Change range from 5000 to like 15000(if still won't work make path to get closer to the teleport NPC).

 

Also I recommend to put this:

delay(150);
                    //town coordinates     range                 //buff id wich check                        //shot id                              //mp id
    if user.inrange(144925, -56215, -2974, 5000) and User.Buffs.ByID(1062, buffCheck) and Inventory.User.ByID(1463, BuyShot) and Inventory.User.ByID(728, BuyMP) then begin
        Print('Teleport.');
        delay(1000);
  Engine.SetTarget('Marianne');                                      ///gatekeeper
   engine.dlgopen;
        delay(1000);
  Engine.DlgSel('Towns Areas');
        delay(1000);
  Engine.DlgSel('Goddard Area');
        delay(1000);
  Engine.DlgSel('Imperial Tomb');
        delay(1000);
    end;   

in a function, and call this function after rbf or shopping is done.

 

 

I put result=false after begin, and range is now 15000 but same problem.

 

I cant make this function and call function after rebuff or shopping done, cause shopping dont work do you understand what want i do? If i remove me berseker buff and i if dont have ss/mana potions, char just rebuff, buy ss, and returns to the coordinates of the beginning (Engine.MoveTo(147746, -55697, -2742) [;)] .

 

If i have berseker and soulshots, char do nothing, just move to coordinates all time.

Sorry for this english.

Posted

in buyshot function i see you change id so need change here too 

if user.inrange(144925, -56215, -2974, 5000) and User.Buffs.ByID(1062, buffCheck) and Inventory.User.ByID(1463, BuyShot) and Inventory.User.ByID(728, BuyMP) then begin
  • 10 months later...
Posted

 

change Engine.BypassToServer to your server or use Engine.DlgSel this script works l2blaze/l2neo i think

begin
while true do begin
  Engine.SetTarget(31521);                                      ///jeremy
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  Engine.bypasstoserver('Quest 621_EggDelivery 31521-1.htm');
  Engine.MoveTo(150404,-113188,-2141);
  Engine.MoveTo(150533,-114686,-1779);
  Engine.MoveTo(151344,-115006,-1611);
  Engine.CancelTarget;
  Engine.MoveTo(154492,-114995,-1567);
  Engine.MoveTo(157224,-115436,-1922);
  Engine.MoveTo(157381,-115407,-1896);
  Engine.MoveTo(157358,-115501,-1921);
  Engine.MoveTo(157598,-115486,-1927);
  Engine.SetTarget(31543);                                    ////pulin
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  delay(500) ;
  Engine.bypasstoserver('Quest 621_EggDelivery 31543-1.htm');
  Delay(500);
  Engine.MoveTo(156803, -115366, -1880);
  Engine.MoveTo(155365, -114559, -1625);
  Engine.CancelTarget;
  Engine.MoveTo(154269, -113957, -1604);
  Engine.MoveTo(152599, -113547, -1658);
  Engine.MoveTo(152072, -113343, -1626);
  Engine.MoveTo(151519, -112861, -1999);
  Engine.MoveTo(151244, -112937, -2124);
  Engine.MoveTo(151203, -112241, -2287);
  Engine.MoveTo(153632, -110383, -2675);
  Engine.MoveTo(154994, -107157, -2697);
  Engine.MoveTo(155599, -105710, -2755);
  Engine.SetTarget(31544);                                      /// naff
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  Engine.bypasstoserver('Quest 621_EggDelivery 31544-1.htm');
  Delay(500);            
  Engine.MoveTo(155621,-105697,-2780);
  Engine.MoveTo(154776,-104491,-2810);
  Engine.CancelTarget;
  Engine.MoveTo(153253,-101918,-2757);
  Engine.MoveTo(152601,-101212,-2943);
  Engine.MoveTo(149277,-100863,-2943);
  Engine.MoveTo(148429,-100919,-2994);
  Engine.MoveTo(146268,-101937,-2872);
  Engine.MoveTo(144957,-102812,-3556);
  Engine.MoveTo(141104,-105238,-3650);
  Engine.MoveTo(140773,-105450,-3659);
  Engine.MoveTo(140748,-105458,-3625);
  Engine.SetTarget(31545);                                      ///crocus
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  engine.bypasstoserver('Quest 621_EggDelivery 31545-1.htm');
  Delay(500);
  Engine.MoveTo(140722,-105729,-3654);
  Engine.MoveTo(140862,-108560,-3654);
  Engine.CancelTarget;
  Engine.MoveTo(141469,-109301,-3616);
  Engine.SetTarget(31546);                                    ////kuber
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  Engine.bypasstoserver('Quest 621_EggDelivery 31546-1.htm');
  Delay(500);
  Engine.MoveTo(142274, -109216, -3587);
  Engine.MoveTo(143990, -108702, -3503);
  Engine.CancelTarget;
  Engine.MoveTo(146375, -108965, -3252);
  Engine.MoveTo(147727, -108871, -2899);
  Engine.MoveTo(148785, -108902, -2639);
  Engine.MoveTo(149347, -109226, -2515);
  Engine.MoveTo(149506, -110728, -2294);
  Engine.MoveTo(147948, -113046, -2157);
  Engine.MoveTo(147899, -113372, -2150);
  Engine.MoveTo(147528, -113301, -2112);
  Engine.SetTarget(31547);                                    /////beolin
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  engine.bypasstoserver('Quest 621_EggDelivery 31547-1.htm');
  Delay(500);
  Engine.MoveTo(147591,-113304,-2108);
  Engine.MoveTo(148037,-113126,-2163);
  Engine.MoveTo(148908,-112712,-2096);
  Engine.MoveTo(149508,-112634,-2090);
  Engine.SetTarget(31521);                                  ///jeremy
  Engine.DlgOpen;
  Engine.DlgSel('Quest');
  Delay(500);
  Engine.DlgSel('Egg Delivery');
  Delay(500);
  engine.bypasstoserver('Quest 621_EggDelivery 31521-3.htm');
  Delay(500);
  end;
 end.

This one is working on todays l2neo but after he deliver eggs and finish the quest he cant take a new one and hes just running the course w/o the quest taken. Any help with that?

  • Vision locked this topic
Guest
This topic is now closed to further replies.



  • Posts

    • New Release World & atmosphere A complete dynamic weather system has arrived, with Clear, Light Rain, Rain, Heavy Rain, Storm, Snow, and Windy presets. Rain and snow react to roofs, wind moves foliage, lightning illuminates storms, exposed ground becomes wet and develops puddles, and snow builds up and melts over time. Weather includes Low to Ultra quality levels and advanced controls for precipitation, wind, cloud cover, lightning, surface wetness, puddles, and snow. The game server can also select or restore the current weather while local quality settings continue to control rendering cost. The weather can be controlled from the server with custom packets. For more details use Shift+Alt+P. Enhanced lighting now allows authored lamps, fires, and other light sources to illuminate towns and interiors. Lights can pulse, flicker, blink, and strobe, flames produce warm dynamic light, and lamps display depth-aware halos. Remastered emissive surfaces are now supported, beginning with illuminated windows in Giran that glow and cast light into their surroundings. Broadcasting Towers now use their correct original scale and animated rings and glow effects. Map, quests & navigation A complete quest journal has been added, with active and completed quests, expandable stages, descriptions, requirements, item progress, quest inventory integration, location controls, and quest cancellation. Quest objectives now appear through flashing minimap and world-map markers, an overhead directional guide, a notification button beside chat, and rotating quest symbols above eligible NPCs. Server-directed radar markers now work across the live minimap and world map, including the original overhead guidance effect and arrival behavior. The original tutorial system now works, including scrollable tutorial pages, animated illustrations, the flashing question button, tutorial links, and movement, camera, pickup, and sit/rest progression events. Server-opened town maps now display their original artwork and the supplied player marker. Shops, storage & items Personal, clan, castle, and freight warehouses now work, including deposits, withdrawals, stack quantities, fees, weight and capacity previews, tooltips, and the original warning and empty-storage dialogs. Account freight now works through the original recipient picker and delivery window, allowing items to be sent to another character on the same account. Multisell exchanges now work, with paged recipe lists, product details, required materials, quantity selection, warnings, and server-backed completion. Manor seed purchasing is now supported through the shop interface, including availability and pricing. Inventory items can now be dragged to the trash button and destroyed after the appropriate warning or quantity prompt. The original in-game calculator now works with mouse and keyboard input. Community The Community Board is now available from the system menu or Alt+B, with Home, Favorites, Region, Clan, Memo, Mail, and Friends sections, retained navigation, forms, scrolling, minimization, and server-provided pages. Characters, cameras & events Striders and Wyverns now render as fully animated mounts with the rider attached correctly. Striders remain ground-based, while Wyverns support three-dimensional flight. Characters now enter a proper falling state after high drops or airborne dismounts, with falling animations and server-authoritative landing and fall-damage handling. Players can now sit on authored world chairs using the correct sit, wait, and stand animations. Server-driven special camera sequences now work, including target tracking, interpolation, duration, widescreen bars, and restoration to the normal camera. GM camera mode and server-authorized ///fly movement are now supported. The original 102-second Kamael teaser sequence has been restored with its complete slideshow, transitions, panning artwork, localized subtitles, and narration. Hats, masks, circlets, and other hair accessories now use their authored head placement and correctly adjust the character's hairstyle. Timed server confirmation dialogs, short-duration status effects, regeneration previews, and the seasonal Christmas Seal presentation are now supported. Interface & performance Character creation has been refined with corrected description wrapping, clipping, layout, and name-entry presentation. Tutorial and NPC dialog windows now use polished proportional scrollbars, improved HTML layout, and correctly sized illustrations and controls. A new independent 3D render-resolution setting offers Native, 720p, 900p, 1080p, 1440p, and 4K choices while keeping the window, HUD, text, and FermaUI at native resolution. Major rendering optimizations reduce unnecessary work in local lighting, shadows, visibility, exposure, bloom, post-processing, and GPU diagnostics. Download from the launcher you have installed, or at https://updates.fermata.gg/ if you don't have the launcher. Fermata Light Engine Preview All lights can be baked in the client, shipped to the users, and exported and imported as .femlight files.
  • 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..