Summary
UtilityBelt includes functionality to override the built-in expression language runner inside of VTank. This enables new meta expression functions and language features to be added while still running metas inside of VTank.
To enable this functionality, you need to set UtilityBelt optionVTank.PatchExpressionEngine
to true
, you can do that with /ub opt set VTank.PatchExpressionEngine true
.
Once enabled, UtilityBelt will handle all meta conditions of type Chat Message Capture
and Expression
, meta actions of type Expression Action
and Chat Expression
, as well as meta view button expressions.
UtilityBelt is completely backwards compatible with VTank meta expressions, so any existing expressions should just work. Keeping that in mind, you can view documentation for VTank’s meta expressions here.
Language Overview
The expression language offers functionality to control and read game client state, as well as some basic logic operations. There is support for a number of data types, as well as operators and functions to use on those types.
Data Types
- Number - Numbers are stored internally as doubles. They have a precision of 15-16 digits and can store a range from +-5.0 x 10-324 to +-1.7 x 10308
- Numbers can also be defined in hexadecimal format, ie
0xff
- Numbers can also be defined in hexadecimal format, ie
- String - A string of characters, can be any length.
- Strings containing anything other than letters and spaces need to be escaped with backslashes escaping individual characters, or backticks surrounding the entire string. Examples:
123 test
should be escaped as\1\2\3 test
or`123 test`
some example string
does not need escapingp@cMan$)
should be escaped asp\@cMan\$\)
or`p@cMan$`
- Strings support slices like arrays. ie
test[1:]
- Strings containing anything other than letters and spaces need to be escaped with backslashes escaping individual characters, or backticks surrounding the entire string. Examples:
- List - A set of items. Items can be of any type.
- Lists support indice access with $list{indice}, slices are supported as well with {start:stop} ie
$list{:-1}
,$list[1:3]
- Lists support indice access with $list{indice}, slices are supported as well with {start:stop} ie
- Dictionary - A set of Key/Value pairs. Keys must be strings but values can be of any type.
- Dictionaries support key access with $dict{key}.
- Coordinates - Represents a set of NS/EW/Z game coordinates.
- WorldObject - Represents a game object (player, item, monster, npc, etc)
- StopWatch - Time based counter, with the ability to stop/start.
Operators
==
Checks if two objects are equal to each other. They must be of the same type.>
Checks if a value is greater than another. This only works with numbers.<
Checks if a value is less than another. This only works with numbers.>=
Checks if a value is greater than or equal to another. This only works with numbers.<=
Checks if a value is less than or equal to another. This only works with numbers./
Divides one value by another. This only works with numbers.*
Multiplies one value by another. This only works with numbers.+
Adds one value to another. This only works with numbers and strings.-
Subtracts one value from another. This only works with numbers.%
Determines the remainder of the division of one value from another. This only works with numbers.#
Evaluates to true if the first value matches the passed regular expression. Example:test#s
checks if the stringtest
matches the regexs
. Regexes used here are case-insensitive when matching. This only works with strings.&&
Evaluates to true if both the expression before and after the operator return true||
Evaluates to true if either the expression before or after the operator returns true~
Produces a bitwise complement of its operand by reversing each bit. This only works with numbers.<<
Shifts its left-hand operand left by the number of bits defined by its right-hand operand. This only works with numbers.>>
Shifts its left-hand operand right by the number of bits defined by its right-hand operand. This only works with numbers.&
Computes the bitwise logical AND of its integral operands. This only works with numbers.^
Computes the bitwise logical exclusive OR, also known as the bitwise logical XOR, of its integral operands. This only works with numbers.|
Computes the bitwise logical OR of its integral operands. This only works with numbers.
Expressions (Functions)
Expression functions, also referred to as just expressions, are used to perform actions or operate on data passed to them. They are all called using the same syntax: expressionname[]
. The square brackets are used to enclose arguments, even when there are no arguments they are required.
Some expressions will require arguments to be passed to them, like echo[hello, 15]
. Passed arguments are separated with the ,
character. The echo
expression expects two arguments to be passed: a string, and a number indicating the color the string will be printed in. In the example above, hello
is the passed string, and 15
is the passed number. This expression echoes the passed string to the chat window in the specified color.
Other expressions may not require arguments and instead of performing an action, return data. For example, the expression wobjectgetplayer[]
will refer to your currect player character. The wobjectgetplayer
expression doesn’t expect any arguments to be passed to it. To indicate this, the brackets should still be present but should have nothing within them.
You can pass the return value of an expression to another expression and chain them together. For example, to get the name of the current player we need to pass the result of one expression to another: wobjectgetname[wobjectgetplayer[]]
. In this example, the wobjectgetname
expression expects to be passed a single argument of type WorldObject. Since the wobjectgetplayer
expression returns a WorldObject
we can pass the result of it to wobjectgetname
.
Variables
Variables are used to store values, and retrieve them at a later time. There are three types of variables:
- Memory - This is the default variable type. These variables only exist while the character is logged in. Once it is logged out, all variables of this type are lost.
- Persistent - These variable types are only accessible by the character who set them, but they are serialized to a database so they can be restored when the client is restarted.
- Global - These variable types can be accessed by any running client, and are stored to the database any time they are modified.
Memory variables are good for quickly storing the value of something to be used later in that same client session. If your meta needs to save state to be accessed even after the client has closed, use a persistent variable. If the variable needs to be accessed and shared with all clients/characters, use a global variable.
You can set a memory variable using the setvar
expression. It expects two arguments, the first being a string of the name to store the variable under, and the second being the value to store. For example setvar[myVariable,123]
would store the number value 123
as a variable named myVariable
. All data types can be stored in a memory variable. To read the value stored in a variable, you use the expression getvar
. It expects one argument: a string of the variable name. For example to retrieve the memory variable we stored above we can use getvar[myVariable]
, this will return the stored number 123
. There is an alternate (shorter) syntax for getting a memory variable, $
. For example to get the same value stored above, you could use the alternate syntax: $myVariable
.
Persistent and global variables have their own methods/syntax for getting and setting. Persistent variables use setpvar
to set, getpvar
to read, and supports the alternate syntax @
for getting variables (@myPersistentVariable
returns the persistent variable named myPersistentVariable
). Global variables use setgvar
to set, getgvar
to read, and supports the alternate syntax &
for getting variables (&myGlobalVariable
returns the global variable named myGlobalVariable
)
Expression Examples
coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[wobjectgetselection[]]]
- Gets the distance from your player to the currently selected object
setvar[myList,createlist[1,2,3]]; listadd[$myList,4]
- Saves a newly created list with the values
1,2,3
as a memory variable calledmyList
. Then adds the value4
to that same list using the$
getvar syntax.
- Saves a newly created list with the values
Notes
- Although there are keywords for true/false, internally they represent number 1/0.
- Methods that return
WorldObject
types will return0
if no matching objects were found. This will throw an error when passing the results to another expression that expects aWorldObject
. It is recommended to use thegetobjectinternaltype
expression to check the resulting type before usage. - The alternative get variable syntax (
$
,@
, and&
) supports expressions where the variable identifier is. For example you can do the following to get a variable namedSunnuj
, assuming that is your current character name:$wobjectgetname[wobjectgetplayer[]]
. It is equivalent to writinggetvar[wobjectgetname[wobjectgetplayer[]]]
.
Expressions
listgetitem
Retrieves the item at the specified list index. Lists are zero based, so the first item in the list is at index 0. If the index does not exist, it throws an error
Parameters:
- Param #0: list (List) - The list to retrieve the item from
- Param #1: index (number) - Index to retrieve from the list. Lists are zero based, so the first item is at index 0
Returns: Object - Returns the item at the specified list index
Examples:
listgetitem[getvar[myList],0]
- Retrieves the first item from the list stored inmyList
variable
listcontains
Checks if the specified item is contained in the list
Parameters:
- Param #0: list (List) - The list to check
- Param #1: item (Object) - The item to check if the list contains
Returns: number - Returns 1 if found, 0 otherwise
Examples:
listcontains[getvar[myList],`some value`]
- Checks if the list stored inmyList
variable contains the stringsome value
listindexof
Finds the index of the first occurance of an item in a list. Indexes are zero based.
Parameters:
- Param #0: list (List) - The list to check
- Param #1: item (Object) - The item to check if the list contains
Returns: number - Returns the index of the first occurence of the specified item, or -1 if not found
Examples:
listindexof[getvar[myList],`some value`]
- Returns the index of the first occurence of the stringsome value
listlastindexof
Finds the index of the last occurance of an item in a list. Indexes are zero based.
Parameters:
- Param #0: list (List) - The list to check
- Param #1: item (Object) - The item to check if the list contains
Returns: number - Returns the index of the last occurence of the specified item, or -1 if not found
Examples:
listlastindexof[getvar[myList],`some value`]
- Returns the index of the last occurence of the stringsome value
listcopy
Creates a copy of a list
Parameters:
- Param #0: list (List) - The list to copy
Returns: List - Returns a copy of the specified list
Examples:
setvar[myListTwo,listcopy[getvar[myList]]
- Copies the list stored in myList variable to a variable called myListTwo
listreverse
Creates a copy of a list, and reverses the order
Parameters:
- Param #0: list (List) - The list to reverse
Returns: List - Returns a copy of the specified list, but the order is reversed
Examples:
setvar[myListReversed,listreverse[getvar[myList]]
- Copies the list stored in myList variable, reverses it, and stores it to a variable called myListReversed
listpop
Removes the value at the specified index of the array and returns the item. If no index is passed, it uses the index of the last item in the array. Indexes are zero based.
Parameters:
- Param #0: list (List) - The list to pop the item from
- Param #1: index (number) (Default: -1) - Optional index to remove, if not provided, uses the index of the last item in the array
Returns: Object - Returns the value removed from the array
Examples:
listpop[getvar[myList]]
- Removes and returns the last item in the list stored in myList variablelistpop[getvar[myList],0]
- Removes and returns the first item in the list stored in myList variable
listcount
Counts the number of items contained in a list
Parameters:
- Param #0: list (List) - The list to count the items in
Returns: number - Returns a count of how many items are contained in the list
Examples:
listcount[getvar[myList]]
- Returns the number of items stored in the list stored inmyList
variable
listclear
Clears all items from the specified list
Parameters:
- Param #0: list (List) - The list to clear
Returns: List - Returns the list
Examples:
listclear[getvar[myList]]
- Removes all items from the list stored in the variablemyList
listfilter
Creates a new list filtered by the specified expression
Parameters:
- Param #0: list (List) - The list to filter
- Param #1: expression (string) - The expression to use for filtering. $0 (getvar[`0`]) will be set to the current iteration count, $1 will be set to the current item. return 1 to include, 0 to exclude
Returns: List - Returns a new filtered list
Examples:
listfilter[wobjectfindallbyobjectclass[24],`wobjectgetintprop[$1,25]==275`]
- creates a new list with all nearby level 275 characters
listmap
Creates a new list mapped by the specified expression
Parameters:
- Param #0: list (List) - The list to map
- Param #1: expression (string) - The expression to use for mapping. $0 (getvar[`0`]) will be set to the current iteration count, $1 will be set to the current item. return the mapped result
Returns: List - Returns a new mapped list
Examples:
listmap[wobjectfindallbyobjectclass[24],`wobjectgetstringprop[$1,5]
- creates a new list with all nearby players titles
listreduce
Reduces a list down into a single value
Parameters:
- Param #0: list (List) - The list to reduce to a single value
- Param #1: expression (string) - The expression to use for reducing. $0 (getvar[`0`]) will be set to the current iteration count, $1 will be set to the current item, $2 will be set to the current reduced value, return the modified result
Returns: List - Returns a list reduced to a single value
Examples:
listreduce[wobjectfindallbyobjectclass[24],`$2+wobjectgetintprop[$1,25]`]
- find the sum of all nearby character levels
listsort
Creates a list from another, sorted by expression
Parameters:
- Param #0: list (List) - The list to sort
- Param #1: expression (string) - The expression to use for sorting. $1 (getvar[`1`]) will be set to item a, $2 will be set item b, return 0 if they are equal, -1 if $1 is less than $2, and 1 if $1 is greater than $2
Returns: List - Returns a new list sorted by expression
Examples:
listsort[wobjectfindallbyobjectclass[24],`setvar[la,wobjectgetintprop[$1,25]];setvar[lb,wobjectgetintprop[$2,25]];iif[$la==$lb,0,iif[$la<$lb,-1,1]]`]
- get a list of all characters sorted by level
listfromrange
Create a list of numbers between start and end inclusively
Parameters:
- Param #0: start (number) - inclusive start
- Param #1: end (number) - inclusive end
Returns: List - Returns a list of numbers between start to end, inclusive
Examples:
listfromrange[1,10]
- returns a list with numbers 1-10
dictcreate
Creates a new dictionary object. The dictionary is empty by default. The list of arguments must be even and broken in key-value pairs. Keys must be strings. Values may be any type.
Parameters:
- Param #0: items (…items) - items to instantiate the dictionary with. alternates keys and values
Returns: Dictionary - Creates and returns a new dictionary
Examples:
dictcreate[]
- Returns a new empty dictionarydictcreate[a,2,b,listcreate[4,5]]
- Returns a new dictionary with 2 items: a=>2,b=>[4,5]setvar[myDict,dictcreate[]]
- Creates a new empty dictionary and stores it inmyDict
variable
dictgetitem
Retrieves the item at the specified dictionary key. If the key does not exist, it throws an error
Parameters:
- Param #0: dict (Dictionary) - The dict to retrieve the item from
- Param #1: key (string) - Key to retrieve from the dict.
Returns: Object - Returns the item for the specified key
Examples:
dictgetitem[getvar[myDict],foo]
- Retrieves the item stored inmyDict
for the keyfoo
dictadditem
Adds the Key Value pair to the dictionary. Returns true if it overwrote a key, false otherwise. Will throw an exception if the key is not a string
Parameters:
- Param #0: dict (Dictionary) - The dict to add key item pair to
- Param #1: key (string) - Key to add to the dict
- Param #2: value (Object) - Value to add to the dict
Returns: number - Returns True if it overwrote a key, False otherwise
Examples:
dictadditem[getvar[myDict],foo,1]
- adds a key foo tomyDict
and sets the value to 1
dicthaskey
Checks if the dictionary contains the key. Returns true if it does, false otherwise
Parameters:
- Param #0: dict (Dictionary) - The dict to check for a key
- Param #1: key (string) - Key to look for
Returns: number - Returns True if dictionary has the key, False otherwise
Examples:
dicthaskey[getvar[myDict],foo]
- Returns true ifmyDict
has the keyfoo
, false otherwise
dictremovekey
Deletes the specified key from the dictionary.
Parameters:
- Param #0: dict (Dictionary) - The dict to delete the key from
- Param #1: key (string) - Key to remove
Returns: number - Returns True if dictionary had the key, False otherwise
Examples:
dictremovekey[getvar[myDict],foo]
- Removes the keyfoo
from the dictionarymyDict
dictkeys
Returns a list of keys
Parameters:
- Param #0: dict (Dictionary) - The dictionary to return keys from
Returns: List - Returns a list of keys
Examples:
dictkeys[getvar[myDict]]
- Returns a list of all the keys inmyDict
dictvalues
Returns a list of keys
Parameters:
- Param #0: dict (Dictionary) - The dictionary to return values from
Returns: List - Returns a list of values
Examples:
dictkeys[getvar[myDict]]
- Returns a list of all the values inmyDict
dictsize
Returns the size of the dictionary
Parameters:
- Param #0: dict (Dictionary) - The dictionary to return size of
Returns: number - Returns a number size
Examples:
dictsize[dictcreate[a,b,c,d]]
- Returns 2 as the example dict isa=>b, c=>d
dictclear
Clears the dictionary contents and returns the dictionary
Parameters:
- Param #0: dict (Dictionary) - The dictionary to clear
Returns: Dictionary - Returns the dictionary
Examples:
dictclear[getvar[myDict]]
- Returns the empty dictionarymyDict
dictcopy
Creates a new dictionary and copies over all the key value pairs. This is a shallow copy.
Parameters:
- Param #0: dict (Dictionary) - The dictionary copy
Returns: Dictionary - Returns the new copy
Examples:
setvar[myDict2,dictcopy[getvar[myDict]]]
- Creates a shallow copy ofmyDict
and stores it inmyDict2
getregexmatch
Returns the part of the text that matches the specified regex
Parameters:
- Param #0: text (string) - The text to check the regex against
- Param #1: regex (string) - The regex
Returns: string - Returns the part of the text that matches the specified regex
Examples:
getregexmatch[`test 123`,`\d+`]
- Returns the string123
uboptget
Returns the value of a ub setting.
Parameters:
- Param #0: name (string) - The name of the variable to get. Prepend global options with
global.
.Returns: Object - Returns the value of the setting, if valid. 0 if invalid setting.
Examples:
uboptget[`Plugin.Debug`]
- Gets the current value for thePlugin.Debug
setting
uboptset
Changes the value of a ub setting.
Parameters:
- Param #0: name (string) - The name of the variable to set. Prepend global options with
global.
.- Param #1: newValue (Object) - The new value to set.
Returns: Object - Returns 1 if successful, 0 if it failed.
Examples:
uboptset[`Plugin.Debug`, 1]
- Sets the current value for thePlugin.Debug
setting to true
isportaling
Checks if your character is currently in portalspace
Returns: number - Returns 1 if in portalspace, 0 otherwise
Examples:
isportaling[]
- Returns 1 if in portalspace, 0 otherwise
exec
Evaluates a string as an expression
Parameters:
- Param #0: text (string) - The expression string to evaluate
Returns: Object - Returns the result of evaluating the expression string
Examples:
exec[`1+1`]
- returns 2
delayexec
Evaluates a string as an expression, after the specified delay
Parameters:
- Param #0: delay (number) - The delay in milliseconds. 1 second = 1000 milliseconds.
- Param #1: text (string) - The expression string to evaluate
Returns: Object - Returns 1
Examples:
delayexec[1000, `1+1`]
- evaluates the expression1+1
after a 1000ms (1s) delay
ifthen
If value is truthy, will execute the trueexpr string and return the results. If value is not truthy it will evaluate falseexpr string and return the results
Parameters:
- Param #0: value (Object) - value to check for truthiness
- Param #1: trueexpr (string) - expression string to evaluate if value is truthy
- Param #2: falseexpr (string) - expression string to evaluate if value is not truthy, optional
Returns: Object - Returns the result of evaluating the conditional expression string
Examples:
ifthen[1, `chatbox[\`true\`]`,`chatbox[\`false\`]`]
- writestrue
to the chatboxifthen[0, `chatbox[\`true\`]`,`chatbox[\`false\`]`]
- writesfalse
to the chatbox
tostring
Converts an object to a string
Parameters:
- Param #0: obj (Object) - The object to convert to a string
Returns: Object - Returns the object, converted to a string
Examples:
tostring[2]
- returns the string2
vitae
Gets your character’s current vitae percentage as a number
Returns: number - Returns a number
Examples:
vitae[]
- returns your current vitae % as a number
getaccounthash
Returns a hash of the current account name
Returns: string - Returns a hash of the current account name
Examples:
getaccounthash[]
- Returns a hash of the current account name
getworldname
Gets the name of the currently connected world/server
Returns: string - Returns the name of the current world/server
Examples:
getworldname[]
- Returns the name of the current world/server
getdatetimelocal
Gets the local date and time using the format provided
Parameters:
- Param #0: text (string) - The format to return the date/time
Returns: string - Returns the local date and time
Examples:
getdatetimelocal[`hh:mm:ss tt`]
- Returns current local time ‘06:09:01 PM’
getdatetimeutc
Gets the universal date and time using the format provided
Parameters:
- Param #0: text (string) - The format to return the date/time
Returns: string - Returns the universal date and time
Examples:
getdatetimeutc[`hh:mm:ss tt`]
- Returns current universal time ‘06:09:01 PM’
getunixtime
Gets the total number of seconds since the unix epoch (jan 1, 1970)
Returns: string - Returns the number of seconds since the unix epoch
Examples:
getunixtime[]
- Returns the number of seconds since the unix epoch
wobjectfindnearestbytemplatetype
Attempted to find the nearest landscape world object with the specified template type
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindnearestbytemplatetype[42137]
- Returns a worldobject with templaye type 42137 (level 10 ice tachi warden)
wobjectgetintprop
Returns an int property from a specific world object, or 0 if it’s undefined
Parameters:
- Param #0: obj (WorldObject) - World object to get int property of
- Param #1: property (number) - IntProperty to return
Returns: number - Returns an int property value
Examples:
wobjectgetintprop[wobjectgetselection[],218103808]
- Returns the template type of the currently selected object
wobjectgetdoubleprop
Returns a double property from a specific world object, or 0 if it’s undefined
Parameters:
- Param #0: obj (WorldObject) - World object to get double property of
- Param #1: property (number) - DoubleProperty to return
Returns: number - Returns a double property value
Examples:
wobjectgetdoubleprop[wobjectgetselection[],167772169]
- Returns the salvage workmanship of the currently selected object
wobjectgetboolprop
Returns a bool property from a specific world object, or 0 if it’s undefined
Parameters:
- Param #0: obj (WorldObject) - World object to get bool property of
- Param #1: property (number) - BoolProperty to return
Returns: number - Returns a bool property value
Examples:
wobjectgetboolprop[wobjectgetselection[],99]
- Returns 1 if the currently selected object is ivoryable
wobjectgetstringprop
Returns a string property from a specific world object, or and empty string if it’s undefined
Parameters:
- Param #0: obj (WorldObject) - World object to get string property of
- Param #1: property (number) - StringProperty to return
Returns: string - Returns a string property value
Examples:
wobjectgetstringprop[wobjectgetselection[],1]
- Returns the name of the currently selected object
wobjecthasdata
Checks if a wobject has assess data from the server
Parameters:
- Param #0: obj (WorldObject) - World object to check if we have assess data for
Returns: number - Returns 1 if we have assess data for the object
Examples:
wobjecthasdata[wobjectgetselection[]]
- Returns 1 if the currently selected object has assess data from the server
wobjectrequestdata
Requests assess data for a wobject from the server
Parameters:
- Param #0: obj (WorldObject) - World object to request assess data for
Returns: number - Returns 1
Examples:
wobjectrequestdata[wobjectgetselection[]]
- Requests assess data from the server for the currently selected object
wobjectlastidtime
Gets the last time a wobjects data was recieved from the server
Parameters:
- Param #0: obj (WorldObject) - World object to check
Returns: number - Returns 1
Examples:
wobjectlastidtime[wobjectgetselection[]]
- Checks the last time the server sent id data for the currently selected object
getheadingto
Calculates the heading in degrees (0-360 clockwise, 0 is north) from your player to the target object
Parameters:
- Param #0: obj (WorldObject) - World object to calculate heading towards
Returns: number - Returns the heading in degrees from your player to the target object
Examples:
getheadingto[wobjectgetselection[]]
- Returns the heading in degrees from your player to the target object
wobjectisvalid
Calculates the heading in degrees (0-360 clockwise, 0 is north) from your player to the target object
Parameters:
- Param #0: obj (WorldObject) - World object to calculate heading towards
Returns: number - Returns the heading in degrees from your player to the target object
Examples:
wobjectisvalid[wobjectgetselection[]]
- Returns the heading in degrees from your player to the target object
getequippedweapontype
Returns the equipped weapons object class
Returns: string - Returns the equipped weapons object class
Examples:
getequippedweapontype[]
- Returns the equipped weapons object class
getheading
Returns the heading in degrees (0-360 clockwise, 0 is north) the target object is facing
Parameters:
- Param #0: obj (WorldObject) - World object to get the heading of
Returns: number - Returns the heading in degrees that the target object is facing
Examples:
getheading[wobjectgetselection[]]
- Returns the heading in degrees that your current selection is facing
getcombatstate
Get the combat state of your character
Returns: string - Returns your current combat state
Examples:
getcombatstate[]
- Returns the string peace if you are in peace mode
setcombatstate
Sets the combat state of your character
Parameters:
- Param #0: str (string) - combatstate to set
Returns: number - Returns 1 if executed successfully.
Examples:
setcombatstate[peace]
- Sets your combat state to peace mode
getbusystate
Get the busy state of your character and returns a number for the state (0=idle, 1=combining a stack, 2=splitting a stack, 3=???, 4=picking up an item from the ground, 5=moving or unequipping an item, 6=dropping an item to the ground, 7=equipping an item)
Returns: number - Returns the number corresponding to your busy state (moving an item)
Examples:
getbusystate[]
- Returns 0 if your character is idle, otherwise returns the appropriate value
hexstr
converts a number to a hexadecimal string
Parameters:
- Param #0: d (number) - the number to convert
Returns: number - Returns a string
acos
Returns the angle whos cosine is the specified number
Parameters:
- Param #0: d (number) - A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1.
Returns: number - Returns the angle whos cosine is the specified number
asin
Returns the angle whose sine is the specified number
Parameters:
- Param #0: d (number) - A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1.
Returns: number - Returns the angle whose sine is the specified number
atan
Returns the angle whose tangent is the specified number.
Parameters:
- Param #0: d (number) - A number representing a tangent.
Returns: number - Returns the angle whose tangent is the specified number.
atan2
Returns the angle whose tangent is the quotient of two specified numbers.
Parameters:
- Param #0: y (number) - The y coordinate of a point.
- Param #1: x (number) - The x coordinate of a point.
Returns: number - Returns the angle whose tangent is the quotient of two specified numbers.
cos
Returns the cosine of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the cosine of the specified angle.
cosh
Returns the hyperbolic cosine of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the hyperbolic cosine of the specified angle.
sin
Returns the sine of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the sine of the specified angle.
sinh
Returns the hyperbolic sine of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the hyperbolic sine of the specified angle.
sqrt
Returns the square root of a specified number.
Parameters:
- Param #0: d (number) - The number whose square root is to be found
Returns: number - Returns the square root of a specified number.
tan
Returns the tangent of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the tangent of the specified angle.
tanh
Returns the hyperbolic tangent of the specified angle.
Parameters:
- Param #0: d (number) - An angle, measured in radians.
Returns: number - Returns the hyperbolic tangent of the specified angle.
listcreate
Creates a new list object. The list is empty by default.
Parameters:
- Param #0: items (…items) - items to isntantiate the list with
Returns: List - Creates and returns a new list
Examples:
listcreate[]
- Returns a new empty listlistcreate[1,2,3]
- Returns a new list with 3 items: 1,2,3setvar[myList,listcreate[]]
- Creates a new list and stores it inmyList
variable
listadd
Adds an item to the end of a list
Parameters:
- Param #0: list (List) - The list to add the item to
- Param #1: item (Object) - Item to add to list, can be any type. Lists cannot contain references to themselves.
Returns: List - Returns the list object
Examples:
listadd[getvar[myList],`some value`]
- Addssome value
string to the list stored inmyList
variable
listinsert
Inserts an item at the specified index of the list
Parameters:
- Param #0: list (List) - The list to add the item to
- Param #1: item (Object) - Item to add to list, can be any type. Lists cannot contain references to themselves.
- Param #2: index (number) - The index in the list where the item should be inserted
Returns: List - Returns the list object
Examples:
listinsert[getvar[myList],`some value`,1]
- Insertssome value
at index 1 (second item) in the list
listremove
Removes the first occurance of an item from the list
Parameters:
- Param #0: list (List) - The list to remove the item from
- Param #1: item (Object) - Item to remove from the list.
Returns: List - Returns the list object
Examples:
listremove[getvar[myList],`some value`]
- Removes the first occurance ofsome value
string from the list stored inmyList
variable
listremoveat
Removes the specified index from the list
Parameters:
- Param #0: list (List) - The list to remove the item from
- Param #1: index (number) - Index to remove from the list.
Returns: List - Returns the list object
Examples:
listremoveat[getvar[myList],1]
- Removes the second item from the list stored inmyList
variable
ustadd
Adds an item to the ust panel
Parameters:
- Param #0: obj (WorldObject) - World object to add to the ust panel
Returns: number - Returns 1
Examples:
ustadd[wobjectgetselection[]]
- Adds the currently selected item to your ust panel
ustopen
Opens the ust panel
Returns: number - Returns 1 on succes, 0 on failure
Examples:
ustopen[]
- Opens the ust panel
ustsalvage
Salvages the items in the ust panel
Returns: number - Returns 1
Examples:
ustsalvage[]
- Salvages all the items in the ust panel
getgameyear
Gets the current ingame year
Returns: number - Returns the current ingame year. Years have 360 days.
Examples:
getgameyear[]
- Returns the current ingame year, ie 249
getgamemonth
Gets the current ingame month as a number. Months are: 0=Morningthaw, 1=Solclaim, 2=Seedsow, 3=Leafdawning, 4=Verdantine, 5=Thistledown, 6=Harvestgain, 7=Leafcull, 8=Frostfell, 9=Snowreap, 10=Coldeve, 11=Wintersebb
Returns: number - Returns the current ingame month as a number
Examples:
getgamemonth[]
- Returns the current ingame month as a number, ie 8
getgamemonthname
Returns the name of a month index. Months are: 0=Morningthaw, 1=Solclaim, 2=Seedsow, 3=Leafdawning, 4=Verdantine, 5=Thistledown, 6=Harvestgain, 7=Leafcull, 8=Frostfell, 9=Snowreap, 10=Coldeve, 11=Wintersebb
Parameters:
- Param #0: monthIndex (number) - month index to get the name of
Returns: string - Returns the name of a month index
Examples:
getmonthname[1]
- Returns Solclaim
getgameday
Returns the current ingame day of the month. 1-30.
Returns: number - Returns the current ingame day of the month. 1-30
Examples:
getgameday[]
- returns the current ingame day of the month, ie 8
getgamehourname
Returns the name of a hour index.
Parameters:
- Param #0: hourIndex (number) - hour index to get the name of
Returns: string - Returns the name of a hour index
Examples:
getgamehourname[1]
- Returns Darktide-and-Half
getgamehour
Returns the current ingame hour of the day. Days have 16 hours
Returns: number - Returns the current ingame hour. 0-16
Examples:
getgamehour[]
- returns the current ingame hour of the day, ie 3
getminutesuntilday
Returns real world minutes left until the next day cycle
Returns: number - Returns real world minutes left until the next day cycle
Examples:
getminutesuntilday[]
- gets the number of real world minutes left until the next day cycle
getminutesuntilnight
Returns real world minutes left until the next night cycle
Returns: number - Returns real world minutes left until the next night cycle
Examples:
getminutesuntilnight[]
- gets the number of real world minutes left until the next night cycle
getgameticks
Returns the current ingame ticks.
Returns: number - Returns the current ingame ticks
Examples:
getgameticks[]
- returns the current ingame ticks
getisday
Returns 1 if it is currently day time, 0 otherwise
Returns: number - Returns 1 if it is currently day time, 0 otherwise
Examples:
getisday[]
- returns 1 if it is currently day time
getisnight
Returns 1 if it is currently night time, 0 otherwise
Returns: number - Returns 1 if it is currently night time, 0 otherwise
Examples:
getisnight[]
- returns 1 if it is currently night time
getfellowshipstatus
Checks if you are currently in a fellowship
Returns: number - Returns 1 if you are in a fellowship, 0 otherwise
Examples:
getfellowshipstatus[]
- returns 1 if you are in a fellowship, 0 otherwise
getfellowshipname
Gets the name of your current fellowship
Returns: string - Returns the name of a fellowship, or an empty string if none
Examples:
getfellowshipname[]
- returns the name of your current fellowship
getfellowshipcount
Gets the name of your current fellowship
Returns: number - Returns the number of members in your fellowship, or 0 if you are not in a fellowship
Examples:
getfellowshipcount[]
- Returns the number of members in your fellowship, or 0 if you are not in a fellowship
getfellowshipleaderid
Returns the character id of the fellowship leader
Returns: number - Returns the character id of the fellowship leader
Examples:
getfellowshipleaderid[]
- Returns the character id of the fellowship leader
getfellowid
Returns a fellowship member’s character id. It is recommended to save the output to a variable.
Parameters:
- Param #0: iterator (number) - fellowship member to return (0-8)
Returns: number - Character ID of requested Fellowship Member, or 0
Examples:
getfellowid[0]
- Returns the id of the first Fellowship Member
getfellowname
Returns a fellowship member’s character name. It is recommended to save the output to a variable.
Parameters:
- Param #0: iterator (number) - fellowship member to return (0-8)
Returns: string - Character name of requested Fellowship Member, or ""
Examples:
getfellowname[0]
- Returns the name of the first Fellowship Member
getfellowshiplocked
Returns 1 if your fellowship is Locked
Returns: number - Returns 1 if your fellowship is Locked, 0 otherwise
Examples:
getfellowshiplocked[]
- Returns 1 if your fellowship is Locked
getfellowshipisleader
Returns 1 if you are the leader of your fellowship
Returns: number - Returns 1 if you are the leader of your fellowship, 0 otherwise
Examples:
getfellowshipisleader[]
- Returns 1 if you are the leader of your fellowship
getfellowshipisopen
Returns 1 if your fellowship is open
Returns: number - Returns 1 if your fellowship is open, 0 otherwise
Examples:
getfellowshipisopen[]
- Returns 1 if your fellowship is open
getfellowshipisfull
Returns 1 if you’re in a fellowship, and it is full
Returns: number - Returns 1 if you’re in a fellowship and it is full. 0 otherwise
Examples:
getfellowshipisfull[]
- Returns 1 if you’re in a fellowship, and it is full
getfellowshipcanrecruit
Returns 1 if your fellowship is open, or you are the leader, and the fellowship is not full
Returns: number - Returns 1 if you’re in a fellowship, and are the leader, or the fellowship is open, and the fellowship is not full
Examples:
getfellowshipcanrecruit[]
- Returns 1 if you’re in a fellowship, and are the leader, or the fellowship is open, and the fellowship is not full
getfellownames
Returns a list of character names in your current fellowship, sorted alphabetically.
Returns: List - List of character names in the fellowship, sorted alphabetically
Examples:
getfellownames[]
- Returns a list of character names in your current fellowship, sorted alphabetically
getfellowids
Returns a list of character ids in your current fellowship, sorted numerically.
Returns: List - List of character ids in the fellowship, sorted numerically
Examples:
getfellowids[]
- Returns a list of character ids in your current fellowship, sorted numerically
wobjectgethealth
Gets the specified mob/player wobject current health percentage. Note: You must have the wobject selected in order to receive health updates
Parameters:
- Param #0: obj (WorldObject) - World object to get health of
Returns: number - Returns a value from 0-1 representing the objects current health percentage. If the objects health is not currently being tracked this will return -1
Examples:
wobjectgethealth[wobjectgetselection[]]
- Returns the health of the currently selected mob/player
getitemcountininventorybyname
Counts how many items you have in your inventory exactly matching
name
. Stack sizes are countedParameters:
- Param #0: name (string) - Exact item name to match
Returns: number - Returns a count of the number of items found. stack size is counted
Examples:
getitemcountininventorybyname[Prismatic Taper]
- Returns total count of prismatic tapers in your inventory
getitemcountininventorybynamerx
Counts how many items you have in your inventory matching regex
namerx
. Stack sizes are countedParameters:
- Param #0: namerx (string) - Regex item name to match
Returns: number - Returns a count of the number of items found. stack size is counted
Examples:
getitemcountininventorybynamerx[Scarab]
- Returns total count of scarabs in your inventory
wobjectgetspellids
Returns a list of spells on a World Object.
Parameters:
- Param #0: obj (WorldObject) - World object to get spells of
Returns: List - List of spell IDs
Examples:
wobjectgetspellids[wobjectgetselection[]]
- Returns a list of spell IDs of the selected item
wobjectgetactivespellids
Returns a list of active spells on a World Object.
Parameters:
- Param #0: obj (WorldObject) - World object to get spells of
Returns: List - List of spell IDs
Examples:
wobjectgetactivespellids[wobjectgetselection[]]
- Returns a list of active spell IDs of the selected item
getinventorycountbytemplatetype
Counts how many items you have in your inventory of a certain template type. Stack sizes are counted
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: number - Returns a count of the number of items found. stack size is counted
Examples:
getinventorycountbytemplatetype[42137]
- Returns total count of inventory items with templaye type 42137 (level 10 ice tachi warden)
actiontrygiveprofile
Gives all items matching the specified loot profile to a character or npc
Parameters:
- Param #0: lootprofile (string) - loot profile to give
- Param #1: target (string) - target npc/player name to give to
Returns: number - Returns 1 if an attempt was made, 0 if it was not (busy)
Examples:
actiontrygiveprofile[salvage\.utl,My Salvage Mule]
- Gives all items matching loot profile salvage.utl to a character named My Salvage Mule
setmotion
Sets a characters wanted motion state.
Parameters:
- Param #0: motion (string) - The motion to set. Valid motions are Forward|Backward|TurnRight|TurnLeft|StrafeRight|StrafeLeft|Walk
- Param #1: state (number) - 0 = off, 1 = on
Returns: number - Returns 1 if successful, 0 otherwise
Examples:
setmotion[Forward, 1]
- Makes your character move forward until turned offsetmotion[Forward, 0]
- Makes your character stop moving forward
getmotion
Gets a character motion state.
Parameters:
- Param #0: motion (string) - The motion to get. Valid motions are Forward|Backward|TurnRight|TurnLeft|StrafeRight|StrafeLeft
Returns: number - Returns 0 if the motion is inactive and unwanted, -1 if the motion is unwanted but active, 1 if the motion is wanted but inactive, 2 if the motion is wanted and active.
Examples:
getmotion[Forward]
- Returns 1 if your character is moving forward, 0 if not
clearmotion
Clears all motion states
Returns: number - Returns 1
Examples:
clearmotion[]
- Clears all motion states
netclients
Gets a list of network clients, optionally filtered by tag
Parameters:
- Param #0: tag (string) - Optional network tag to filter by
Returns: List - Returns a list of network client data, optionally filtered by tag
Examples:
netclients[]
- returns a list of all network clientsnetclients[test]
- returns a list of all network clients with the tagtest
testquestflag
Checks if a quest flag has ever been completed. You must manually refresh
/myquests
after completing a quest, for these values to be up to date. UB will call/myquests
once on login automatically.Parameters:
- Param #0: questflag (string) - quest flag to check
Returns: number - Returns 1 if you have ever completed this quest flag, 0 otherwise
Examples:
testquestflag[spokenbobo]
- Checks if your character is flagged for bobo
getqueststatus
Checks if a quest flag has a timer on it. If there is a timer it returns 0, if it’s ready it returns 0. You must manually refresh
/myquests
after completing a quest, for these values to be up to date. UB will call/myquests
once on login automatically.Parameters:
- Param #0: questflag (string) - quest flag to check
Returns: number - Returns status of a quest flag. 0 = Not Ready, 1 = Ready
Examples:
getqueststatus[blankaug]
- Checks if your character is ready to run the blankaug quest again.
getquestktprogress
Checks progress of a killtask quest. You must manually refresh
/myquests
after completing a quest, for these values to be up to date. UB will call/myquests
once on login automatically.Parameters:
- Param #0: questflag (string) - quest flag to check
Returns: number - Returns a progress count
Examples:
getquestktprogress[totalgolemmagmaexarchdead]
- Checks how many exarch kills you currently have
getquestktrequired
Checks total required solves of a killtask quest. If you have not started the killtask, this will return 0. You must manually refresh
/myquests
after completing a quest, for these values to be up to date. UB will call/myquests
once on login automatically.Parameters:
- Param #0: questflag (string) - quest flag to check
Returns: number - Returns a required count
Examples:
getquestktrequired[totalgolemmagmaexarchdead]
- Checks required total exarch kills for this kill task
isrefreshingquests
Checks if quests are currently being fetched or processed
Returns: number - Returns 1 if quests are currently being fetched and processed, 0 otherwise
Examples:
isrefreshingquests[]
- Returns 1 if quests are currently being fetched and processed
spellname
Gets the name of a spell by id
Parameters:
- Param #0: spellid (number) - Spell ID
Returns: string - Returns a string name of the passed spell id.
Examples:
spellname[1]
- ReturnsStrength Other I
for spell id 1
componentname
Gets the name of a spell component by id
Parameters:
- Param #0: componentid (number) - Spell ID
Returns: string - Returns a string name of the passed spell id.
Examples:
componentname[1]
- Returns total count of prismatic tapers in your inventory
componentdata
Returns a dictionary containing component data for the passed component id
Parameters:
- Param #0: componentid (number) - component ID
Returns: Dictionary - Returns a dictionary containing component data
Examples:
componentdata[1]
- returns a dictionary of information about component id 1
getknownspells
Returns a list of spell ids known by this character
Returns: List - Returns a list of spell ids known by this character
Examples:
getknownspells[]
- Returns a list of spell ids known by this character
spelldata
Gets a dictionary of information about the passed spell id
Parameters:
- Param #0: spellid (number) - Spell ID
Returns: Dictionary - Returns a dictionary of spell data
Examples:
spelldata[1]
- returns spell data for spellid 1
wobjectfindallinventorybytemplatetype
Gets a list of all inventory items matching templatetype
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: List - Returns a list of all matching inventory worldobjects
Examples:
wobjectfindallinventorybytemplatetype[9060]
- Returns a list of inventory worldobjects that are a Titan Mana Charge (template type 9060)
wobjectfindallinventorybynamerx
Gets a list of all inventory wobjects with name matching the passed regular expression
Parameters:
- Param #0: namerx (string) - regular expression to filter name by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindallinventorybynamerx[`Crash.*`]
- Returns a list of all inventory worldobjects that match the regexCrash.*
wobjectfindalllandscapebyobjectclass
Gets a list of all landscape worldobjects of the passed objectclass
Parameters:
- Param #0: objectclass (number) - objectclass to filter by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindalllandscapebyobjectclass[16]
- Returns a list of all mana stones in the landscape
wobjectfindalllandscapebytemplatetype
Gets a list of all landscape items matching templatetype
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindalllandscapebytemplatetype[9060]
- Returns a list of landscape worldobjects that are a Titan Mana Charge (template type 9060)
wobjectfindalllandscapebynamerx
Gets a list of all landscape wobjects with name matching the passed regular expression
Parameters:
- Param #0: namerx (string) - regular expression to filter name by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindalllandscapebynamerx[`Crash.*`]
- Returns a list of all landscape worldobjects that match the regexCrash.*
wobjectfindallbycontainer
Gets a list of all worldobjects inside the specified container
Parameters:
- Param #0: container (Object) - container to find objects in. can be an id or a wobject
Returns: List - Returns a list of worldobjects
Examples:
wobjectfindallbycontainer[wobjectgetselection[]]
- Returns a list of all wobjects in the currently selected containerwobjectfindallbycontainer[0x1234ABCD]
- Returns a list of all wobjects in the container with id 0x1234ABCD
actiontryselect
Attempts to select a worldobject
Parameters:
- Param #0: obj (WorldObject) - wobject to select
Returns: number - Returns 0
Examples:
actiontryselect[wobjectgetplayer[]]
- Attempts to select the current player
actiontryuseitem
Attempts to use a worldobject
Parameters:
- Param #0: obj (WorldObject) - wobject to try to use
Returns: number - Returns 0
Examples:
actiontryuseitem[wobjectgetplayer[]]
- Attempts to use the current player (opens backpack)
actiontryapplyitem
Attempts to use a worldobject on another worldobject
Parameters:
- Param #0: useObj (WorldObject) - wobject to use first
- Param #1: onObj (WorldObject) - wobject to be used on
Returns: number - Returns 0 if failed, and 1 if it could succeed
Examples:
actiontryapplyitem[wobjectfindininventorybynamerx[`.* Healing Kit`],wobjectwobjectgetplayer[]]
- Attempts to use any healing kit in your inventory, on yourself
actiontrygiveitem
Attempts to give a worldobject to another worlobject, like an npc
Parameters:
- Param #0: give (WorldObject) - wobject to give
- Param #1: destination (WorldObject) - wobject to be given to
Returns: number - Returns 0 if failed, and 1 if it could succeed
Examples:
actiontrygiveitem[wobjectfindininventorybynamerx[`.* Healing Kit`],wobjectgetselection[]]
- Attempts to to give any healing kit in your inventory to the currently selected object
actiontryequipanywand
Attempts to take one step towards equipping any wand from the current profile’s items list
Returns: number - Returns 1 if a wand is already equipped, 0 otherwise
Examples:
actiontryequipanywand[]
- Attempts to equip any wand
actiontrycastbyid
Attempts to cast a spell by id. Checks spell requirements as if it were a vtank ‘hunting’ spell. If the character is not in magic mode, one step is taken towards equipping any wand
Parameters:
- Param #0: spellId (number) - spellId to cast
Returns: number - Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible
Examples:
actiontrycastbyid[2931]
- Attempts to cast Recall Aphus Lassel
actiontrycastbyidontarget
Attempts to cast a spell by id on a worldobject. Checks spell requirements as if it were a vtank ‘hunting’ spell. If the character is not in magic mode, one step is taken towards equipping any wand
Parameters:
- Param #0: spellId (number) - spellId to cast
- Param #1: target (WorldObject) - target to cast on
Returns: number - Returns 1 if the attempt has begun, 0 if the attempt has not yet been made, or 2 if the attempt is impossible
Examples:
actiontrycastbyidontarget[1,wobjectgetselection[]]
- Attempts to cast Strength Other, on your currently selected target
statushud
Updates an entry in the Virindi HUDs Status HUD.
Parameters:
- Param #0: key (string) - key to update
- Param #1: value (string) - value to update with
Returns: number - Returns 1
Examples:
statushud[test,my value]
- Updates the V Status Hud keytest
tomy value
statushudcolored
Updates an entry in the Virindi HUDs Status HUD with color
Parameters:
- Param #0: key (string) - key to update
- Param #1: value (string) - value to update with
- Param #2: color (number) - The color, in RGB number format. For example, pure red is 16711680 (0xFF0000)
Returns: number - Returns 1
Examples:
statushudcolored[test,my value,16711680]
- Updates the V Status Hud keytest
tomy value
in red
isfalse
Checks if a value is equal to false (0)
Parameters:
- Param #0: value (Object) - value to check
Returns: number - Returns 1 if value is false, 0 otherwise
Examples:
isfalse[0]
- Checks that 0 is false, and returns true because it is
istrue
Checks if a value is equal to true (1)
Parameters:
- Param #0: value (Object) - value to check
Returns: number - Returns 1 if value is true, 0 otherwise
Examples:
istrue[1]
- Checks that 0 is true, and returns true because it is
iif
Checks if the first parameter is true, if so returns the second argument. If the first parameter is false or not a number, returns the third argument. Both arguments will always be evaluated. if you want conditional evaluation use
if[]
Parameters:
- Param #0: value (Object) - value to check
- Param #1: truevalue (Object) - value to return if value is true
- Param #2: falsevalue (Object) - value to return if value is false
Returns: number - Returns 1 if value is true, 0 otherwise
Examples:
iif[1,2,3]
- Returns 2 (second param) because 1 (first param) is true
randint
Generates a random number between min and (max-1)
Parameters:
- Param #0: min (number) - minimum value to return
- Param #1: max (number) - maximum value to return (-1)
Returns: number - Returns a number between min and (max-1)
Examples:
randint[0,2]
- Returns a random number, 0 or 1, but not 2
cstr
Converts a number to a string
Parameters:
- Param #0: number (number) - number to convert
Returns: string - Returns a string representation of number
Examples:
cstr[2]
- Returns a string of2
strlen
Gets the length of a string
Parameters:
- Param #0: tocheck (string) - string to check
Returns: number - Returns the length of tocheck string
Examples:
strlen[test]
- Returns a length of 4
getobjectinternaltype
Gets internal type of an object, as a number
Parameters:
- Param #0: tocheck (Object) - object to check
Returns: number - Values are: 0=none, 1=number, 3=string, 7=object
Examples:
getobjectinternaltype[test]
- Returns a length of 4
cstrf
Converts a number to a string using a specified format
Parameters:
- Param #0: number (number) - number to convert
- Param #1: format (string) - string format. See: http://msdn.microsoft.com/en-us/library/kfsatb94.aspx
Returns: string - formatted string, from a number
Examples:
cstrf[3.14159,`N3`]
- Formats 3.14159 to a string with 3 decimal places
cnumber
Converts a string to a floating point number
Parameters:
- Param #0: number (string) - string number to convert
Returns: number - floating point number from a string
Examples:
cnumber[`3.14159`]
- Converts3.14159
to a number
floor
returns the largest integer less than or equal to a given number.
Parameters:
- Param #0: number (number) - number to floot
Returns: number - Returns a whole number
Examples:
floor[3.14159]
- returns 3
ceiling
rounds a number up to the next largest whole number or integer
Parameters:
- Param #0: number (number) - number to ceil
Returns: number - Returns a whole number
Examples:
ceiling[3.14159]
- returns 3
round
returns the value of a number rounded to the nearest integer
Parameters:
- Param #0: number (number) - number to round
Returns: number - Returns a whole number
Examples:
round[3.14159]
- returns 3
abs
Returns the absolute value of a number
Parameters:
- Param #0: number (number) - number to get absolute value of
Returns: number - Returns a positive number
Examples:
abs[-3.14159]
- returns 3.14159
vtsetmetastate
Changes the current vtank meta state
Parameters:
- Param #0: state (string) - new state to switch to
Returns: number - Returns 1
Examples:
vtsetmetastate[myState]
- sets vtank meta state tomyState
vtgetmetastate
Gets the current vtank meta state as a string
Returns: string - Returns the current vt meta state as a string
Examples:
vtgetmetastate[]
- Returns the current vt meta state as a string
vtsetsetting
Sets the specified vtank setting
Parameters:
- Param #0: setting (string) - setting to set the value of
- Param #1: setting (string) - value to set the setting to
Returns: number - Returns 0 if known to fail and 1 if it may have succeeded
Examples:
vtsetsetting[EnableCombat,`1`]
- Sets the vtank EnableCombat setting to true. Any other number sets to falsevtsetsetting[RingDistance,cstrf[cnumber[vtgetsetting[DoorOpenRange]],`N5`]
- Sets the vtank RingDistance setting to match the DoorOpenRange
vtgetsetting
Gets the value of a vtank setting
Parameters:
- Param #0: setting (string) - setting to get the state of
Returns: string - Returns the string value of the specific setting or an empty string if undefined
Examples:
vtgetsetting[EnableCombat]
- Gets the value of the vtank EnableCombat settingcnumber[vtgetsetting[RingDistance]]
- Gets the number value of the vtank RingDistance setting
ord
returns an integer representing the Unicode character
Parameters:
- Param #0: character (string) - string to convert
Returns: number - number representing unicode character
Examples:
ord[c]
- Converts ‘c’ to a number representing its unicode character (99)
chr
returns a string representing a character whose Unicode code point is an integer.
Parameters:
- Param #0: character (number) - number to convert
Returns: string - string representing unicode character
Examples:
chr[99]
- Converts99
to a strin representing its unicode character ‘c’
stopwatchcreate
Creates a new stopwatch object. The stopwatch object is stopped by default.
Returns: Stopwatch - Returns a stopwatch object
Examples:
stopwatchcreate[]
- returns a new stopwatch
stopwatchstart
Starts a stopwatch if not already started
Parameters:
- Param #0: watch (Stopwatch) - stopwatch to start
Returns: Stopwatch - Returns a stopwatch object
Examples:
stopwatchstart[stopwatchcreate[]]
- starts a new stopwatch
stopwatchstop
Stops a stopwatch if not already stopped
Parameters:
- Param #0: watch (Stopwatch) - stopwatch to stop
Returns: Stopwatch - Returns a stopwatch object
Examples:
stopwatchstop[stopwatchcreate[]]
- stops a new stopwatch
stopwatchelapsedseconds
Gets the amount of seconds a stopwatch has been running for
Parameters:
- Param #0: watch (Stopwatch) - stopwatch to check
Returns: Stopwatch - Returns a int elapsed seconds
Examples:
stopwatchelapsedseconds[stopwatchcreate[]]
- Returns the amount of a seconds a new stopwatch has been running for (0 obv)
uigetcontrol
Gets a reference to the named control in the named window
Parameters:
- Param #0: windowName (string) - Name of the window the control belongs to
- Param #1: controlName (string) - Name of the control to get
Returns: UIControl - Returns a UIControl, or 0 if not found
Examples:
uigetcontrol[myWindow, myControl]
- Gets a reference to the controlmyControl
in the viewmyWindow
uisetlabel
Changes the label text for the given UIControl. Currently only supports buttons.
Parameters:
- Param #0: control (UIControl) - UIControl of the control to change
- Param #1: label (string) - The new label text for the control
Returns: number - Returns 1 on success, 0 on failure
Examples:
uisetlabel[uigetcontrol[myWindow, myControl], new label]
- Changes the controlmyControl
label in the viewmyWindow
tonew label
uisetvisible
Changes the visibility for the given UIControl. Currently only supports buttons.
Parameters:
- Param #0: control (UIControl) - UIControl of the control to change
- Param #1: visible (number) - pass 1 to make the control visible, 0 to make it hidden
Returns: number - Returns 1 on success, 0 on failure
Examples:
uisetvisible[uigetcontrol[myWindow, myControl], 0]
- Changes the controlmyControl
visibility in the viewmyWindow
to hidden
uiviewexists
Checks if a meta view exists
Parameters:
- Param #0: windowName (string) - Name of the window to check the existence of
Returns: UIControl - Returns 1 if it exists, 0 if not
Examples:
uiviewexists[myWindow]
- returns true if a view with the titlemyWindow
exists
uiviewvisible
Checks if a meta view is visible
Parameters:
- Param #0: windowName (string) - Name of the window to check the visibilty of
Returns: UIControl - Returns 1 if it exists, 0 if not
Examples:
uiviewvisible[myWindow]
- returns true if a view with the titlemyWindow
is visible
testvar
Checks if a variable is defined
Parameters:
- Param #0: varname (string) - Variable name to check
Returns: number - Returns 1 if the variable is defined, 0 if it isn’t
Examples:
testvar[myvar]
- Returns 1 ifmyvar
variable is defined
getvar
Returns the value stored in a variable
Parameters:
- Param #0: varname (string) - Variable name to get
Returns: number - Returns the value of a variable, or 0 if undefined
Examples:
getvar[myvar]
- Returns the value stored inmyvar
variable
setvar
Stores a value in a variable
Parameters:
- Param #0: varname (string) - Variable name to set
- Param #1: value (Object) - Value to store
Returns: Object - Returns the newly set value
Examples:
setvar[myvar,1]
- Stores the number value1
inside ofmyvar
variable
touchvar
Sets the value of a variable to 0 if the variable was previously undefined
Parameters:
- Param #0: varname (string) - Variable name to touch
Returns: number - Returns 1 if the variable was previously defined, 0 otherwise
Examples:
touchvar[myvar]
- Ensures thatmyvar
has a value set
clearallvars
Unsets all variables
Returns: number - Returns 1
Examples:
clearallvars[]
- Unset all variables
clearvar
Clears the value of a variable
Parameters:
- Param #0: varname (string) - Variable name to clear
Returns: number - Returns 1 if the variable was defined, 0 otherwise
Examples:
clearvar[myvar]
- Clears the value stored inmyvar
variable
testpvar
Checks if a persistent variable is defined
Parameters:
- Param #0: varname (string) - Variable name to check
Returns: number - Returns 1 if the variable is defined, 0 if it isn’t
Examples:
testpvar[myvar]
- Returns 1 ifmyvar
persistent variable is defined
getpvar
Returns the value stored in a persistent variable
Parameters:
- Param #0: varname (string) - Variable name to get
Returns: number - Returns the value of a variable, or 0 if undefined
Examples:
getpvar[myvar]
- Returns the value stored in the persistentmyvar
variable
setpvar
Stores a value in a persistent variable that is available ever after relogging. Persistent variables are not shared between characters.
Parameters:
- Param #0: varname (string) - Variable name to set
- Param #1: value (Object) - Value to store
Returns: Object - Returns the newly set value
Examples:
setpvar[myvar,1]
- Stores the number value1
inside ofmyvar
variable
touchpvar
Sets the value of a persistent variable to 0 if the variable was previously undefined
Parameters:
- Param #0: varname (string) - Variable name to touch
Returns: number - Returns 1 if the variable was previously defined, 0 otherwise
Examples:
touchpvar[myvar]
- Ensures thatmyvar
has a value set
clearallpvars
Unsets all persistent variables
Returns: number - Returns 1
Examples:
clearallpvars[]
- Unset all persistent variables
clearpvar
Clears the value of a persistent variable
Parameters:
- Param #0: varname (string) - Variable name to clear
Returns: number - Returns 1 if the variable was defined, 0 otherwise
Examples:
clearpvar[myvar]
- Clears the value stored inmyvar
persistent variable
testgvar
Checks if a global variable is defined
Parameters:
- Param #0: varname (string) - Variable name to check
Returns: number - Returns 1 if the variable is defined, 0 if it isn’t
Examples:
testgvar[myvar]
- Returns 1 ifmyvar
global variable is defined
getgvar
Returns the value stored in a variable
Parameters:
- Param #0: varname (string) - Variable name to get
Returns: number - Returns the value of a variable, or 0 if undefined
Examples:
getgvar[myvar]
- Returns the value stored inmyvar
global variable
setgvar
Stores a value in a global variable. This variable is shared between all characters on the same server.
Parameters:
- Param #0: varname (string) - Variable name to set
- Param #1: value (Object) - Value to store
Returns: Object - Returns the newly set value
Examples:
setgvar[myvar,1]
- Stores the number value1
inside of globalmyvar
variable
touchgvar
Sets the value of a global variable to 0 if the variable was previously undefined
Parameters:
- Param #0: varname (string) - Variable name to touch
Returns: number - Returns 1 if the variable was previously defined, 0 otherwise
Examples:
touchgvar[myvar]
- Ensures thatmyvar
global variable has a value set
clearallgvars
Unsets all global variables
Returns: number - Returns 1
Examples:
clearallgvars[]
- Unset all global variables
cleargvar
Clears the value of a global variable
Parameters:
- Param #0: varname (string) - Variable name to clear
Returns: number - Returns 1 if the variable was defined, 0 otherwise
Examples:
cleargvar[myvar]
- Clears the value stored inmyvar
global variable
chatbox
Sends a message to the chatbox as if you had typed it in
Parameters:
- Param #0: message (string) - Message to send
Returns: string - Returns the string sent to the charbox
Examples:
chatbox[test]
- sends ‘test’ to the chatbox
chatboxpaste
Pastes a message to the chatbox, leaving focus, so that the user can complete typing it
Parameters:
- Param #0: message (string) - Message to paste
Returns: number - Returns 1 if successful
Examples:
chatboxpaste[test]
- pastestest
to the chatbox, without sending
echo
Echos chat to the chatbox with a color. Use
/ub printcolors
to view all colorsParameters:
- Param #0: message (string) - Message to echo
- Param #1: color (number) - Message color
Returns: number - Returns 1 on success, 0 on failure
Examples:
echo[test,15]
- echos ‘test’ to the chatbox in red (Help)
getcharintprop
Returns an int property from your character, or 0 if it’s undefined
Parameters:
- Param #0: property (number) - IntProperty to return
Returns: number - Returns an int property from your character
Examples:
getcharintprop[25]
- Returns your character’s current level
getchardoubleprop
Returns a double property from your character, or 0 if it’s undefined
Parameters:
- Param #0: property (number) - DoubleProperty to return
Returns: number - Returns a double property from your character
Examples:
getchardoubleprop[25]
- Returns your character’s current level
getcharquadprop
Returns a quad property from your character, or 0 if it’s undefined
Parameters:
- Param #0: property (number) - QuadProperty to return
Returns: number - Returns a quad property from your character
Examples:
getcharquadprop[1]
- Returns your character’s TotalExperience
getcharboolprop
Returns a bool property from your character, or 0 if it’s undefined
Parameters:
- Param #0: property (number) - BoolProperty to return
Returns: number - Returns a bool property from your character
Examples:
getcharboolprop[110]
- Returns your character’s AwayFromKeyboard status
getcharstringprop
Returns a string property from your character, or false if it’s undefined
Parameters:
- Param #0: property (number) - StringProperty to return
Returns: string - Returns a string property from your character
Examples:
getcharstringprop[1]
- Returns your character’s name
getisspellknown
Checks if your character knowns a spell by id
Parameters:
- Param #0: spellId (number) - Spell ID to check
Returns: number - Returns 1 if your character knows this spell, 0 otherwise
Examples:
getisspellknown[2931]
- Checks if your character knowns the Recall Aphus Lassel spell
getcancastspell_hunt
Checks if your character is capable of casting spellId while hunting
Parameters:
- Param #0: spellId (number) - Spell ID to check
Returns: number - Returns 1 if your character can cast this spell while hunting, 0 otherwise
Examples:
getcancastspell_hunt[2931]
- Checks if your character is capable of casting the Recall Aphus Lassel spell while hunting
getcancastspell_buff
Checks if your character is capable of casting spellId while buffing
Parameters:
- Param #0: spellId (number) - Spell ID to check
Returns: number - Returns 1 if your character can cast this spell while buffing, 0 otherwise
Examples:
getcancastspell_hunt[2931]
- Checks if your character is capable of casting the Recall Aphus Lassel spell while buffing
getspellexpiration
Gets the number of seconds until a spell expires by id
Parameters:
- Param #0: spellId (number) - Spell ID to check
Returns: number - Returns the number of seconds until a spell expires. 0 if spell not active, MaxInt if it doesn’t expire.
Examples:
getspellexpiration[515]
- Get the number of seconds until Acid Protection Self I expires
getspellexpirationbyname
Gets the number of seconds until a spell expires by name
Parameters:
- Param #0: spellName (string) - Spell name to check
Returns: number - Returns the number of seconds until a spell expires. 0 if spell not active, MaxInt if it doesn’t expire, -1 if an error occurred.
Examples:
getspellexpirationbyname[`acid prot`]
- Get the number of seconds until an Acid Protection spell expires
getcharvital_base
Gets your characters base (unbuffed) vital value
Parameters:
- Param #0: vitalId (number) - Which vital to get. 1 = Health, 2 = Stamina, 3 = Mana.
Returns: number - Returns the base (unbuffed) vital value
Examples:
getcharvital_base[1]
- Returns your character’s base health
getcharvital_current
Gets your characters current vital value
Parameters:
- Param #0: vitalId (number) - Which vital to get. 1 = Health, 2 = Stamina, 3 = Mana.
Returns: number - Returns the current vital value
Examples:
getcharvital_current[2]
- Returns your character’s current stamina
getcharvital_buffedmax
Gets your characters buffed maximum vital value
Parameters:
- Param #0: vitalId (number) - Which vital to get. 1 = Health, 2 = Stamina, 3 = Mana.
Returns: number - Returns the buffed maximum vital value
Examples:
getcharvital_current[3]
- Returns your character’s buffed maximum mana
getcharskill_traininglevel
Gets your characters training level for a specified skill
Parameters:
- Param #0: skillId (number) - Which skill to check.
Returns: number - Returns current training level of a skill. 0 = Unusable, 1 = Untrained, 2 = Trained, 3 = Specialized
Examples:
getcharskill_traininglevel[23]
- Returns your character’s LockPick skill training level
getcharskill_base
Gets your characters base skill level for a speficied skill
Parameters:
- Param #0: skillId (number) - Which skill to check.
Returns: number - Returns base skill level of the specified skill
Examples:
getcharskill_base[43]
- Returns your character’s base Void skill level
getcharskill_buffed
Gets your characters buffed skill level for a speficied skill
Parameters:
- Param #0: skillId (number) - Which skill to check.
Returns: number - Returns buffed skill level of the specified skill
Examples:
getcharskill_buffed[33]
- Returns your character’s buffed Life Magic skill level
getcharattribute_buffed
Gets your characters buffed attribute level for a speficied attribute
Parameters:
- Param #0: attributeId (number) - Which attribute to check. 1 = Strength, 2 = Endurance, 3 = Quickness, 4 = Coordination, 5 = Focus, 6 = Self
Returns: number - Returns buffed attribute level of the specified attribute
Examples:
getcharattribute_buffed[1]
- Returns your character’s buffed Strength attribute level
getcharattribute_base
Gets your characters base attribute level for a speficied attribute
Parameters:
- Param #0: attributeId (number) - Which attribute to check. 1 = Strength, 2 = Endurance, 3 = Quickness, 4 = Coordination, 5 = Focus, 6 = Self
Returns: number - Returns base attribute level of the specified attribute
Examples:
getcharattribute_base[1]
- Returns your character’s base Strength attribute level
getcharburden
Gets your current burden shown on the character panel
Returns: number - Return current burden shown in character panel
Examples:
getcharburden[0]
- Returns your character’s current burden level
getplayerlandcell
Gets the landcell your character is currently standing in
Returns: number - Returns the landcell your character is currently standing in
Examples:
getplayerlandcell[]
- Returns your character’s current landcell as in uint
getplayerlandblock
Gets the landblock your character is currently standing in
Returns: number - Returns the landblock your character is currently standing in
Examples:
getplayerlandblock[]
- Returns your character’s current landblock as in uint
getplayercoordinates
Gets the a coordinates object representing your characters current global position
Returns: Coordinates - Returns your character’s global coordinates object
Examples:
getplayercoordinates[]
- Returns your character’s current position as coordinates object
coordinategetns
Gets the NS position of a coordinates object as a number
Parameters:
- Param #0: obj (Coordinates) - coordinates object to get the NS position of
Returns: number - Returns the NS position of a coordinates object as a number
Examples:
coordinategetns[getplayercoordinates[]]
- Returns your character’s current NS position
coordinategetwe
Gets the EW position of a coordinates object as a number
Parameters:
- Param #0: obj (Coordinates) - coordinates object to get the EW position of
Returns: number - Returns the EW position of a coordinates object as a number
Examples:
coordinategetwe[getplayercoordinates[]]
- Returns your character’s current EW position
coordinategetz
Gets the Z position of a coordinates object as a number
Parameters:
- Param #0: obj (Coordinates) - coordinates object to get the Z position of
Returns: number - Returns the Z position of a coordinates object as a number
Examples:
coordinategetz[getplayercoordinates[]]
- Returns your character’s current Z position
coordinatetostring
Converts a coordinates object to a string representation
Parameters:
- Param #0: obj (Coordinates) - coordinates object to convert to a string
Returns: number - Returns a string representation of a coordinates object, like
1.2N, 34.5E
Examples:
coordinatetostring[getplayercoordinates[]]
- Returns your character’s current coordinates as a string, eg1.2N, 34.5E
coordinateparse
Converts a coordinate string like
1.2N, 3.4E
to a coordinates objectParameters:
- Param #0: coordstring (string) - coordinates string to parse
Returns: Coordinates - Returns a coordinates object
Examples:
coordinateparse[`1.2N, 3.4E`]
- Returns a coordinates object representing1.2N, 3.4E
coordinatedistancewithz
Gets the 3d distance in meters between two coordinates objects
Parameters:
- Param #0: obj1 (Coordinates) - first coordinates object
- Param #1: obj2 (Coordinates) - second coordinates object
Returns: number - Returns the 3d distance in meters between obj1 and obj2
Examples:
coordinatedistancewithz[coordinateparse[`1.2N, 3.4E`], coordinateparse[`5.6N, 7.8E`]]
- Returns the 3d distance between1.2N, 3.4E
and5.6N, 7.8E
coordinatedistanceflat
Gets the 2d distance in meters between two coordinates objects (ignoring Z)
Parameters:
- Param #0: obj1 (Coordinates) - first coordinates object
- Param #1: obj2 (Coordinates) - second coordinates object
Returns: number - Returns the 2d distance in meters between obj1 and obj2 (ignoring Z)
Examples:
coordinatedistancewithz[coordinateparse[`1.2N, 3.4E`], coordinateparse[`5.6N, 7.8E`]]
- Returns the 2d distance between1.2N, 3.4E
and5.6N, 7.8E
(ignoring Z)
wobjectgetphysicscoordinates
Gets a coordinates object representing a world objects current position
Parameters:
- Param #0: wo (WorldObject) - world object to get coordinates of
Returns: Coordinates - Returns a coordinates object representing the passed wobject
Examples:
wobjectgetphysicscoordinates[wobjectgetplayer[]]
- Returns a coordinates object representing the current player’s position
wobjectgetname
Gets the name string of a wobject
Parameters:
- Param #0: wo (WorldObject) - world object to get the name of
Returns: string - Returns a string of wobject’s name
Examples:
wobjectgetname[wobjectgetplayer[]]
- Returns a string representing the name of the world object
wobjectgetid
Gets the id of a wobject
Parameters:
- Param #0: wo (WorldObject) - world object to get the id of
Returns: number - Returns the id of the passed wobject
Examples:
wobjectgetid[wobjectgetplayer[]]
- Returns the id of the current player
wobjectgetobjectclass
Gets the objectclass as a number from a wobject
Parameters:
- Param #0: wo (WorldObject) - world object to get the objectclass of
Returns: number - Returns a number representing the passed wobjects objectclass
Examples:
wobjectgetobjectclass[wobjectgetplayer[]]
- Returns 24 (Player ObjectClass)
wobjectgettemplatetype
Gets the template type as a number from a wobject
Parameters:
- Param #0: wo (WorldObject) - world object to get the template type of
Returns: number - Returns a number representing the passed wobjects template type
Examples:
wobjectgettemplatetype[wobjectgetplayer[]]
- Returns 1 (Player template type)
wobjectgetisdooropen
Checks if a door wobject is open
Parameters:
- Param #0: wo (WorldObject) - door world object to check
Returns: number - Returns 1 if the wo door is open, 0 otherwise
Examples:
wobjectgetisdooropen[wobjectfindnearestdoor[]]
- Returns 1 if the door is open, 0 otherwise
wobjectfindnearestmonster
Gets a worldobject representing the nearest monster, or 0 if none was found
Returns: WorldObject - Returns a worldobject representing the nearest monster
Examples:
wobjectfindnearestmonster[]
- Returns a worldobject representing the nearest monster
wobjectfindnearestdoor
Gets a worldobject representing the nearest door, or 0 if none was found
Returns: WorldObject - Returns a worldobject representing the nearest door
Examples:
wobjectfindnearestdoor[]
- Returns a worldobject representing the nearest door
wobjectfindnearestbyobjectclass
Gets a worldobject representing the nearest object matching objectclass, or 0 if none was found
Parameters:
- Param #0: objectclass (number) - objectclass to filter by
Returns: WorldObject - Returns a worldobject representing the nearest matching objectclass
Examples:
wobjectfindnearestbyobjectclass[24]
- Returns a worldobject of the nearest matching objectclass
wobjectfindininventorybytemplatetype
Gets a worldobject representing the first inventory item matching template type, or 0 if none was found
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindininventorybytemplatetype[9060]
- Returns a worldobject of the first inventory item that is a Titan Mana Charge (template type 9060)
wobjectfindininventorybyname
Gets a worldobject representing the first inventory item matching an exact name, or 0 if none was found
Parameters:
- Param #0: name (string) - exact name to filter by
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindininventorybyname[Massive Mana Charge]
- Returns a worldobject of the first inventory item that is namedMassive Mana Charge
wobjectfindininventorybynamerx
Gets a worldobject representing the first inventory item matching name regex, or 0 if none was found
Parameters:
- Param #0: namerx (string) - name regex to filter by
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindininventorybynamerx[`Massive.*`]
- Returns a worldobject of the first inventory item that matches regexMassive.*
wobjectgetselection
Gets a worldobject representing the currently selected object
Returns: WorldObject - Returns a worldobject representing the currently selected object, or 0 if none
Examples:
wobjectgetselection[]
- Returns a worldobject representing the currently selected object
wobjectgetplayer
Gets a worldobject representing the current player
Returns: WorldObject - Returns a worldobject representing the current player
Examples:
wobjectgetplayer[]
- Returns a worldobject representing the current player
wobjectfindnearestbynameandobjectclass
Gets a worldobject representing the first object matching objectclass and name regex, or 0 if none was found
Parameters:
- Param #0: objectclass (number) - objectclass to filter by
- Param #1: namerx (string) - name regex to filter by
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindnearestbynameandobjectclass[24,`Crash.*`]
- Returns a worldobject of the first object found matching objectlass 24 (player) and name regexCrash.*
wobjectfindbyid
Gets a worldobject representing the object with the passed id
Parameters:
- Param #0: id (number) - object id to find
Returns: WorldObject - Returns a worldobject
Examples:
wobjectfindbyid[123412]
- Returns a worldobject of the object with id 123412
wobjectgetopencontainer
Gets a worldobject representing the currentlty opened container, or 0 if none
Returns: WorldObject - Returns a worldobject representing the currently opened container
Examples:
wobjectgetopencontainer[]
- Returns a worldobject representing the currently opened container
getfreeitemslots
Gets the number of free item slots in a container
Parameters:
- Param #0: container (WorldObject) - Optional container to get free item slots of, defaulting to player.
Returns: number - Returns the number of free slots of container, or -1 if the WorldObject was invalid
Examples:
getfreeitemslots[]
- Returns the free item slots of the playergetfreeitemslots[wobjectgetselection[]]
- Returns the free item slots of the selected object
getfreecontainerslots
Gets the number of free container slots
Parameters:
- Param #0: container (WorldObject) - Optional container to get free item slots of, defaulting to player.
Returns: number - Returns the number of free container slots, or -1 if the WorldObject was invalid
Examples:
getfreecontainerslots[]
- Returns the free container slots of the playergetfreecontainerslots[wobjectgetselection[]]
- Returns the free container slots of the selected object
getcontaineritemcount
Gets the number of items in a container
Parameters:
- Param #0: container (WorldObject) - Optional container to get number of items in, defaulting to player.
Returns: number - Returns the number of items in a container, or -1 if the WorldObject was invalid
Examples:
getcontaineritemcount[]
- Returns the used container slots of the playergetcontaineritemcount[wobjectgetselection[]]
- Returns the number of items in the selected item
wobjectfindall
Gets a list of all worldobjects known by the client
Returns: List - Returns a list of all worldobjects
Examples:
wobjectfindall[]
- Returns a list of all wobjects
wobjectfindallinventory
Gets a list of all worldobjects in the players inventory
Returns: List - Returns a list of all worldobjects in the player inventory
Examples:
wobjectfindallinventory[]
- Returns a list of all your inventory wobjects
wobjectfindalllandscape
Gets a list of all worldobjects in the landscape
Returns: List - Returns a list of all worldobjects in the landscape
Examples:
wobjectfindalllandscape[]
- Returns a list of all landscape wobjects
wobjectfindallbyobjectclass
Gets a list of all worldobjects of the passed objectclass
Parameters:
- Param #0: objectclass (number) - objectclass to filter by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindallbyobjectclass[24]
- Returns a list of all players the client is aware of
wobjectfindallbytemplatetype
Gets a list of all wobjects matching templatetype
Parameters:
- Param #0: templatetype (number) - templatetype to filter by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindallbytemplatetype[9060]
- Returns a list of worldobjects that are a Titan Mana Charge (template type 9060)
wobjectfindallbynamerx
Gets a list of all wobjects matching the passed regular expression
Parameters:
- Param #0: namerx (string) - regular expression to filter name by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindallbynamerx[`Crash.*`]
- Returns a list of all worldobjects that match the regexCrash.*
wobjectfindallinventorybyobjectclass
Gets a list of all inventory worldobjects of the passed objectclass
Parameters:
- Param #0: objectclass (number) - objectclass to filter by
Returns: List - Returns a list of all matching worldobjects
Examples:
wobjectfindallinventorybyobjectclass[16]
- Returns a list of all mana stones in the players inventory