From b11b98f7fc5794b4b16627e7c83a46d05fe55d07 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Fri, 17 Dec 2010 13:55:04 +0000 Subject: * Spellchecked script_commands.txt. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14598 54d463be-8e91-2dee-dedb-b68131a5f0ec --- doc/script_commands.txt | 350 ++++++++++++++++++++++++------------------------ 1 file changed, 176 insertions(+), 174 deletions(-) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index bc3da5e10..383a3c301 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4,7 +4,7 @@ //= A reference manual for the eAthena scripting language. //= Commands are sorted depending on their functionality. //===== Version =========================================== -//= 3.33.20101212 +//= 3.34.20101217 //========================================================= //= 1.0 - First release, filled will as much info as I could //= remember or figure out, most likely there are errors, @@ -151,6 +151,8 @@ //= 3.33.20101212 //= Updated description of 'playBGM' and 'playBGMall' to reflect the actual //= behavior. [Ai4rei] +//= 3.34.20101217 +//= Spellcheck. [Ai4rei] //========================================================= This document is a reference manual for all the scripting commands and functions @@ -233,7 +235,7 @@ Another configuration file option of relevance is: delnpc: -This will unload a specifiled script filename from memory, which, while +This will unload a specified script filename from memory, which, while seemingly useless, may sometimes be required. Whenever '//' is encountered in a line upon reading, everything beyond this on @@ -313,7 +315,7 @@ the database by adjoining the level after the name with a comma. eg: Event is a script event to be executed when the mob is killed. The event must be in the form "NPCName::OnEventName" to execute, and the event name label -should start with "On". As with all events, if the NPC is an on-touch npc, the +should start with "On". As with all events, if the NPC is an on-touch NPC, the player who triggers the script must be within 'trigger' range for the event to work. @@ -323,21 +325,21 @@ special ai mobs (which by default attack other monsters instead of players). You can add these, so using 10 will spawn small monsters that attack other mobs (if you specify both 2 and 4, the small version takes priority). -** Npc names +** NPC names -/!\ WARNING: this applies to warps, npcs, duplicates and shops /!\ +/!\ WARNING: this applies to warps, NPCs, duplicates and shops /!\ -Npc names are kinda special and are formatted this way: +NPC names are kinda special and are formatted this way: {::} -All npcs need to have a unique name that is used for identification purposes. -When you have to identify a npc by it's name, you should use . +All NPCs need to have a unique name that is used for identification purposes. +When you have to identify a NPC by it's name, you should use . If is not provided, use instead. The client has a special feature when displaying names: if the display name contains a '#' character, it hides that part of the name. -ex: if your npc is named 'Hunter#hunter1', it will be displayed as 'Hunter' +ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter' must be at most 24 characters in length. must be at most 24 characters in length. @@ -534,7 +536,7 @@ Numbers Beside the common decimal numbers, which are nothing special whatsoever (though do not expect to use fractions, since ALL numbers are integer in this language), the script engine also handles hexadecimal numbers, which are otherwise -identical. Writing a number like '0x' will make it recognised as a +identical. Writing a number like '0x' will make it recognized as a hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you try to 'mes 0x10' it will print '16'. @@ -548,7 +550,7 @@ data. Variables are divided into and uniquely identified by the combination of: prefix - determines the scope and extent (or lifetime) of the variable -name - an identifier consisting of '_' and alfanumeric characters +name - an identifier consisting of '_' and alphanumeric characters postfix - determines the type of the variable: integer or string Scope can be: @@ -579,8 +581,8 @@ nothing - A permanent variable attached to the character, the default variable This is important for scripts which are called with no RID attached, that is, not triggered by a specific character object. "." - A NPC variable. - They exist in the NPC and dissapear when the server restarts or the - npc is reloaded. Can be accessed from inside the NPC or by calling + They exist in the NPC and disappear when the server restarts or the + NPC is reloaded. Can be accessed from inside the NPC or by calling 'getvariableofnpc'. ".@" - A scope variable. They are unique to the instance and scope. Each instance has it's @@ -614,8 +616,8 @@ Examples: $name$ - permanent global string variable $@name - temporary global integer variable $@name$ - temporary global string variable - .name - npc integer variable - .name$ - npc string variable + .name - NPC integer variable + .name$ - NPC string variable .@name - scope integer variable .@name$ - scope string variable #name - permanent local account integer variable @@ -640,7 +642,7 @@ BaseLevel - Current base level SkillPoint - Amount of skill points remaining Class - Current job Upper - 1 if the character is an advanced job class. -Zeny - Current amount of zeny +Zeny - Current amount of Zeny Sex - Character's gender, 0 if female, 1 if male. Weight - The weight the character currently carries. MaxWeight - The maximum weight the character can carry. @@ -667,7 +669,7 @@ While these behave as variables, do not always expect to just set them - it is not certain whether this will work for all of them. Whenever there is a command or a function to set something, it's usually preferable to use that instead. The notable exception is Zeny, which you can and often will address directly - -setting it will make the character own this number of zeny. +setting it will make the character own this number of Zeny. If you try to set Zeny to a negative number, the script will be terminated with an error. Strings @@ -703,11 +705,11 @@ This will make @arrayofnumbers[100] equal to 10. Notice that index numbering always starts with 0. Arrays cannot hold more than 128 variables. (So the last one can't have a number higher than 127) -And array indices probably can't be negative. Nobody tested what happens when +And array indexes probably can't be negative. Nobody tested what happens when you try to get a negatively numbered variable from an array, but it's not going to be pretty. :) -Arrays can naturaly store strings: +Arrays can naturally store strings: @menulines$[0] is the 0th element of the @menulines$ array of strings. Notice the '$', normally denoting a string variable, before the square brackets that @@ -824,18 +826,18 @@ Logical bitwise operators work only on numbers, and they are the following: The second mes command would display 4, which is the same as 16 / 2 = 8. 8 / 2 = 4. & - And. | - Or. - The bitwise operator AND (&) is used to test two values against eachother, + The bitwise operator AND (&) is used to test two values against each other, and results in setting bits which are active in both arguments. This can be used for a few things, but in eAthena this operator is usually used to - create bitmasks in scripts. + create bit-masks in scripts. The bitwise operator OR (|)sets to 1 a binary position if the binary position of one of the numbers is 1. This way a variable can hold several values we can check, - known as bitmaks. A variable currently can hold up to 32 bitmasks (from position 0 + known as bit-mask. A variable currently can hold up to 32 bit-masks (from position 0 to position 1). This is a cheap(skate) and easy way to avoid using arrays to store several checks that a player can have. - A bitmask basically is (ab)using the variables bits to set various options in + A bit-mask basically is (ab)using the variables bits to set various options in one variable. With the current limit if variables it is possible to store 32 different options in one variable (by using the bits on position 0 to 31). @@ -848,7 +850,7 @@ Logical bitwise operators work only on numbers, and they are the following: The & (AND) operator sets bits which are active (1) in both arguments, so in the example 1010 & 0010, only the 2^1 bit is active (1) in both. Resulting in the bit 0010, which is 2. - - Basic example of creating and using a bit mask: + - Basic example of creating and using a bit-mask: set @options,2|4|16; //(note: this is the same as 2+4+16, or 22) if (@options & 1) mes "Option 1 is activated"; if (@options & 2) mes "Option 2 is activated"; @@ -861,7 +863,7 @@ Logical bitwise operators work only on numbers, and they are the following: The bitwise operator XOR (eXclusive OR) sets a binary position to 0 if both numbers have the same value in the said position. On the other hand, it sets to 1 if they have different values in the said binary position. - This is another way of setting and unsetting bits in bitmasks. + This is another way of setting and unsetting bits in bit-masks. Example: - First let's set the quests that are currently in progress: @@ -877,7 +879,7 @@ Logical bitwise operators work only on numbers, and they are the following: if( inProgress&1 && isComplete ){ // this will unset the bit for quest 1 (inProgress has that bit set to 1) set inProgress,inProgress^1; - mes "Quest 1 complete!! You unlocked the secrets of the Xor dinasty, use them wisely."; + mes "Quest 1 complete!! You unlocked the secrets of the Xor dynasty, use them wisely."; close; } @@ -975,12 +977,12 @@ done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd will do likewise for the end of WoE. OnAgitInit will run when castle data is loaded from the char-server by the map server. -No RID will be attached while any of the abovementioned labels are triggered, so +No RID will be attached while any of the above mentioned labels are triggered, so no character or account-based variables will be accessible, until you attach a RID with 'attachrid' (see below). -The above also applies to, the last three laels, the only difference is that -these labels are used exclusively for WoE SE, and are called independantly. +The above also applies to, the last three labels, the only difference is that +these labels are used exclusively for WoE SE, and are called independently. OnTouch: @@ -1016,7 +1018,7 @@ OnPCLoadMapEvent: This special label will trigger once a player steps in a map marked with the 'loadevent' mapflag and attach its RID. The fact that this label requires a mapflag for it to work is because, otherwise, it'd be server-wide and trigger -everytime a player would change maps. Imagine the server load with 1,000 players +every time a player would change maps. Imagine the server load with 1,000 players (oh the pain...) Only the special labels which are not associated with any script command are @@ -1026,7 +1028,7 @@ manner, but they are described with their associated commands. On