Вы находитесь на странице: 1из 42

L2.

Net User Guide by CPP User Interface Summary and Guide

Each number is a section; please visit the next 4 pages... Each page is a different section stating various information about the section. There is also a section for the File/Command/etc. menu. The guide for that section is after the 4 first sections.

Section 1
This section contains information regarding your character and his current state. It can help with skills, items, your clan and your self-stats. Each tab is clickable, and each contains new information.

Char tab o Contains information such as Name, P. atk and other stats. o Is displayed much like in the game Lineage 2. Inv tab o Contains information regarding your inventory and equipped items. o States the items count, item id, if it is equipped, and much more. o It is possible to use an item by double clicking on it in your

inventory list. To equip an item, you must use it.

Skills tab o Contains information regarding your skills. o This will state the skill name, level, id, passive/active and more. o It is double click-able, which will use the skill Make sure it is an

active skill, because if it isnt then it wont do anything.

Clan tab o Contains information regarding your clan specifically the members. o This is useful for when you want to see who is online, but I dont

think it has much other uses.

Section 2
This section mostly contains information about things that are around you. These things include items, players, NPCs, and specific details about yourself. There are also several tabs in this section; each containing new information.

Map tab o This tab is edit-able, and is used to adjust the Map L2.Net has. o You can adjust the zoom by dragging the scroll bar. o You can turn off the display of names. o If you click CTRL or SHIFT, then anything you do (skills or

actions) will act like your holding CTRL or SHIFT. As in, if you press CTRL and double click a player, it will let you flag. o If socials are checked, it will say when someone/thing uses an emoticon like Dance.

Char tab o This tab contains very specific information about your character. o There is a lot of information, too much to state If you would like

to look at it, it is all easy to understand names and such.

Players tab o This tab contains information about other players around. o Information includes ATK Spd, CAST spd, war status, class status,

and much more information all listed in the box. o You can double click on a player, and it will be as if you double clicked on him in-game. If you have CTRL checked, it will attack.

Items tab o This tab contains information about items around you. o You can double click on the item and it will try to grab it for you.

But be aware, if there is a wall it will just walk through it. Very easy to be caught while doing that o You can also see the item id, and the amount as well as the name. functions. The only difference is that it is for NPCs around you.

NPCs tab o It contains the same information as players tab and has the same

Section 3
This contains the chat box provided in L2.Net. Information stated includes errors and chat from the game. You can use the text box to say something (put text in text box and press say). If you change the combo box, it will say it in what you choose like Shout without the ! needed.

Section 4
This section contains 2 boxes, one for your target and one for yourself. The first box (on the top) is for your target and includes hp, mp, cp and name. The second box (on the bottom) is your self and includes the same thing but in a graphical colored box as well as in plain text. If you arent in party with a player, chances are you wont be able to see his hp/mp.

Menu Section Guide


This provides you to do many commands in L2.Net. You can change a lot of information using this, I will go through it briefly. Most of it is easily understandable, in fact all of it is self-explanatory but here is a quicky guide to help you out. Each Tab (ex: File or Command) has its own page and information for it. There is a guide for logging in, under the FILE section.

File
This, in my opinion, is the most important tab of all. It contains the button used to login, as well as to see the map for your game.

Logon Window (How to logon) o IG means you play with a Lineage 2 Client with L2.Net running in

the back and OOG means you only use L2.net to run the game.

How to login using OOG o Click File Logon Window. o Click OOG and ignore the combo box. o After that, there is a text box for your servers ip address. o Leave the rest alone until the last 2 boxes. o The first is for your user name, the second is for your password. o Click Logon o Click your server in the list and click Select Server. o Click on the character you want to use and click Select Char. o Go to File Game Window in order to move around and see where

you are. It is a 2-d topographical view of you in L2.

How to login using IG o Click File Logon Window. o Click IG o Put in your servers IP in the first box. o Click Listen. o Start up Lineage 2 regularly and then play. (The Game Window and

other options in L2.Net are possible once you login as usual).

Report Window o Doesnt work because Slothmo is a lazy bum xD. Overlay Window o Shows target information such as name, hp, cp, and mp. o To close the window, click on File Overlay Window again. Shortcut Window o Shows your shortcut bar. o Works like in-game L2, but you click once not twice to use skills. Launch Lineage 2 o Runs L2 if you put the path in Options Setup. Exit o It exits the L2.Net Client.

Command
This contains commands that can let you do special things in L2.

