Difference between revisions of "Meta Expressions"
(→Function Information) |
|||
Line 1: | Line 1: | ||
− | These expressions can set and retrieve variables, react to object/char properties, use and | + | These expressions can set and retrieve variables, react to object/char properties, use and |
− | + | combine objects, and more. | |
− | The "/vt mexec [expression]" command can be used instead of the meta rules when appropriate. It is also a great testing tool. | + | This adds the "Expression" meta condition and the "Expression Action" and "Chat Expression" |
+ | |||
+ | meta actions. | ||
+ | |||
+ | The "/vt mexec [expression]" command can be used instead of the meta rules when appropriate. | ||
+ | |||
+ | It is also a great testing tool. | ||
There are two ways to use Expressions, your situation will determine the best choice. | There are two ways to use Expressions, your situation will determine the best choice. | ||
− | The first is through sending the command like any other chat command. Ex: "/vt mexec [expression]". This can be useful if you want to issue the command without using a meta rule, or simply want to test an expression without using meta. | + | The first is through sending the command like any other chat command. Ex: "/vt mexec |
+ | |||
+ | [expression]". This can be useful if you want to issue the command without using a meta rule, | ||
+ | |||
+ | or simply want to test an expression without using meta. | ||
+ | |||
+ | The second is by utilizing the "Expression" meta condition and the "Expression Action" and | ||
− | + | "Chat Expression" meta actions. | |
− | The "Expression" meta condition is like any other meta condition, if the parameters are met then it will initiate the action. You can use this to detect world objects, character properties, react to custom variables and more. | + | The "Expression" meta condition is like any other meta condition, if the parameters are met |
+ | |||
+ | then it will initiate the action. You can use this to detect world objects, character | ||
+ | |||
+ | properties, react to custom variables and more. | ||
The "Expression Action" meta action initiates the expression written within. | The "Expression Action" meta action initiates the expression written within. | ||
− | The "Expression Chat" meta action is used to output expression strings to chat. You can use regex and meta functions to format an expression. When outputting numbers from a variable you must first convert it to a string. | + | The "Expression Chat" meta action is used to output expression strings to chat. You can use |
+ | |||
+ | regex and meta functions to format an expression. When outputting numbers from a variable you | ||
+ | |||
+ | must first convert it to a string. | ||
== Notes == | == Notes == | ||
* true is the same as 1, false is the same as 0. There are no actual booleans, just numbers. | * true is the same as 1, false is the same as 0. There are no actual booleans, just numbers. | ||
− | * There are two extra operators added since [[Virindi Tank Monster List Matching|monster expressions]]: the ^ (xor) operator, and the ; operator. The ; operator works on any two types and simply returns the value of the first one. It has the lowest possible precedence. The idea is to use it to string together commands when you don't care about the result. | + | * There are two extra operators added since [[Virindi Tank Monster List Matching|monster |
+ | |||
+ | expressions]]: the ^ (xor) operator, and the ; operator. The ; operator works on any two types | ||
+ | |||
+ | and simply returns the value of the first one. It has the lowest possible precedence. The idea | ||
+ | |||
+ | is to use it to string together commands when you don't care about the result. | ||
* Unlike monster expressions, meta expressions do not trim spaces from the ends of strings. | * Unlike monster expressions, meta expressions do not trim spaces from the ends of strings. | ||
* Set variables persist until cleared by a command or until relog. | * Set variables persist until cleared by a command or until relog. | ||
− | * Formatting during the conversion of number to string is a string like this: http://msdn.microsoft.com/en-us/library/kfsatb94%28v=vs.110%29.aspx | + | * Formatting during the conversion of number to string is a string like this: |
+ | |||
+ | http://msdn.microsoft.com/en-us/library/kfsatb94%28v=vs.110%29.aspx | ||
* All operator characters which occur in a string must be escaped with \ | * All operator characters which occur in a string must be escaped with \ | ||
* All numbers in a string must also be escaped. | * All numbers in a string must also be escaped. | ||
Line 33: | Line 61: | ||
The following operators are recognized (listed in order of precedence): | The following operators are recognized (listed in order of precedence): | ||
− | * \ escapes a special character so that it is treated as part of a string. For instance, ".\*" yields the string ".*" rather than attempting to multiply. | + | * \ escapes a special character so that it is treated as part of a string. For instance, ".\*" |
+ | |||
+ | yields the string ".*" rather than attempting to multiply. | ||
* ( and ) allow grouping of expressions to change precedence. | * ( and ) allow grouping of expressions to change precedence. | ||
− | * % performs integer [http://en.wikipedia.org/wiki/Modulo_operation modulo division]. For instance, 13%3 yields 1. | + | * % performs integer [http://en.wikipedia.org/wiki/Modulo_operation modulo division]. For |
+ | |||
+ | instance, 13%3 yields 1. | ||
* / performs division. | * / performs division. | ||
* * performs multiplication. | * * performs multiplication. | ||
* + performs addition on numbers, or concatenates two strings. | * + performs addition on numbers, or concatenates two strings. | ||
* - performs subtraction. | * - performs subtraction. | ||
− | * # performs a regex match, yielding true if the match succeeded or false otherwise. The item after the # is the regex and the one before it is the string to match against. For instance, abc#b returns true, because 'abc' contains b. | + | * # performs a regex match, yielding true if the match succeeded or false otherwise. The item |
− | * !=, ==, >, <, >=, <= comparison operators: compares two expressions and yields true or false. The two expressions to be compared must be of the same type. String comparisons are not case sensitive. | + | |
+ | after the # is the regex and the one before it is the string to match against. For instance, | ||
+ | |||
+ | abc#b returns true, because 'abc' contains b. | ||
+ | * !=, ==, >, <, >=, <= comparison operators: compares two expressions and yields true or | ||
+ | |||
+ | false. The two expressions to be compared must be of the same type. String comparisons are not | ||
+ | |||
+ | case sensitive. | ||
* && yields true if two boolean expressions are both true. | * && yields true if two boolean expressions are both true. | ||
* || yields true if either of two boolean expressions are true. | * || yields true if either of two boolean expressions are true. | ||
− | * ^ performs a bitwise [https://en.wikipedia.org/wiki/Exclusive_or exclusive or] on two numbers, treating them as integers. | + | * ^ performs a bitwise [https://en.wikipedia.org/wiki/Exclusive_or exclusive or] on two |
+ | |||
+ | numbers, treating them as integers. | ||
== Language Details: Strings == | == Language Details: Strings == | ||
− | Strings in an expression are a continuous series of letters, spaces, and escaped characters. Anything other than a letter or a space should be escaped by adding a \ in front of it. | + | Strings in an expression are a continuous series of letters, spaces, and escaped characters. |
+ | |||
+ | Anything other than a letter or a space should be escaped by adding a \ in front of it. | ||
Examples: | Examples: | ||
Line 66: | Line 110: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''testvar[1]''' | '''testvar[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Tests if a meta variable is defined. Returns true if it is, or false otherwise. | + | <div class="mw-collapsible-content">'''Description''': Tests if a meta variable is defined. |
+ | |||
+ | Returns true if it is, or false otherwise. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 77: | Line 123: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getvar[1]''' | '''getvar[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the value of a meta variable, or false if it is not defined. | + | <div class="mw-collapsible-content">'''Description''': Returns the value of a meta variable, |
+ | |||
+ | or false if it is not defined. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 103: | Line 151: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''touchvar[1]''' | '''touchvar[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Sets the value of a meta variable to false if the variable was previously undefined. Returns true if the variable was previously defined, or false otherwise. | + | <div class="mw-collapsible-content">'''Description''': Sets the value of a meta variable to |
+ | |||
+ | false if the variable was previously undefined. Returns true if the variable was previously | ||
+ | |||
+ | defined, or false otherwise. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 121: | Line 173: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''clearvar[1]''' | '''clearvar[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Undefines a single meta variable. Returns true if the variable was previously defined, otherwise false. | + | <div class="mw-collapsible-content">'''Description''': Undefines a single meta variable. |
+ | |||
+ | Returns true if the variable was previously defined, otherwise false. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 132: | Line 186: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharintprop[1]''' | '''getcharintprop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a character intvalue property, or false if the property is not defined. | + | <div class="mw-collapsible-content">'''Description''': Returns a character intvalue property, |
+ | |||
+ | or false if the property is not defined. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 141: | Line 197: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getchardoubleprop[1]''' | '''getchardoubleprop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a character doublevalue property, or false if the property is not defined. | + | <div class="mw-collapsible-content">'''Description''': Returns a character doublevalue |
+ | |||
+ | property, or false if the property is not defined. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 150: | Line 208: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharquadprop[1]''' | '''getcharquadprop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a character quadvalue property, or false if the property is not defined. Because expression variables are doubles, precision will be lost if the value is greater than 2^53-1 (~9 quadrillion) | + | <div class="mw-collapsible-content">'''Description''': Returns a character quadvalue property, |
+ | |||
+ | or false if the property is not defined. Because expression variables are doubles, precision | ||
+ | |||
+ | will be lost if the value is greater than 2^53-1 (~9 quadrillion) | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 159: | Line 221: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharboolprop[1]''' | '''getcharboolprop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a character boolvalue property, or false if the property is not defined. | + | <div class="mw-collapsible-content">'''Description''': Returns a character boolvalue property, |
+ | |||
+ | or false if the property is not defined. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 168: | Line 232: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharstringprop[1]''' | '''getcharstringprop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a character stringvalue property, or false if the property is not defined. | + | <div class="mw-collapsible-content">'''Description''': Returns a character stringvalue |
+ | |||
+ | property, or false if the property is not defined. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 177: | Line 243: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getisspellknown[1]''' | '''getisspellknown[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns true if a given spell id is learned, or false otherwise. | + | <div class="mw-collapsible-content">'''Description''': Returns true if a given spell id is |
+ | |||
+ | learned, or false otherwise. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 186: | Line 254: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcancastspell_hunt[1]''' | '''getcancastspell_hunt[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Queries if a spell can be cast using the current VTank settings. This examines scarab count, buffed skill, and presence in the spellbook. Skill is checked against SpellDiffExcessThreshold-Hunt. | + | <div class="mw-collapsible-content">'''Description''': Queries if a spell can be cast using |
+ | |||
+ | the current VTank settings. This examines scarab count, buffed skill, and presence in the | ||
+ | |||
+ | spellbook. Skill is checked against SpellDiffExcessThreshold-Hunt. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 195: | Line 267: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcancastspell_buff[1]''' | '''getcancastspell_buff[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Queries if a spell can be cast using the current VTank settings. This examines scarab count, buffed skill, and presence in the spellbook. Skill is checked against SpellDiffExcessThreshold-Buff. | + | <div class="mw-collapsible-content">'''Description''': Queries if a spell can be cast using |
+ | |||
+ | the current VTank settings. This examines scarab count, buffed skill, and presence in the | ||
+ | |||
+ | spellbook. Skill is checked against SpellDiffExcessThreshold-Buff. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 204: | Line 280: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharvital_base[1]''' | '''getcharvital_base[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the base value of the character's health, stamina, or mana. | + | <div class="mw-collapsible-content">'''Description''': Get the base value of the character's |
+ | |||
+ | health, stamina, or mana. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 213: | Line 291: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharvital_current[1]''' | '''getcharvital_current[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the current value of the character's health, stamina, or mana. | + | <div class="mw-collapsible-content">'''Description''': Get the current value of the |
+ | |||
+ | character's health, stamina, or mana. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 222: | Line 302: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharvital_buffedmax[1]''' | '''getcharvital_buffedmax[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the buffed maximum value of the character's health, stamina, or mana. | + | <div class="mw-collapsible-content">'''Description''': Get the buffed maximum value of the |
+ | |||
+ | character's health, stamina, or mana. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 231: | Line 313: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharskill_traininglevel[1]''' | '''getcharskill_traininglevel[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the character's current training level for a skill. 0 = Unusable, 1 = Untrained, 2 = Trained, 3 = Specialized. | + | <div class="mw-collapsible-content">'''Description''': Get the character's current training |
+ | |||
+ | level for a skill. 0 = Unusable, 1 = Untrained, 2 = Trained, 3 = Specialized. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 240: | Line 324: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharskill_base[1]''' | '''getcharskill_base[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the character's base ability for a skill. | + | <div class="mw-collapsible-content">'''Description''': Get the character's base ability for a |
+ | |||
+ | skill. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 249: | Line 335: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getcharskill_buffed[1]''' | '''getcharskill_buffed[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Get the character's buffed ability for a skill. | + | <div class="mw-collapsible-content">'''Description''': Get the character's buffed ability for |
+ | |||
+ | a skill. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 258: | Line 346: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getplayerlandcell[0]''' | '''getplayerlandcell[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the landcell the player is currently standing in as a number, including the landblock portion<br> | + | <div class="mw-collapsible-content">'''Description''': Returns the landcell the player is |
+ | |||
+ | currently standing in as a number, including the landblock portion<br> | ||
'''Parameter count''': 0</div> | '''Parameter count''': 0</div> | ||
Line 265: | Line 355: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getplayercoordinates[0]''' | '''getplayercoordinates[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the global 3d coordinates for the player's current location, based on the game physics prediction model. Returns a coordinates object.<br> | + | <div class="mw-collapsible-content">'''Description''': Returns the global 3d coordinates for |
+ | |||
+ | the player's current location, based on the game physics prediction model. Returns a | ||
+ | |||
+ | coordinates object.<br> | ||
'''Parameter count''': 0</div> | '''Parameter count''': 0</div> | ||
Line 272: | Line 366: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinategetns[1]''' | '''coordinategetns[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the north/south portion of a coordinates object as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the north/south portion of a |
+ | |||
+ | coordinates object as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 281: | Line 377: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinategetwe[1]''' | '''coordinategetwe[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the west/east portion of a coordinates object as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the west/east portion of a |
+ | |||
+ | coordinates object as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 290: | Line 388: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinategetz[1]''' | '''coordinategetz[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the z (vertical) portion of a coordinates object as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the z (vertical) portion of a |
+ | |||
+ | coordinates object as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 299: | Line 399: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinatetostring[1]''' | '''coordinatetostring[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the the string representation of a coordinates object. | + | <div class="mw-collapsible-content">'''Description''': Returns the the string representation |
+ | |||
+ | of a coordinates object. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 308: | Line 410: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinateparse[1]''' | '''coordinateparse[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Builds a coordinates object from a string. It should be of the form '00.0N, 00.0W'. Z coordinates are not specified. Returns false in case of parse failure. | + | <div class="mw-collapsible-content">'''Description''': Builds a coordinates object from a |
+ | |||
+ | string. It should be of the form '00.0N, 00.0W'. Z coordinates are not specified. Returns | ||
+ | |||
+ | false in case of parse failure. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 317: | Line 423: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinatedistancewithz[2]''' | '''coordinatedistancewithz[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the 3d distance between two coordinates. The result is a number specified in meters. | + | <div class="mw-collapsible-content">'''Description''': Returns the 3d distance between two |
+ | |||
+ | coordinates. The result is a number specified in meters. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 325: | Line 433: | ||
'''Param 1 (Coordinates)''': The second coordinates object. | '''Param 1 (Coordinates)''': The second coordinates object. | ||
− | '''Example''': [http://www.immortalbob.com/phpBB3/viewtopic.php?f=24&t=120 Landscape Item Pickup Tutorial] </div> | + | '''Example''': [http://www.immortalbob.com/phpBB3/viewtopic.php?f=24&t=120 Landscape Item |
+ | |||
+ | Pickup Tutorial] </div> | ||
</div> | </div> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''coordinatedistanceflat[2]''' | '''coordinatedistanceflat[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the 2d distance between two coordinates. The result is a number specified in meters. Z coordinates are ignored. | + | <div class="mw-collapsible-content">'''Description''': Returns the 2d distance between two |
+ | |||
+ | coordinates. The result is a number specified in meters. Z coordinates are ignored. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 341: | Line 453: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgetphysicscoordinates[1]''' | '''wobjectgetphysicscoordinates[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Queries the game's physics prediction model for the coordinates of a given object. Returns a coordinates object. | + | <div class="mw-collapsible-content">'''Description''': Queries the game's physics prediction |
+ | |||
+ | model for the coordinates of a given object. Returns a coordinates object. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 350: | Line 464: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgetname[1]''' | '''wobjectgetname[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the name string for a given world object. | + | <div class="mw-collapsible-content">'''Description''': Returns the name string for a given |
+ | |||
+ | world object. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 359: | Line 475: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgetobjectclass[1]''' | '''wobjectgetobjectclass[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the objectclass for a given world object, as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the objectclass for a given |
+ | |||
+ | world object, as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 368: | Line 486: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgettemplatetype[1]''' | '''wobjectgettemplatetype[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the game template type for a given world object, as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the game template type for a |
+ | |||
+ | given world object, as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 377: | Line 497: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgetisdooropen[1]''' | '''wobjectgetisdooropen[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the a boolean indicating if a door object is open. | + | <div class="mw-collapsible-content">'''Description''': Returns the a boolean indicating if a |
+ | |||
+ | door object is open. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 386: | Line 508: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindnearestmonster[0]''' | '''wobjectfindnearestmonster[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest monster, or false if no monsters are visible. Ignores blacklisted monsters.<br> | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest |
+ | |||
+ | monster, or false if no monsters are visible. Ignores blacklisted monsters.<br> | ||
'''Parameter count''': 0</div> | '''Parameter count''': 0</div> | ||
Line 393: | Line 517: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindnearestdoor[0]''' | '''wobjectfindnearestdoor[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest door, or false if no doors are visible.<br> | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest |
+ | |||
+ | door, or false if no doors are visible.<br> | ||
'''Parameter count''': 0 | '''Parameter count''': 0 | ||
Line 402: | Line 528: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindnearestbyobjectclass[1]''' | '''wobjectfindnearestbyobjectclass[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest object of a given class number, or false if no matching objects are visible. | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest |
+ | |||
+ | object of a given class number, or false if no matching objects are visible. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 408: | Line 536: | ||
'''Param 0 (Number)''': The objectclass number to look for. | '''Param 0 (Number)''': The objectclass number to look for. | ||
− | '''Notes''': As of Virindi Tank 0.3.1.172 this function no longer returns the current player. It will return the nearest player to you.</div> | + | '''Notes''': As of Virindi Tank 0.3.1.172 this function no longer returns the current player. |
+ | |||
+ | It will return the nearest player to you.</div> | ||
</div> | </div> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindininventorybytemplatetype[1]''' | '''wobjectfindininventorybytemplatetype[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first inventory object of a given template type number, or false if no matching objects are visible. | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first |
+ | |||
+ | inventory object of a given template type number, or false if no matching objects are visible. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 424: | Line 556: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindininventorybyname[1]''' | '''wobjectfindininventorybyname[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first inventory object of a given name, or false if no matching objects are visible. | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first |
+ | |||
+ | inventory object of a given name, or false if no matching objects are visible. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 433: | Line 567: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindininventorybynamerx[1]''' | '''wobjectfindininventorybynamerx[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first inventory object of a given name regex, or false if no matching objects are visible. | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the first |
+ | |||
+ | inventory object of a given name regex, or false if no matching objects are visible. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 442: | Line 578: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectgetselection[0]''' | '''wobjectgetselection[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the selected object, or false if nothing is selected.<br> | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the selected |
+ | |||
+ | object, or false if nothing is selected.<br> | ||
'''Parameter count''': 0</div> | '''Parameter count''': 0</div> | ||
Line 456: | Line 594: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''wobjectfindnearestbynameandobjectclass[2]''' | '''wobjectfindnearestbynameandobjectclass[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest object whose name matches a given regular expression and whose objectclass is a particular value. | + | <div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest |
+ | |||
+ | object whose name matches a given regular expression and whose objectclass is a particular | ||
+ | |||
+ | value. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 478: | Line 620: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontryuseitem[1]''' | '''actiontryuseitem[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to use a world object by itself (like a potion or door). | + | <div class="mw-collapsible-content">'''Description''': Attempts to use a world object by |
+ | |||
+ | itself (like a potion or door). | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 487: | Line 631: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontryapplyitem[2]''' | '''actiontryapplyitem[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to use a world object on another world object. Returns false if failed and true if the attempt could possibly succeed. | + | <div class="mw-collapsible-content">'''Description''': Attempts to use a world object on |
+ | |||
+ | another world object. Returns false if failed and true if the attempt could possibly succeed. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 498: | Line 644: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontrygiveitem[2]''' | '''actiontrygiveitem[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to hand an item to a player or NPC. Returns false if failed and true if the attempt could possibly succeed. | + | <div class="mw-collapsible-content">'''Description''': Attempts to hand an item to a player |
+ | |||
+ | or NPC. Returns false if failed and true if the attempt could possibly succeed. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 509: | Line 657: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontryequipanywand[0]''' | '''actiontryequipanywand[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to take one step towards equipping any wand from the current profile's items list. Returns true if a wand is already equipped, otherwise false.<br> | + | <div class="mw-collapsible-content">'''Description''': Attempts to take one step towards |
+ | |||
+ | equipping any wand from the current profile's items list. Returns true if a wand is already | ||
+ | |||
+ | equipped, otherwise false.<br> | ||
'''Parameter count''': 0</div> | '''Parameter count''': 0</div> | ||
</div> | </div> | ||
Line 515: | Line 667: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontrycastbyid[1]''' | '''actiontrycastbyid[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to cast a particular spell without a target (like a self spell). Checks the spell requirements as if it were a 'hunting' spell. If the character is not in magic mode, one step is taken towards equipping any wand. Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible. | + | <div class="mw-collapsible-content">'''Description''': Attempts to cast a particular spell |
+ | |||
+ | without a target (like a self spell). Checks the spell requirements as if it were a 'hunting' | ||
+ | |||
+ | spell. If the character is not in magic mode, one step is taken towards equipping any wand. | ||
+ | |||
+ | Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the | ||
+ | |||
+ | attempt is impossible. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 524: | Line 684: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''actiontrycastbyidontarget[2]''' | '''actiontrycastbyidontarget[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Attempts to cast a particular spell on a target WorldObject. Checks the spell requirements as if it were a 'hunting' spell. If the character is not in magic mode, one step is taken towards equipping any wand. Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible. | + | <div class="mw-collapsible-content">'''Description''': Attempts to cast a particular spell on |
+ | |||
+ | a target WorldObject. Checks the spell requirements as if it were a 'hunting' spell. If the | ||
+ | |||
+ | character is not in magic mode, one step is taken towards equipping any wand. Returns 1 if the | ||
+ | |||
+ | attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 531: | Line 697: | ||
'''Param 1 (WorldObject)''': The object to target with the spell.</div> | '''Param 1 (WorldObject)''': The object to target with the spell.</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''chatbox[1]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Sends a string to the chatbox. | ||
+ | |||
+ | '''Parameter count''': 1 | ||
+ | |||
+ | '''Param 0 (String)''': The string to send.</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''chatboxpaste[1]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Pastes a partial string to the chatbox | ||
+ | |||
+ | so that the user can complete typing it. Returns true if succeeded. | ||
+ | |||
+ | '''Parameter count''': 1 | ||
+ | |||
+ | '''Param 0 (String)''': The string to send.</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''statushud[2]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Updates an entry in the Virindi HUDs | ||
+ | |||
+ | Status HUD. | ||
+ | |||
+ | '''Parameter count''': 2 | ||
+ | |||
+ | '''Param 0 (String)''': The key | ||
+ | |||
+ | '''Param 1 (String)''': The value</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''statushudcolored[2]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Updates an entry in the Virindi HUDs | ||
+ | |||
+ | Status HUD. | ||
+ | |||
+ | '''Parameter count''': 3 | ||
+ | |||
+ | '''Param 0 (String)''': The key | ||
+ | |||
+ | '''Param 1 (String)''': The value | ||
+ | |||
+ | '''Param 2 (String)''': The color, in RGB number format. For example, pure red is 16711680 | ||
+ | |||
+ | (0xFF0000).</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''uigetcontrol[2]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Gets a control reference for a control | ||
+ | |||
+ | in a Meta View. | ||
+ | |||
+ | '''Parameter count''': 2 | ||
+ | |||
+ | '''Param 0 (String)''': The window name. | ||
+ | |||
+ | '''Param 1 (String)''': The control name.</div> | ||
+ | </div> | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
+ | '''uisetlabel[2]''' | ||
+ | <div class="mw-collapsible-content">'''Description''': Sets the text label of a Meta View | ||
+ | |||
+ | control. Works on Buttons. | ||
+ | |||
+ | '''Parameter count''': 2 | ||
+ | |||
+ | '''Param 0 (ViewControl)''': The control object. | ||
+ | |||
+ | '''Param 1 (String)''': The label text.</div> | ||
</div> | </div> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''isfalse[1]''' | '''isfalse[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Takes any type and returns true if and only if it is a number with value 0 (false). Returns false otherwise. | + | <div class="mw-collapsible-content">'''Description''': Takes any type and returns true if and |
+ | |||
+ | only if it is a number with value 0 (false). Returns false otherwise. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 544: | Line 788: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''istrue[1]''' | '''istrue[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Takes any type and returns true if and only if it is a number with a value other than 0 (true). Returns false otherwise. | + | <div class="mw-collapsible-content">'''Description''': Takes any type and returns true if and |
+ | |||
+ | only if it is a number with a value other than 0 (true). Returns false otherwise. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 553: | Line 799: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''iif[3]''' | '''iif[3]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Examines the first parameter. If it is true, the second parameter is returned. Otherwise, the third parameter is returned. (If the first parameter is not a number, the third parameter is returned.) | + | <div class="mw-collapsible-content">'''Description''': Examines the first parameter. If it is |
+ | |||
+ | true, the second parameter is returned. Otherwise, the third parameter is returned. (If the | ||
+ | |||
+ | first parameter is not a number, the third parameter is returned.) | ||
'''Parameter count''': 3 | '''Parameter count''': 3 | ||
Line 566: | Line 816: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''randint[2]''' | '''randint[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns a random integer between min and (max - 1) | + | <div class="mw-collapsible-content">'''Description''': Returns a random integer between min |
+ | |||
+ | and (max - 1) | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 592: | Line 844: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''strlen[1]''' | '''strlen[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the number of characters in a string, as a number. | + | <div class="mw-collapsible-content">'''Description''': Returns the number of characters in a |
+ | |||
+ | string, as a number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 601: | Line 855: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''getobjectinternaltype[1]''' | '''getobjectinternaltype[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Returns the internal typeid for a given object as a number. Values are: 0=none, 1=number, 3=string, 7=object. | + | <div class="mw-collapsible-content">'''Description''': Returns the internal typeid for a given |
+ | |||
+ | object as a number. Values are: 0=none, 1=number, 3=string, 7=object. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 610: | Line 866: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''cstrf[2]''' | '''cstrf[2]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Converts a number to a string using a specified format. | + | <div class="mw-collapsible-content">'''Description''': Converts a number to a string using a |
+ | |||
+ | specified format. | ||
'''Parameter count''': 2 | '''Parameter count''': 2 | ||
Line 616: | Line 874: | ||
'''Param 0 (Number)''': The number to convert | '''Param 0 (Number)''': The number to convert | ||
− | '''Param 1 (String)''': The format string to use. See: http://msdn.microsoft.com/en-us/library/kfsatb94.aspx</div> | + | '''Param 1 (String)''': The format string to use. See: http://msdn.microsoft.com/en- |
+ | |||
+ | us/library/kfsatb94.aspx</div> | ||
</div> | </div> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''stopwatchcreate[0]''' | '''stopwatchcreate[0]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Creates and returns a stopwatch object. Counting is not started.<br> | + | <div class="mw-collapsible-content">'''Description''': Creates and returns a stopwatch object. |
+ | |||
+ | Counting is not started.<br> | ||
'''Parameter count''': 0 | '''Parameter count''': 0 | ||
Line 630: | Line 892: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''stopwatchstart[1]''' | '''stopwatchstart[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Starts counting on a stopwatch. Returns the stopwatch | + | <div class="mw-collapsible-content">'''Description''': Starts counting on a stopwatch. Returns |
+ | |||
+ | the stopwatch | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 639: | Line 903: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''stopwatchstop[1]''' | '''stopwatchstop[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Starts counting on a stopwatch. Returns the stopwatch. | + | <div class="mw-collapsible-content">'''Description''': Starts counting on a stopwatch. Returns |
+ | |||
+ | the stopwatch. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 648: | Line 914: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''stopwatchelapsedseconds[1]''' | '''stopwatchelapsedseconds[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Measures the number of seconds elapsed on a stopwatch. | + | <div class="mw-collapsible-content">'''Description''': Measures the number of seconds elapsed |
+ | |||
+ | on a stopwatch. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 657: | Line 925: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''cnumber[1]''' | '''cnumber[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Converts a string to a number (floating point). Returns 0 if the format is invalid. | + | <div class="mw-collapsible-content">'''Description''': Converts a string to a number (floating |
+ | |||
+ | point). Returns 0 if the format is invalid. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 666: | Line 936: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''floor[1]''' | '''floor[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Determines the largest integer less than or equal to the input value. | + | <div class="mw-collapsible-content">'''Description''': Determines the largest integer less |
+ | |||
+ | than or equal to the input value. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 675: | Line 947: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''ceiling[1]''' | '''ceiling[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Determines the smallest integer greater than or equal to the input value. | + | <div class="mw-collapsible-content">'''Description''': Determines the smallest integer greater |
+ | |||
+ | than or equal to the input value. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 684: | Line 958: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''round[1]''' | '''round[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Rounds a number to the nearest whole integer. | + | <div class="mw-collapsible-content">'''Description''': Rounds a number to the nearest whole |
+ | |||
+ | integer. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 693: | Line 969: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:65%"> | ||
'''abs[1]''' | '''abs[1]''' | ||
− | <div class="mw-collapsible-content">'''Description''': Determines the absolute value of a number. | + | <div class="mw-collapsible-content">'''Description''': Determines the absolute value of a |
+ | |||
+ | number. | ||
'''Parameter count''': 1 | '''Parameter count''': 1 | ||
Line 1,247: | Line 1,525: | ||
'''Test for proximity to any portal:''' | '''Test for proximity to any portal:''' | ||
− | coordinatedistancewithz[wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass[14]],getplayercoordinates[]]<5 | + | coordinatedistancewithz[wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass |
+ | |||
+ | [14]],getplayercoordinates[]]<5 | ||
Line 1,267: | Line 1,547: | ||
'''Combine items in inventory by name:''' | '''Combine items in inventory by name:''' | ||
− | actiontryapplyitem[wobjectfindininventorybyname[itemName], wobjectfindininventorybyname[itemName]] | + | actiontryapplyitem[wobjectfindininventorybyname[itemName], wobjectfindininventorybyname |
+ | |||
+ | [itemName]] | ||
'''Combine items in inventory by template type:''' | '''Combine items in inventory by template type:''' | ||
− | actiontryapplyitem[wobjectfindininventorybytemplatetype[#],wobjectfindininventorybytemplatetype[#]] | + | actiontryapplyitem[wobjectfindininventorybytemplatetype |
+ | |||
+ | [#],wobjectfindininventorybytemplatetype[#]] | ||
+ | |||
+ | Where # is the template type number. Use wobjectgettemplatetype[wobjectgetselection[]] to | ||
− | + | obtain the template type number from an object. | |
Revision as of 13:17, 10 December 2016
These expressions can set and retrieve variables, react to object/char properties, use and
combine objects, and more.
This adds the "Expression" meta condition and the "Expression Action" and "Chat Expression"
meta actions.
The "/vt mexec [expression]" command can be used instead of the meta rules when appropriate.
It is also a great testing tool.
There are two ways to use Expressions, your situation will determine the best choice.
The first is through sending the command like any other chat command. Ex: "/vt mexec
[expression]". This can be useful if you want to issue the command without using a meta rule,
or simply want to test an expression without using meta.
The second is by utilizing the "Expression" meta condition and the "Expression Action" and
"Chat Expression" meta actions.
The "Expression" meta condition is like any other meta condition, if the parameters are met
then it will initiate the action. You can use this to detect world objects, character
properties, react to custom variables and more.
The "Expression Action" meta action initiates the expression written within.
The "Expression Chat" meta action is used to output expression strings to chat. You can use
regex and meta functions to format an expression. When outputting numbers from a variable you
must first convert it to a string.
Contents
Notes
- true is the same as 1, false is the same as 0. There are no actual booleans, just numbers.
- There are two extra operators added since monster expressions: the ^ (xor) operator, and the ; operator. The ; operator works on any two types
and simply returns the value of the first one. It has the lowest possible precedence. The idea
is to use it to string together commands when you don't care about the result.
- Unlike monster expressions, meta expressions do not trim spaces from the ends of strings.
- Set variables persist until cleared by a command or until relog.
- Formatting during the conversion of number to string is a string like this:
http://msdn.microsoft.com/en-us/library/kfsatb94%28v=vs.110%29.aspx
- All operator characters which occur in a string must be escaped with \
- All numbers in a string must also be escaped.
Language Details: Operators
The following operators are recognized (listed in order of precedence):
- \ escapes a special character so that it is treated as part of a string. For instance, ".\*"
yields the string ".*" rather than attempting to multiply.
- ( and ) allow grouping of expressions to change precedence.
- % performs integer modulo division. For
instance, 13%3 yields 1.
- / performs division.
- * performs multiplication.
- + performs addition on numbers, or concatenates two strings.
- - performs subtraction.
- # performs a regex match, yielding true if the match succeeded or false otherwise. The item
after the # is the regex and the one before it is the string to match against. For instance,
abc#b returns true, because 'abc' contains b.
- !=, ==, >, <, >=, <= comparison operators: compares two expressions and yields true or
false. The two expressions to be compared must be of the same type. String comparisons are not
case sensitive.
- && yields true if two boolean expressions are both true.
- || yields true if either of two boolean expressions are true.
- ^ performs a bitwise exclusive or on two
numbers, treating them as integers.
Language Details: Strings
Strings in an expression are a continuous series of letters, spaces, and escaped characters.
Anything other than a letter or a space should be escaped by adding a \ in front of it.
Examples:
- Desired string: "hello world" Expression string: "hello world"
- Desired string: "a-b" Expression string: "a\-b"
- Desired string: "a! b-~! c123'." Expression string: "a\! b\-\~\! c\1\2\3\'\."
Function Information
Expand to view details and available examples.
There are currently 67 meta functions.
See the Virindi Tank Changelog for the most recent additions.
testvar[1]
Returns true if it is, or false otherwise.
Parameter count: 1
Param 0 (String): The variable name to test
Example: testvar[exampleVar]getvar[1]
or false if it is not defined.
Parameter count: 1
Param 0 (String): The variable name to get
Example: getvar[exampleVar]setvar[2]
Parameter count: 2
Param 0 (String): The variable name to set
Example: variables can be strings or integers
setvar[exampleVar, variable]
setvar[exampleVar, 1]touchvar[1]
false if the variable was previously undefined. Returns true if the variable was previously
defined, or false otherwise.
Parameter count: 1
Param 0 (String): The variable name to touch
Example: touchvar[exampleVar]clearallvars[]
Parameter count: 0
clearvar[1]
Returns true if the variable was previously defined, otherwise false.
Parameter count: 1
Param 0 (String): The variable name to clear
Example: clearvar[exampleVar]getcharintprop[1]
or false if the property is not defined.
Parameter count: 1
Param 0 (Number): IntValueKey property id.getchardoubleprop[1]
property, or false if the property is not defined.
Parameter count: 1
Param 0 (Number): DoubleValueKey property id.getcharquadprop[1]
or false if the property is not defined. Because expression variables are doubles, precision
will be lost if the value is greater than 2^53-1 (~9 quadrillion)
Parameter count: 1
Param 0 (Number): QuadValueKey property idgetcharboolprop[1]
or false if the property is not defined.
Parameter count: 1
Param 0 (Number): BoolValueKey property idgetcharstringprop[1]
property, or false if the property is not defined.
Parameter count: 1
Param 0 (Number): StringValueKey property id.getisspellknown[1]
learned, or false otherwise.
Parameter count: 1
Param 0 (Number):The SpellId to querygetcancastspell_hunt[1]
the current VTank settings. This examines scarab count, buffed skill, and presence in the
spellbook. Skill is checked against SpellDiffExcessThreshold-Hunt.
Parameter count: 1
Param 0 (Number):The SpellId to querygetcancastspell_buff[1]
the current VTank settings. This examines scarab count, buffed skill, and presence in the
spellbook. Skill is checked against SpellDiffExcessThreshold-Buff.
Parameter count: 1
Param 0 (Number):The SpellId to querygetcharvital_base[1]
health, stamina, or mana.
Parameter count: 1
Param 0 (Number): Which vital to examine. 1 = Health, 2 = Stamina, 3 = Mana.getcharvital_current[1]
character's health, stamina, or mana.
Parameter count: 1
Param 0 (Number): Which vital to examine. 1 = Health, 2 = Stamina, 3 = Mana.getcharvital_buffedmax[1]
character's health, stamina, or mana.
Parameter count: 1
Param 0 (Number): Which vital to examine. 1 = Health, 2 = Stamina, 3 = Mana.getcharskill_traininglevel[1]
level for a skill. 0 = Unusable, 1 = Untrained, 2 = Trained, 3 = Specialized.
Parameter count: 1
Param 0 (Number): Which skillid to examine.getcharskill_base[1]
skill.
Parameter count: 1
Param 0 (Number): Which skillid to examine.getcharskill_buffed[1]
a skill.
Parameter count: 1
Param 0 (Number): Which skillid to examine.getplayerlandcell[0]
currently standing in as a number, including the landblock portion
getplayercoordinates[0]
the player's current location, based on the game physics prediction model. Returns a
coordinates object.
coordinategetns[1]
coordinates object as a number.
Parameter count: 1
Param 0 (Coordinates): The coordinates object.coordinategetwe[1]
coordinates object as a number.
Parameter count: 1
Param 0 (Coordinates): The coordinates object.coordinategetz[1]
coordinates object as a number.
Parameter count: 1
Param 0 (Coordinates): The coordinates object.coordinatetostring[1]
of a coordinates object.
Parameter count: 1
Param 0 (Coordinates): The coordinates object.coordinateparse[1]
string. It should be of the form '00.0N, 00.0W'. Z coordinates are not specified. Returns
false in case of parse failure.
Parameter count: 1
Param 0 (String): The coordinates string.coordinatedistancewithz[2]
coordinates. The result is a number specified in meters.
Parameter count: 2
Param 0 (Coordinates): The first coordinates object.
Param 1 (Coordinates): The second coordinates object.
Example: [http://www.immortalbob.com/phpBB3/viewtopic.php?f=24&t=120 Landscape Item
Pickup Tutorial]coordinatedistanceflat[2]
coordinates. The result is a number specified in meters. Z coordinates are ignored.
Parameter count: 2
Param 0 (Coordinates): The first coordinates object.
Param 1 (Coordinates): The second coordinates object.wobjectgetphysicscoordinates[1]
model for the coordinates of a given object. Returns a coordinates object.
Parameter count: 1
Param 0 (WorldObject): The world object to examine.wobjectgetname[1]
world object.
Parameter count: 1
Param 0 (WorldObject): The world object to examine.wobjectgetobjectclass[1]
world object, as a number.
Parameter count: 1
Param 0 (WorldObject): The world object to examine.wobjectgettemplatetype[1]
given world object, as a number.
Parameter count: 1
Param 0 (WorldObject): The world object to examine.wobjectgetisdooropen[1]
door object is open.
Parameter count: 1
Param 0 (WorldObject): The door world object to examine.wobjectfindnearestmonster[0]
monster, or false if no monsters are visible. Ignores blacklisted monsters.
wobjectfindnearestdoor[0]
door, or false if no doors are visible.
Parameter count: 0
Example: http://www.virindi.net/junk/door.jpgwobjectfindnearestbyobjectclass[1]
object of a given class number, or false if no matching objects are visible.
Parameter count: 1
Param 0 (Number): The objectclass number to look for.
Notes: As of Virindi Tank 0.3.1.172 this function no longer returns the current player.
It will return the nearest player to you.wobjectfindininventorybytemplatetype[1]
inventory object of a given template type number, or false if no matching objects are visible.
Parameter count: 1
Param 0 (Number): The template type number to look for.
Example: http://www.virindi.net/junk/expr-usingtemplates.jpgwobjectfindininventorybyname[1]
inventory object of a given name, or false if no matching objects are visible.
Parameter count: 1
Param 0 (String): The item name to look for.wobjectfindininventorybynamerx[1]
inventory object of a given name regex, or false if no matching objects are visible.
Parameter count: 1
Param 0 (String): The item name to look for. This parameter is a regex.wobjectgetselection[0]
object, or false if nothing is selected.
wobjectgetplayer[0]
wobjectfindnearestbynameandobjectclass[2]
object whose name matches a given regular expression and whose objectclass is a particular
value.
Parameter count: 2
Param 0 (Number): The objectclass number to look for.
Param 1 (String): The name of the object to search for. This parameter is a regex.
actiontryselect[1]
Parameter count: 1
Param 0 (WorldObject): The world object to attempt to select.
Example: http://www.virindi.net/junk/select.jpgactiontryuseitem[1]
itself (like a potion or door).
Parameter count: 1
Param 0 (WorldObject): The world object to attempt to use.actiontryapplyitem[2]
another world object. Returns false if failed and true if the attempt could possibly succeed.
Parameter count: 2
Param 0 (WorldObject): The world object to use first.
Param 1 (WorldObject): The world object to be used on.actiontrygiveitem[2]
or NPC. Returns false if failed and true if the attempt could possibly succeed.
Parameter count: 2
Param 0 (WorldObject): The world object to give.
Param 1 (WorldObject): The world object to be given to (ie. player or NPC).actiontryequipanywand[0]
equipping any wand from the current profile's items list. Returns true if a wand is already
equipped, otherwise false.
actiontrycastbyid[1]
without a target (like a self spell). Checks the spell requirements as if it were a 'hunting'
spell. If the character is not in magic mode, one step is taken towards equipping any wand.
Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the
attempt is impossible.
Parameter count: 1
Param 0 (Number): The spell ID to cast.actiontrycastbyidontarget[2]
a target WorldObject. Checks the spell requirements as if it were a 'hunting' spell. If the
character is not in magic mode, one step is taken towards equipping any wand. Returns 1 if the
attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible.
Parameter count: 2
Param 0 (Number): The spell ID to cast.
Param 1 (WorldObject): The object to target with the spell.chatbox[1]
Parameter count: 1
Param 0 (String): The string to send.chatboxpaste[1]
so that the user can complete typing it. Returns true if succeeded.
Parameter count: 1
Param 0 (String): The string to send.statushud[2]
Status HUD.
Parameter count: 2
Param 0 (String): The key
Param 1 (String): The valuestatushudcolored[2]
Status HUD.
Parameter count: 3
Param 0 (String): The key
Param 1 (String): The value
Param 2 (String): The color, in RGB number format. For example, pure red is 16711680
(0xFF0000).uigetcontrol[2]
in a Meta View.
Parameter count: 2
Param 0 (String): The window name.
Param 1 (String): The control name.uisetlabel[2]
control. Works on Buttons.
Parameter count: 2
Param 0 (ViewControl): The control object.
Param 1 (String): The label text.isfalse[1]
only if it is a number with value 0 (false). Returns false otherwise.
Parameter count: 1
Param 0 (Any): The object to examineistrue[1]
only if it is a number with a value other than 0 (true). Returns false otherwise.
Parameter count: 1
Param 0 (Any): The object to examineiif[3]
true, the second parameter is returned. Otherwise, the third parameter is returned. (If the
first parameter is not a number, the third parameter is returned.)
Parameter count: 3
Param 0 (Any): The object to examine
Param 1 (Any): What to return if the first parameter is true.
Param 2 (Any): What to return if the first parameter is not truerandint[2]
and (max - 1)
Parameter count: 2
Param 0 (Number): Minimum
Param 1 (Number): Maximum
Example:
Randint[0,2] will return 0 or 1, but never 2.
Randint[5,10] will return 5, 6, 7, 8, or 9, but never 10.cstr[1]
Parameter count: 1
Param 0 (Number): The number to convertstrlen[1]
string, as a number.
Parameter count: 1
Param 0 (String): The string to examinegetobjectinternaltype[1]
object as a number. Values are: 0=none, 1=number, 3=string, 7=object.
Parameter count: 1
Param 0 (Any): The object to examinecstrf[2]
specified format.
Parameter count: 2
Param 0 (Number): The number to convert
Param 1 (String): The format string to use. See: http://msdn.microsoft.com/en-
us/library/kfsatb94.aspxstopwatchcreate[0]
Counting is not started.
Parameter count: 0
Example: http://www.virindi.net/junk/stopwatch.jpgstopwatchstart[1]
the stopwatch
Parameter count: 1
Param 0 (Stopwatch): The stopwatch to startstopwatchstop[1]
the stopwatch.
Parameter count: 1
Param 0 (Stopwatch): The stopwatch to stopstopwatchelapsedseconds[1]
on a stopwatch.
Parameter count: 1
Param 0 (Stopwatch): The stopwatch to querycnumber[1]
point). Returns 0 if the format is invalid.
Parameter count: 1
Param 0 (String): The string to convertfloor[1]
than or equal to the input value.
Parameter count: 1
Param 0 (Number): The numberceiling[1]
than or equal to the input value.
Parameter count: 1
Param 0 (Number): The numberround[1]
integer.
Parameter count: 1
Param 0 (Number): The numberabs[1]
number.
Parameter count: 1
Param 0 (Number): The numberObject Properties
ObjectClass | |
Unknown | 0 |
MeleeWeapon | 1 |
Armor | 2 |
Clothing | 3 |
Jewelry | 4 |
Monster | 5 |
Food | 6 |
Money | 7 |
Misc | 8 |
MissileWeapon | 9 |
Container | 10 |
Gem | 11 |
SpellComponent | 12 |
Key | 13 |
Portal | 14 |
TradeNote | 15 |
ManaStone | 16 |
Plant | 17 |
BaseCooking | 18 |
BaseAlchemy | 19 |
BaseFletching | 20 |
CraftedCooking | 21 |
CraftedAlchemy | 22 |
CraftedFletching | 23 |
Player | 24 |
Vendor | 25 |
Door | 26 |
Corpse | 27 |
Lifestone | 28 |
HealingKit | 29 |
Lockpick | 30 |
WandStaffOrb | 31 |
Bundle | 32 |
Book | 33 |
Journal | 34 |
Sign | 35 |
Housing | 36 |
Npc | 37 |
Foci | 38 |
Salvage | 39 |
Ust | 40 |
Services | 41 |
Scroll | 42 |
CombatPet | 43 |
NumObjectClasses | 44 |
getcharintprop | |
Species | 2 |
ContainerSlots | 7 |
BurdenUnits | 5 |
TotalValue(pyreal) | 20 |
SkillCreditsAvail | 24 |
Level | 25 |
Rank | 30 |
Deaths | 43 |
DateOfBirth(unix) | 98 |
Gender | 11 |
Age(seconds) | 125 |
XPForVPReduction | 129 |
ChessRank | 181 |
Heritage | 188 |
FishingSkill | 192 |
TitlesEarned | 262 |
SocRibbonCount(CH) | 287 |
SocRibbonCount(WEB) | 288 |
SocRibbonCount(RB) | 289 |
MeleeMastery | 354 |
RangedMastery | 355 |
SummoningMastery | 362 |
Augmentations | |
Reinforcement of the Lugians | 218 |
Bleeargh's Fortitude | 219 |
Oswald's Enchantment | 220 |
Siraluun's Blessing | 221 |
Enduring Calm | 222 |
Steadfast Will | 223 |
Ciandra's Essence | 224 |
Yoshi's Essence | 225 |
Jibril's Essence | 226 |
Celdiseth's Essence | 227 |
Koga's Essence | 228 |
Shadow of the Seventh Mule | 229 |
Might of the Seventh Mule | 230 |
Clutch of the Miser | 231 |
Enduring Enchantment | 232 |
Critical Protection | 233 |
Quick Learner | 234 |
Charmed Smith | 236 |
Innate Renewal | 237 |
Archmage's Endurance | 238 |
Enhancement of the Blade Turner | 240 |
Enhancement of the Arrow Turner | 241 |
Enhancement of the Mace Turner | 242 |
Caustic Enhancement | 243 |
Fiery Enhancement | 244 |
Icy Enhancement | 245 |
Storm's Enhancement | 246 |
Infused Creature Magic | 294 |
Infused Item Magic | 295 |
Infused Life Magic | 296 |
Infused War Magic | 297 |
Eye of the Remorseless | 298 |
Hand of the Remorseless | 299 |
Master of the Steel Circle | 300 |
Master of the Focused Eye | 301 |
Master of the Five Fold Path | 302 |
Frenzy of the Slayer | 309 |
Iron Skin of the Invincible | 310 |
Jack of All Trades | 326 |
Infused Void Magic | 328 |
InfusedVoid | 328 |
Luminance/Ratings | |
AuraValor | 333 |
AuraProtection | 334 |
AuraGlory | 335 |
AuraTemperance | 336 |
AuraAetheria | 338 |
AuraManaFlow | 339 |
AuraManaInfusion | 340 |
AuraPurity | 342 |
AuraCraftsman | 343 |
AuraSpecialization | 344 |
AuraWorld | 365 |
HealBoost Rating(armor/jewelry) | 376 |
Vitality Rating(armor/jewelry) | 379 |
Total DmgRating | 307 |
Total DmgResist | 308 |
Total CritDmg | 314 |
Total CritDmgResist | 316 |
Total DmgResist from Lum (nali + seer) | 334 |
Total CritDmgResist from Lum (nali + seer) | 336 |
getcharquadprop | |
TotalExperience | 1 |
UnassignedExperience | 2 |
LuminancePointsCurrent | 6 |
getcharstringprop | |
Name | 1 |
Title | 5 |
FellowshipName | 10 |
MonarchName | 21 |
Patron | 35 |
DateBorn | 43 |
MonarchyDescription | 47 |
Skill IDs | |
Melee Defense | 6 |
Missile Defense | 7 |
Arcane Lore | 14 |
Magic Defense | 15 |
Mana Conversion | 16 |
Item Tinkering | 18 |
Assess Person | 19 |
Deception | 20 |
Healing | 21 |
Jump | 22 |
Lockpick | 23 |
Run | 24 |
Assess Creature | 27 |
Weapon Tinkering | 28 |
Armor Tinkering | 29 |
Magic Item Tinkering | 30 |
Creature Enchantment | 31 |
Item Enchantment | 32 |
Life Magic | 33 |
War Magic | 34 |
Leadership | 35 |
Loyalty | 36 |
Fletching | 37 |
Alchemy | 38 |
Cooking | 39 |
Salvaging | 40 |
Two-Handed Combat | 41 |
Void | 43 |
Heavy Weapons | 44 |
Light Weapons | 45 |
Finesse Weapons | 46 |
Missile Weapons | 47 |
Summoning | 54 |
Examples
Test for proximity to any portal:
coordinatedistancewithz[wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass
[14]],getplayercoordinates[]]<5
Check if you have any Aged or Durable Legendary Keys in your inventory:
getobjectinternaltype[wobjectfindininventorybynamerx[\^\(Aged\|Durable\) Legendary Key\$]]==7
Check if there is any object currently selected:
getobjectinternaltype[wobjectgetselection[]]==7
Save the selected items name in a variable:
setvar[keyName,wobjectgetname[wobjectgetselection[]]]
Combine items in inventory by name:
actiontryapplyitem[wobjectfindininventorybyname[itemName], wobjectfindininventorybyname
[itemName]]
Combine items in inventory by template type:
actiontryapplyitem[wobjectfindininventorybytemplatetype
[#],wobjectfindininventorybytemplatetype[#]]
Where # is the template type number. Use wobjectgettemplatetype[wobjectgetselection[]] to
obtain the template type number from an object.
Select item in inventory by name:
actiontryselect[wobjectfindininventorybyname[itemName]]
Select Nearest Monster:
actiontryselect[wobjectfindnearestmonster[]]
Select World Object by ObjectClass:
actiontryselect[wobjectfindnearestbyobjectclass[#]] -- Where # is the object class
Select Nearest Vendor:
actiontryselect[wobjectfindnearestbyobjectclass[25]]
Select Nearest NPC:
actiontryselect[wobjectfindnearestbyobjectclass[37]]
Use Nearest Vendor:
actiontryuseitem[wobjectfindnearestbyobjectclass[25]]
Use Nearest NPC:
actiontryuseitem[wobjectfindnearestbyobjectclass[37]]
Use Nearest door:
actiontryuseitem[wobjectfindnearestdoor[]]
Use nearest portal:
actiontryuseitem[wobjectfindnearestbyobjectclass[14]]
Use a Massive Mana Charge on yourself by name:
actiontryapplyitem[wobjectfindininventorybyname[Massive Mana Charge], wobjectgetplayer[]]
Use a Mana Stone on yourself by template type:
actiontryapplyitem[wobjectfindininventorybytemplatetype[9060],wobjectgetplayer[]]
Use inventory item by template type:
actiontryuseitem[wobjectfindininventorybytemplatetype[#]]
Check if your luminance is full (1.5mil):
getcharquadprop[6]==1500000