Cancel Target o Works like ESC in L2, ends/cancels your target. Toggle Botting o Turns the bot off, but not the scripts. Restart o Sends you back to the character login list, (Go to Login Window to

see it). Only possible with OOG.

Logout o Logs your character out of the game. Close Client o Sends your character out of the game and exits. Kill Threads o Takes your character out of the game. Force Log o Basically is Kill Threads as far as Im aware.

Options
This will let you change options and interface features.

Bot Options o There are a lot of options you can change in Bot Options, here is a

quick help tutorial for you. o To active follow: You must put the persons Name and click active follow. You can change the options, they will change how you move. o To buff/heal: You have to use a Shortcut in your action bar, so make sure it is a shortcut. Set the Page the shortcut is on and the number the shortcut is on as well. Set the trait such as HP and then under XX < %, put the % you want the hp to be lower than to use the skill. Set the delay in seconds, and the MP needed to use the skill and then click Apply. You can add multiple and they will all work at the same time. o There is much more, but you need to check the forums or learn yourself because this guide cant handle writing all of everything sound when someone is at a certain war status. o The HP/MP/CP are all alerts if your hp is under a certain %. o Clan/Player are for if a certain player from a clan arrives or a certain player The text box is for the name of the clan/player. o Check the checkbox for the alert to actually go/be on.

Sound Alerts o All the wars are just triggers asking you if it wants to make a

Save Interface o Wait until you read the next menu button Setup Setup o Setup will let you change the voice (The voice that says things). o Minimize to Tray will make L2.Net minimize and go near your time o o o o o o

clock with an icon instead of just regular minimizing. Id just leave Allow Script I/O on if I were you, dont mess with it. Lineage 2 Path is for when you click File Launch Lineage 2. Toggle Key will turn on/off botting (NOT scripting). Product key is for a key if you have one. White Names will change the color of text for names to white. Click Save Interface so you dont have to change options again.

Scripting
Scripting is the most powerful feature in L2.net. This tab will let you use scripting. A lot of it wont make sense unless you know how to script

Set Script Main o Lets you set the current script to a file. Start Script o Starts a script. Reset Script o Re-Loads script (does update file in-case changes were made). Script Editor o Opens up a script editor with an edit box and 4 buttons. Each

button is self-explanatory. This menu is used to make scripts.

Script Debugger o Debugs script (only usable with a key). o Allows pause/resume script as well as snapshot. Debug Mode o Debug mode will tell you certain things in the chat box that you

wouldnt normally see. One useful part of this is that it tells you how to use NPC chat. more different commands, and will also display it in Hex. Very useful with the INJECT command.

Dump Mode o Dump mode will do what Debug Mode does. However, it will display

Help
Help is useful for its hosts function along with Force Collect. Here is more info

Donate o Opens up a link to the website where you can donate to L2.Net. o As a personal note, I love L2.Net and highly recommend anyone to

donate to L2.Net. I may have and will make fun of Slothmo, but he spends a lot of time in this program and deserves some gratitude. Please, if possible, donate If you cant donate, please contribute by sending all bug reports and also learn/help others with their scripts. Thanks for reading, I just really wanted to speak my mind. o -- No offense to anyone else that helps out L2.Net or deserves an honorable mention But Slothmo is just the only one Ive ever talked to/seen who works on L2.Net. check it out at least once

About o This shows a box stating information about L2.Net. You should Hosts o Opens up notepad with your hosts file. You can edit it and then

save strait to your hosts file.

Language o Opens a dialog letting you change the current Language. Force Collect o Cleans up memory being used by L2.Net and Lineage 2. There is

sometimes memory that needs to be freed and this does that for you. Very useful if your using IG and your lagging a lot.

That does it for the User Interface Guide. If you would like to learn any more, I highly encourage anyone to take the next step and start scripting. I have 12 lessons below, and after them all you should be able to make your own high-quality scripts.

Thanks for your time, CPP

Scripting Tutorial and Guide

Basics o Hello World o Variables and Integers o Strings and Doubles o Global Variables Intermediate o IF statements o IF statements with commands (potion script) o Error-Proofing o Looping Advanced o Learning Commands o Variable Change o Functions o SCRIPT_EVENT uses Extra o Math o Lists o Messages o File Writers o Proper script etiquette INDEX o Categorized o Non-Categorized
Scripting must be done while logged into a server unless you obtain a key

Scripting is the most powerful, useful and abundant tool in L2.Net. L2.Net scripting gives you a lot of power, and you do things yourself. It is like making your own bot, being able to do everything yourself and not limited by someone else.

Lesson 1 Hello World

Scripts are typically stored in your L2.Net folder in a folder named scripts. This is the default save/open path for the script editor in L2.Net. There are also other reasons to use this folder, which you will find out in other lessons. Lets first make the Hello World function Simply go to Scripting Script Editor. This will open a big text file along with 4 buttons at the top. Load, Save, Top and Close All of them being the obvious definitions To start, write this into the big box for text PRINT_TEXT "Hello World" END_SCRIPT
Now click Save Script. As the file name write something like Hello World. Click Close and then go to the main window now. Go to scripting Main Find the file you saved and then click Open. Go to Scripting Script. Then go to Scripting Start Script. Set Script Reset

These are the things you must do in order to start a script and here is a quick easy reference for each of the scripting buttons Start Script will, of course, start a script Reset Script will reset the script to the first line and renew the text file As in, say you add a line to a text file, you dont need to set script, you can just reset. Set Script will set your script to a *.l2s file. It should display Hello World into the chat box in your main L2.Net Window. PRINT_TEXT TEST will display whatever is in the quotes into the L2.Net Chat Box. END_SCRIPT will simply end the script when called.

Lesson 2 Variables and Integers.

An integer is simply a variable for a number. All you need to know is a variable is something you can use to call to an integer, string, etc. Here is an example using an integer variable

DEFINE INT VARINT 20 PRINT_TEXT <&VARINT&> END_SCRIPT


DEFINE will define a certain type of variable to have a name and value. DEFINE INT VARINT 20 will make an integer with the name VARINT and set it to 20. PRINT_TEXT is something we learned before, but we did not go over the <&VARNAME&> command. This, when used in quotes, is a reference to a variable. You must reference to the name of the variable, and it will grab the variables value and place it in the quotes as if it were text. END_SCRIPT, as we learned, ends the script. Save/Load the script like in Lesson 1 and it should display 20.

Lesson 3 Strings and Doubles

There are many more variables that can be used in L2.Net Such as STRING, DOUBLE and FLOAT Most importantly, String and Double Here is a quickie example for them DEFINE STRING MYSTRING "Test String" DEFINE DOUBLE MYDOUBLE 10.50 PRINT_TEXT "MYSTRING is <&MYSTRING&> and MYDOUBLE is <&MYDOUBLE&>" END_SCRIPT Sometimes, you will find yourself doing this DEFINE INT TEMP 500 IF CHAR_CUR_HP > TEMP PRINT_TEXT <&CHAR_CUR_HP&> is greater than 500 ENDIF END_SCRIPT L2.net has added a nice little feature to take away the temp integer which will cause unwanted speed reduction and extra lines of code. Because of this, L2.Net placed in the i command as I like to call it. What it does is it makes a temporary variable for you and then erases it immediately after the IF statement or whatever. So, using this you can write the same script but as IF CHAR_CUR_HP > i500 PRINT_TEXT <&CHAR_CUR_HP&> is greater than 500 ENDIF END_SCRIPT Also, you should know that when I use the text ONE or ZERO It is much different then actually placing 1 or 0. ONE and ZERO were added for the same reason the i function was added The difference is that ONE and ZERO are Global Variables placed in naturally. In an IF statement, you must use variables only (local and global is fine).

Also, there is more than just the i command, there is also the $ command for strings such as IF STRING == $String Also, there is the command for double which is d IF DOUBLE == d0.50

Lesson 4 Global Variables.

You have learned the basic of basics Here is the last lesson to learn for basics L2.Net has a set of basic variables that you can use for your script. These contain important information, such as your HP and MP. Here is an example of using one of the Global Variables PRINT_TEXT "<&CHAR_CUR_HP&>" END_SCRIPT
This is one of the built-in variables. This is your current HP; it should simply display your current hp.

That is it for the basics, hopefully it wasnt too hard and you can brace yourself for the more difficult parts of scripting.

Lesson 5 IF statements

You have learned about variables and how to use script files. You have learned about global variables as well, now you need to learn about how to use these variables. L2.Net offers many ways to use variables Such as, to only do something when your hp is at a certain number IF CHAR_CUR_HP == CHAR_MAX_HP PRINT_TEXT "HP is full <&CHAR_CUR_HP&> / <&CHAR_MAX_HP&>" ELSE PRINT_TEXT "HP is not full <&CHAR_CUR_HP&> / <&CHAR_MAX_HP&>" ENDIF END_SCRIPT
IF Statements are very important in L2.Net They allow you the ability to only do certain things at certain times or when they are needed. For example, if your hp is full it will say HP is full 1000/1000 and if it isnt full, it will ignore that command. -- As an extra note, if requires the == indicator which is two equal signs and not one. ELSE statements are used with IF statements They allow you to do a command only if the if-statement isnt used. So, in other words, if the HP isnt full it will do the commands in the ELSE statement. ENDIF indicates the end of both the if and the else command.

Lesson 6 IF statements with commands (potion script)

We have learned the basics; its time for the building block of scripts The basic use potion script Here is how you would do this There is a list of functions that are built into L2.Net. These functions can do things from walking to using items and many more as well. Here is an example of how to use a function named USE_ITEM which simply uses the item with the id that you give it. IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM 1061 // Use Healing Potion ENDIF PRINT_TEXT "DONE" END_SCRIPT
The < is the same as == as to where it is placed in an if statement. The difference is that < is less than, so if our current hp is less than our max hp then it does whatever is in the if statement. USE_ITEM is a function found in L2.Net. Like I said before, it simply uses the item with the id that we tell it to. By placing 1061 after it, I am telling it to use the item with the ID of 1061. This item is the Healing Potion btw. So, in other words, if our hp is lower than our max hp use a healing potion and then print done and then end our script.

Lesson 7 Error-Proofing

Now, we need to try and take away all errors that could possibly occur in our program. Like, for example, if they dont have any healing potions. Which, we will use ITEM_COUNT for DEFINE INT ITEMCOUNT 0 ITEM_COUNT ITEMCOUNT 1061 IF ITEMCOUNT > ZERO IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM 1061 // Use Healing Potion ENDIF ELSE PRINT_TEXT "You have no healing potions 8( ENDIF PRINT_TEXT "DONE" END_SCRIPT
First, we need to make a variable to hold the item count. We put the DEFINE in for that, and we made it 0 just for a temporary number. You have to add something, and 0 is just what I chose. Next, we have to find the item count ITEM_COUNT will put the amount of items into the variable you give it in the first parameter. In the second parameter, you place item id We put 1061 because we want to see how many Healing Potions we have. Then, if we have more than zero healing potions, it uses one If not (the else statement), it tells the user that we have no healing potions so he knows about it. It then prints done, and ends the script

Lesson 8 Looping

We have another error with our script, we only get the hp potion one time and it only checks our hp one time But we want it to keep going and going so that we can go play while it continuously checks our hp A loop will help us with that, a loop is like an if statement but it continuously does the code until it meets a certain requirement. We dont want that requirement to ever be fulfilled (because we want infinite). So we are going to make an infinite loop by doing DO -- Code -LOOP ONE == ONE DO and LOOP are the commands used in a loop This statement will loop and do the codes in between them until ONE == ONE is not true In other words, when ONE does not equal ONE. This is our script with the loop idea added to make it in infinite. DEFINE INT ITEMCOUNT 0 DO ITEM_COUNT ITEMCOUNT 1061 IF ITEMCOUNT > ZERO IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM 1061 // Use Healing Potion ENDIF ELSE PRINT_TEXT "You have no healing potions 8( ENDIF PRINT_TEXT "DONE" LOOP ONE == ONE END_SCRIPT We place the DEFINE out of the do statement, because we only need to define our variable one time. The rest is all like the old script; the only difference is it will be continuously done until our user clicks stop script.

You now know the intermediate part of scripting. To be honest, with what you have learned you can do MANY different scripting feats. However, I do recommend reading the advanced part simply because it isnt that big and you can learn a little more about scripting.

Lesson 9 L2.Net Command Thread

There is a pretty extensive guide on the forums, with many commands that you can learn and use yourself. These are practically the A-Z for L2.Net, if you ever need to know more about a command or how to use a command This thread has got all you need. The problem is you need to understand how to use it So I made this small lesson just to help you out with that. Here is an example of how to use/read this guide. SLEEP [ui] [ui] The length of time in miliseconds to sleep. EX: SLEEP 1000 First, you need to know SLEEP [ui] means that there is 1 parameter (ui) for the command SLEEP. What you should automatically think is, What do I have to put in UI?. Well, that is exactly what the next line tells us. The next line has [ui] and then a description of what you need to place for that variable. A millisecond is simply 1000 of a second. In other words, 1000 milliseconds = a second. Then, it also gives an example notated by EX: . That is an exact way to use it, SLEEP 1000. That is all you really need to know, there are several more commands, but they are all written like or exactly like this. So, now, all it takes is time for you to learn all the commands in L2.Net. ^_^.

Lesson 10 Variable Change

Sometimes, you will find that you need to use a number that changes. For example, our ITEMCOUNT script will change so we had to place the variable there to account for variable change. Another good example is when we want to drop items. In order to drop items, we dont use the item id, instead we have to use the unique item id given to it from the server/game. That means that if we want to drop anything, we need to find the id and then have that number stored somehow. Obviously, we will use a variable and store the number to use later. We also, must have another variable for how many of that item we have in order to know how much to drop. On top of that, just for kicks, lets also make another variable to hold the regular ID of our item instead of having to write it 4 or 5 times. Here is how to do so DEFINE INT ITEMCOUNT 0 DEFINE INT ITEMID 1061 DEFINE INT UITEMID 0 ITEM_COUNT ITEMCOUNT "<&ITEMID&>" IF ITEMCOUNT > ZERO INVEN_GET_UID UITEMID "<&ITEMID&>" DROP_ITEM "<&UITEMID&>" "<&ITEMCOUNT&>" "<&CHAR_X&>" "<&CHAR_Y&>" "<&CHAR_Z&>" ENDIF

Here we define all the variables we need, ITEMCOUNT in order to hold the amount of items we have. ITEMID to place the item id, and UITEMID in order to hold the unique item id Then, we use the ITEM_COUNT command to get the amount of items we have with that ID. Next, if we have more than zero of that item, we use INVEN_GET_UID in order to get the unique id of ITEMID and then store it in UITEMID. After all that, we finally use DROP_ITEM in order to drop ITEMCOUNT amount of our UITEMID and we drop onto our own CHAR_X, Y, and Z. That concludes variable change.

Lesson 11 Creating your own functions

As you write scripts, you will find yourself repeating code and different things. A function is good because
You can just have a call to a function which is less work than writing the whole function. Allows for a sense of tidiness, making it easier to read and use your code. Others can place them into their scripts and use the functions for their own need.

Here is how to use a function DEFINE INT ADENAID 57 DEFINE INT CHECKINT 0 CALL DROP_ITEM CHECKINT 2 ADENAID CHAR_NAME IF CHECKINT == ZERO PRINT_TEXT "Didn't Work" ELSE PRINT_TEXT "Did work" PICKUP_NEAREST ENDIF END_SCRIPT FUNCTION DROP_ITEM 2 ITEMID TARGET DEFINE INT ITEMCOUNT 0 IF TARGET_NAME = TARGET ELSE COMMAND "/target <&TARGET&>" ENDIF ITEM_COUNT ITEMCOUNT "<&ITEMID&>" IF ITEMCOUNT > ZERO INVEN_GET_UID ITEMID "<&ITEMID&>" DROP_ITEM "<&ITEMID&>" "<&ITEMCOUNT&>" "<&TARGET_X&>" "<&TARGET_Y&>" "<&TARGET_Z&>" RETURN 1 ELSE RETURN 0 ENDIF RETURN VOID

First, lets look at how to make a function. Lets look at the line that says FUNCTION DROP_ITEM. This is used to create a function Here is an explanation of how to use it. First off, you put FUNCTION and then the name of the Function you want to make. After that, you put how many variables you would like to use (2), and then the names you want the variables to have. On the next lines, you have the code being used. In order to end a function, you must use the RETURN command. This will end the function and give output from the function to the CALL. Now that we have a function, we have to CALL it. By putting CALL DROP_ITEM Next, we put a variable we already have made This variable will hold whatever is returned by the function. Then we have the variables we are going to send, first off with the amount of variables we have and next the name of the variables being sent. The variables must be in order, and to explain this here is an example

CALL DROP_ITEM CHECKINT 2 ADENAID CHAR_NAME FUNCTION DROP_ITEM 2 ITEMID TARGET

ADENAID will be turned into ITEMID, and CHAR_NAME will turn into TARGET. These variables (ITEMID and TARGET) will only be usable while inside the function and will be erased immediately after the function is over. ADENAID and CHAR_NAME will be completely unchanged from the function. After the function does a RETURN, it will change CHECKINT to whatever you place after the RETURN. Like RETURN 1 will end the function and change the variable CHECKINT to 1.

That is it for functions Please use them instead of SUBs

Lesson 12 Script Event Uses

L2.Net has added a handy feature called script events. A script event will start or use a function when a certain event is triggered. A good example would be the SCRIPTEVENT_CHAT (Which is triggered when you receive any kind of chat to your character) Along with being triggered, there is also a set of variables it makes such as SCRIPTEVENT_CHAT gives the variables
INT MESSAGETYPE INT SENDERID STRING SENDERNAME STRING MESSAGE Each variable is named accordingly Meaning that SENDERNAME is simply the name of the person who sent the message. MESSAGE is the message sent.

In order to use an event, you must use the command SET_EVENT.

SET_EVENT "<&SCRIPTEVENT_CHAT&>" thisfile.l2s thisfunction FUNCTION thisfunction 0 PRINT_TEXT <&MESSAGE&> was sent by <&SENDERNAME&> RETURN VOID END_SCRIPT
<&SCRIPTEVENT_CHAT&> is just one of the events put in L2.net. The event will use a function found in a file. The file in this example is thisfile.l2s and the function is thisfunction. The file MUST be in the scripts folder in your L2.Net folder.

EXTRAS After writing all the lessons, I am just thinking of several things that I would like others to learn about. So, I made this section in order to list them all Please feel free to read them, they arent useless They just arent used all the time, and arent a necessity.

EXTRA Math

Math is a very useful function in L2.Net It can allow you to add, subtract, divide and multiply along with also reading and writing in files (but I wont talk about those here). DEFINE INT A DEFINE INT B DEFINE INT C SET B 20 SET C 30 MATH A B ADD 0 0 0

This will add 20 and 30 and put the result into A. ( A = 20 + 30 )

You can also do subtraction DEFINE INT A 0 DEFINE INT B 0 DEFINE INT C 0 SET B 20 SET C 10 MATH A B SUBTRACT C
This will subtract 20 from 10 and put the result into A.

EXTRA Lists

Lists are a useful way to store information, but also a pain in the neck to understand (My example was simply grabbed from the \scripts\tests\foreach.l2s file.) A list can be an array list and a sorted list. Here, Ill show how to use an array list. DEFINE DEFINE DEFINE DEFINE INT I0 1 INT I1 2 INT I2 3 ARRAYLIST MYAL 0

MATH MYAL I0 add i0 MATH MYAL I1 add i1 MATH MYAL I2 add i2 FOREACH A INT MYAL PRINT_TEXT <&MYAL.A&> NEXTEACH
So, first we define 3 ints and then an arraylist. After that, we add the integers to the arraylist. Personally, every time I use a list I do the exact same thing I wouldnt try and mess with it, like trying to add a different name integer etc. Then there is the FOREACH FOREACH will create an integer variable for you so that you can use it. Then, you can grab that by using the local variable MYAL.A (local meaning you cant use it after the FOREACH is over. You can change A to B, but you also must use MYAL.B instead of A. NEXTEACH will simply go to the next integer. Such as 1 to 2, which makes you use the next part of the arraylist. So, in other words, this function simply makes ints, puts them in a list, and then goes through the list printing each variable found.

EXTRA Messages

Messages are a pretty new feature, they allow you to open a message box containing data you specify. It is useful, and a better way to inform your viewer of data as opposed to printing text. But, I do advise against using them unless in dangerous or needed situations due to it being a user-hassle to click OK over and over This is pretty small and not very informative, but I felt it was worth mentioning as a feature You can make/start a message box by using the command MESSAGE_BOX "stop" "hammer time!" HAND
This will simply open a box that users can read and click OK to close. To change the icon/sound of the message box, change the HAND part to an icon you would like. (There is a list of them in INDEX under TYPES).

EXTRA FILEWRITERS and READERS

DEFINE FILEREADER FR "Test" DEFINE INT TEMP TWO MATH FR TEMP READ MATH FR NULL CLOSE PRINT_TEXT <&TEMP&>
First, we define a variable named FILEREADER which simply reads text. Then, we define an INT to read the text into. MATH FR TEMP READ will read a line in FR and put it into TEMP. MATH FR NULL CLOSE will close the file (you dont need to know much except that you should use this when your done with a file). PRINT_TEXT <&TEMP&> simply prints whatever temp is.

You can also use FILEWRITER

DEFINE FILEWRITER FW "Test" DEFINE INT TEMP TWO MATH FR TEMP WRITE MATH FR NULL FLUSH MATH FR NULL CLOSE
We define the FILEWRITER and the INT as normal But, this time instead of using READ we use WRITE which will write whatever is in TEMP into FW. Just like close, flush is just something you should do. So we place that and CLOSE.

Proper Script Etiquette A lot of the time, I see people with some horrible script etiquette and other times I see people with some great etiquette Hopefully this will help some of you with that First of all, Tabs are a very useful part of text. It allows for us to see an IF or a WHILE much easier and also read it much more conveniently. Here is just a quick example IF ITEMCOUNT > i10 IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM 1061 ENDIF ENDIF

IF ITEMCOUNT > i10 IF CHAR_CUR_HP < CHAR_MAX_HP USE_ITEM 1061 ENDIF ENDIF
Which do you think looks easier to read and more understandable? In a script, you will have bugs and changes you want to make, which example would you like to rather read 50-60 times? Thats the size of a script, and thats why tabs are nice. Tabs are used a line after an IF or a WHILE to indicate it is inside it. Multiples IFs mean multiple tabs, one tab per IF. (When I say IF, I also mean Whiles and DOs etc.

Tabs are not the only problem I see with scripts, there is also the problem with not putting in any comments. Say you just wrote a 70-80 line script, and suddenly you realize you made a typo at a certain part. Lets just say its at your text sending part. Now, you have to read through all those lines and find that part. But, if you had comments, you could just look only at the small comments making it much easier. Also, comments help people

understand your code and even help you understand your own code that you wrote a few weeks/days ago. Here is an example IF TEMP > i10 IF TEMP2 > TEMP3 USE_ITEM 1061 // Use Healing Potion ENDIF ENDIF

// If you have more than 10 healing potions IF TEMP > i10 // If you have less than full hp. IF TEMP2 > TEMP3 USE_ITEM 1061 // Use Healing Potion ENDIF ENDIF
Very commonly you will have multiple variables and even you wont remember what all of them were referring to or doing at a certain part in your code. If you had just looked at the first code example for the first time, would you understand it? Of course not But in the second one, you know exactly whats going on and it is right there in plain text. (This code wouldnt actually work by itself. It is just to show you how confusing and long a script can be and why comments help so much with that.)

Just remember, everyone makes mistakes What is important is that you make sure the mistakes arent too hard to fix. Comments help a lot to fix mistakes

INDEX
This is a list of the global variables in L2.Net

Categorized o Channels o Script Events o Char o Target o Types (Including Variable and Message types) Non-Categorized o Just a big list of a lot of stuff

Channels
These variables are used to describe a channel for text in L2.

Global Variable Name CHANNEL_ALL CHANNEL_SHOUT CHANNEL_PRIVATE CHANNEL_PARTY CHANNEL_CLAN CHANNEL_GM CHANNEL_PETITION CHANNEL_PETITIONREPLY CHANNEL_TRADE CHANNEL_ALLY CHANNEL_ANNOUNCEMENT CHANNEL_BOAT CHANNEL_PARTYROOM CHANNEL_PARTYCOMMANDER CHANNEL_HERO

Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel Channel

Description for all text possible. for only shouts. for only private. for only party. for only clan. for only GM. for petition. for replies to petition. for only trade. for only alliance. for announcements. for boat and ferry. for party rooms. for party commander. for heroes.

Script Events
These variables refer to script events and are only used in order to SET_EVENT. Imagine if there was When you in front of every description.

Global Variable Name SCRIPTEVENT_CHAT SCRIPTEVENT_SELFDIE SCRIPTEVENT_SELFREZ SCRIPTEVENT_SELFENTERCOMBAT SCRIPTEVENT_SELFLEAVECOMBAT SCRIPTEVENT_SELFSTOPMOVE SCRIPTEVENT_SELFTARGETED SCRIPTEVENT_SELFUNTARGETED

Description Receive chat. You die. Are resurrected. Start fighting. Stop fighting. Stop moving. Are targeted. Are untargeted.

CHAR Global Variables


All Variables refer to only the character that L2Net is running on.

Global Variable Name CHAR_NAME CHAR_TITLE CHAR_SP CHAR_XP CHAR_LEVEL CHAR_CLASS CHAR_X CHAR_Y CHAR_Z CHAR_DESTX CHAR_DESTY CHAR_DESTZ CHAR_MAX_MP CHAR_MAX_HP CHAR_MAX_CP CHAR_CUR_MP CHAR_CUR_HP CHAR_CUR_CP CHAR_MAX_LOAD CHAR_CUR_LOAD CHAR_RUN

Description Current Name Current Title (Clan) Current Skill Points Current Exp Points Current Level Current Class Current X coordinate Current Y coordinate Current Z coordinate X coordinate you are walking to Y coordinate you are walking to Z coordinate you are walking to Maximum MP Maximum HP Maximum CP Current MP Current HP Current CP Maximum Load (Weight) Current Load (Weight) Current Status. 1=run, 0=walking

Target
These variables refer only to the object you are targeting at that time.

Global Variable Name TARGET_NAME TARGET_TITLE TARGET_CLAN TARGET_ALLY TARGET_SP TARGET_XP TARGET_LEVEL TARGET_CLASS TARGET_X TARGET_Y TARGET_Z TARGET_DESTX TARGET_DESTY TARGET_DESTZ TARGET_MAX_MP TARGET_MAX_HP TARGET_MAX_CP TARGET_CUR_MP TARGET_CUR_HP TARGET_CUR_CP TARGET_MAX_LOAD TARGET_CUR_LOAD TARGET_ID TARGET_TYPEID TARGET_TARGETID TARGET_KARMA TARGET_SPOILED TARGET_TYPE

Description Current Name. Current Title (Clan). Current Clan Name. Current Alliance name. Current Skill Points. Current Exp Points. Current Level. Current Class. Current X coordinate. Current Y coordinate. Current Z coordinate. X coordinate you are walking to. Y coordinate you are walking to. Z coordinate you are walking to. Maximum MP. Maximum HP. Maximum CP. Current MP. Current HP. Current CP. Maximum Load (Weight) Current Load (Weight) The ID of your target. The Type of your target. The ID set for your target. Current Karma of target. Spoil status. 1=yes, 0=no Type of target.

Types
The TYPE_ are used with TARGET_TYPE and other TYPE variables. NULL to CLASS are all used for DEFINE. The (Msg) are used for message box icons and sounds The sounds are either a click or a DUN sound. (Used in MESSAGE command).

Global Variable Name TYPE_ERROR TYPE_NONE TYPE_SELF TYPE_PLAYER TYPE_NPC NULL INT DOUBLE STRING FILEWRITER FILEREADER ARRAYLIST SORTEDLIST STACK QUEUE CLASS ASTERISK ERROR EXCLAMATION HAND INFORMATION NONE QUESTION STOP WARNING

Description Error occurred while trying to find. Could mean death. If target is yourself. If target is a player If target is a NPC Nothing Integer or Number Double (A number with a digit) Anything not numbers only. Writes to files Reads from files An unsorted list A sorted list A stack will go last-first. A queue will go first-last. An object w/ functions & variables. (Msg) Blue i sign (Msg) Red X Sign (Msg) Yellow ! sign (Msg) Red X Sign (Msg) Blue i sign (Msg) no icon (Msg) Blue ? sign (Msg) Red X sign (Msg) Yellow ! sign

Everything Else
This has a very long list of different types I grabbed all of it from Slothys Global Variable list, and honestly I dont really know that much about all of them. This is more of the rejects that I dont think are hard to understand or useful.

Global Variable Name VOID ZERO ONE TWO TRUE FALSE TOWN CLANHALL CASTLE SIEGEHQ NEAREST_ITEM_DISTANCE NEAREST_NPC_DISTANCE NEAREST_PLAYER_DISTANCE COUNT_NPC_TARGETME COUNT_PLAYER_TARGETME TICKS_PER_MS TICKS_PER_S TICKS_PER_M TICKS_PER_H TICKS_PER_D SHORTCUT_ITEM SHORTCUT_SKILL SHORTCUT_ACTION SHORTCUT_MACRO SHORTCUT_RECIPE RANDI RANDD PUBLIC PRIVATE PROTECTED PI

Description None. 0 1 2 Boolean for True Boolean for false (Used in TAP_TO command) (Used in TAP_TO command) (Used in TAP_TO command) (Used in TAP_TO command) Nearest items distance Nearest NPCs distance Nearest players distance Amount of NPCs targeting you Amount of players targeting you. Used for time (milliseconds) Used for time (seconds) Used for time (minutes) Used for time (hours) Used for time (days) Indicates shortcut with ITEM Indicates shortcut with SKILL Indicates shortcut with ACTION Indicates shortcut with MACRO Indicates shortcut with RECIPE Random int 0-100 Random double 0.0 and 1 PUBLIC PRIVATE PROTECTED Used to indicate PI (math)

E SYSTEM_THREADCOUNT SYSTEM_CURRENTFILE SYSTEM_HANDLECOUNT SYSTEM_MEMORYUSAGE SYSTEM_MEMORYALLOCATED SYSTEM_STACKHEIGHT

Used to indicate E (math) Amount of threads Current File Amount of handles Amount of memory usage Amount of memory set/allocated The height of stack

Вам также может понравиться