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.

Below is a list of all expression functions implemented in UtilityBelt.

sin[number d]

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[number d]

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[number d]

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[number d]

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[number d]

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.

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

wobjectfindnearestbytemplatetype[number templatetype]

Attempted to find the nearest landscape world object with the specified template type

Parameters:

  • Param #0: templatetype (number) - templatetype to filter by

Returns: wobject - Returns a worldobject

Examples:

  • wobjectfindnearestbytemplatetype[42137] - Returns a worldobject with templaye type 42137 (level 10 ice tachi warden)

wobjectgetintprop[wobject obj, number property]

Returns an int property from a specific world object, or 0 if it’s undefined

Parameters:

  • Param #0: obj (wobject) - World object to get intproperty 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

getheadingto[wobject obj]

Calculates the heading in degrees (0-360 clockwise, 0 is north) from your player to the target object

Parameters:

  • Param #0: obj (wobject) - 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

getheading[wobject obj]

Returns the heading in degrees (0-360 clockwise, 0 is north) the target object is facing

Parameters:

  • Param #0: obj (wobject) - 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

acos[number d]

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[number d]

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[number d]

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[number y, number x]

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[number d]

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[number d]

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.

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[number iterator]

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[number iterator]

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:

  • getfellowshipmembercount[] - 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

wobjectgethealth[number obj]

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 (number) - 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[string name]

Counts how many items you have in your inventory exactly matching name. Stack sizes are counted

Parameters:

  • 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[string namerx]

Counts how many items you have in your inventory matching regex namerx. Stack sizes are counted

Parameters:

  • 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

actiontrygiveprofile[string lootprofile, string target]

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

testquestflag[string questflag]

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[string questflag]

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[string questflag]

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[string questflag]

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

randint[number min, number max]

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[number number]

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 of 2

strlen[number tocheck]

Gets the length of a string

Parameters:

  • Param #0: tocheck (number) - string to check

Returns: number - Returns the length of tocheck string

Examples:

  • strlen[test] - Returns a length of 4

getobjectinternaltype[number tocheck]

Gets internal type of an object, as a number

Parameters:

  • Param #0: tocheck (number) - object to check

Returns: number - Values are: 0=none, 1=number, 3=string, 7=object

Examples:

  • getobjectinternaltype[test] - Returns a length of 4

cstrf[number number, string format]

Converts a number to a string using a specified format

Parameters:

Returns: string - formatted string, from a number

Examples:

  • cstrf[3.14159,`N3`] - Formats 3.14159 to a string with 3 decimal places

cnumber[string number]

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`] - Converts 3.14159 to a number

floor[number number]

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[number number]

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[number number]

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[number number]

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[string state]

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 to myState

ord[string character]

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[number character]

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] - Converts 99 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[stopwatch watch]

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[stopwatch watch]

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[stopwatch watch]

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)

testvar[string varname]

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 if myvar variable is defined

getvar[string varname]

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 in myvar variable

setvar[string varname, object value]

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 value 1 inside of myvar variable

touchvar[string varname]

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 that myvar has a value set

clearallvars[]

Unsets all variables

Returns: number - Returns 1

Examples:

  • clearallvars[] - Unset all variables

clearvar[string varname]

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 in myvar variable

testpvar[string varname]

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 if myvar persistent variable is defined

getpvar[string varname]

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:

  • getpvar[myvar] - Returns the value stored in myvar variable

setpvar[string varname, object value]

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 value 1 inside of myvar variable

touchpvar[string varname]

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 that myvar has a value set

clearallpvars[]

Unsets all persistent variables

Returns: number - Returns 1

Examples:

  • clearallpvars[] - Unset all persistent variables

clearpvar[string varname]

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 in myvar persistent variable

testgvar[string varname]

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 if myvar global variable is defined

getgvar[string varname]

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 in myvar global variable

setgvar[string varname, object value]

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 value 1 inside of myvar variable

touchgvar[string varname]

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 that myvar global variable has a value set

clearallgvars[]

Unsets all global variables

Returns: number - Returns 1

Examples:

  • clearallgvars[] - Unset all global variables

cleargvar[string varname]

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 in myvar global variable

chatbox[string message]

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[string message]

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] - pastes test to the chatbox, without sending

echo[string message, number color]

Echos chat to the chatbox with a color. Use /ub printcolors to view all colors

Parameters:

  • 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[number property]

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[number property]

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[number property]

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[25] - Returns your character’s TotalExperience

getcharboolprop[number property]

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[number property]

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[number spellId]

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[number spellId]

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[number spellId]

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

getcharvital_base[number vitalId]

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[number vitalId]

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[number vitalId]

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[number skillId]

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[number skillId]

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[number skillId]

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

getplayerlandcell[]

Gets the landcell your character is currently standing in, including the landblock

Returns: number - Returns the landcell your character is currently standing in, including the landblock

Examples:

  • getplayerlandcell[] - Returns your character’s current landblock as in int

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[coordinates obj]

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[coordinates obj]

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[coordinates obj]

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[coordinates obj]

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, eg 1.2N, 34.5E

coordinateparse[string coordstring]

Converts a coordinate string like 1.2N, 3.4E to a coordinates object

Parameters:

  • Param #0: coordstring (string) - coordinates string to parse

Returns: coordinates - Returns a coordinates object

Examples:

  • coordinateparse[`1.2N, 3.4E`] - Returns a coordinates object representing 1.2N, 3.4E

coordinatedistancewithz[coordinates obj1, coordinates obj2]

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 between 1.2N, 3.4E and 5.6N, 7.8E

coordinatedistanceflat[coordinates obj1, coordinates obj2]

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 between 1.2N, 3.4E and 5.6N, 7.8E (ignoring Z)

wobjectgetphysicscoordinates[wobject wo]

Gets a coordinates object representing a world objects current position

Parameters:

  • Param #0: wo (wobject) - 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[wobject wo]

Gets the name string of a wobject

Parameters:

  • Param #0: wo (wobject) - world object to get the name of

Returns: string - Returns a string of wobject’s name

Examples:

  • wobjectgetname[wobjectgetplayer[]] - Returns a coordinates object representing the current player’s position

wobjectgetid[wobject wo]

Gets the id of a wobject

Parameters:

  • Param #0: wo (wobject) - 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[wobject wo]

Gets the objectclass as a number from a wobject

Parameters:

  • Param #0: wo (wobject) - 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[wobject wo]

Gets the template type as a number from a wobject

Parameters:

  • Param #0: wo (wobject) - 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[wobject wo]

Checks if a door wobject is open

Parameters:

  • Param #0: wo (wobject) - 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: wobject - 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: wobject - Returns a worldobject representing the nearest door

Examples:

  • wobjectfindnearestdoor[] - Returns a worldobject representing the nearest door

wobjectfindnearestbyobjectclass[number objectclass]

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: wobject - Returns a worldobject representing the nearest matching objectclass

Examples:

  • wobjectfindnearestbyobjectclass[24] - Returns a worldobject of the nearest matching objectclass

wobjectfindininventorybytemplatetype[number templatetype]

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: wobject - Returns a worldobject

Examples:

  • wobjectfindininventorybytemplatetype[9060] - Returns a worldobject of the first inventory item that is a Titan Mana Charge (template type 9060)

wobjectfindininventorybyname[string name]

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: wobject - Returns a worldobject

Examples:

  • wobjectfindininventorybyname[Massive Mana Charge] - Returns a worldobject of the first inventory item that is named Massive Mana Charge

wobjectfindininventorybynamerx[string namerx]

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: wobject - Returns a worldobject

Examples:

  • wobjectfindininventorybynamerx[`Massive.*`] - Returns a worldobject of the first inventory item that matches regex Massive.*

wobjectgetselection[]

Gets a worldobject representing the currently selected object

Returns: wobject - 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: wobject - Returns a worldobject representing the current player

Examples:

  • wobjectgetplayer[] - Returns a worldobject representing the current player

wobjectfindnearestbynameandobjectclass[string objectclass, string namerx]

Gets a worldobject representing the first object matching objectclass and name regex, or 0 if none was found

Parameters:

  • Param #0: objectclass (string) - objectclass to filter by
  • Param #1: namerx (string) - name regex to filter by

Returns: wobject - Returns a worldobject

Examples:

  • wobjectfindnearestbynameandobjectclass[24,`Crash.*`] - Returns a worldobject of the first object found matching objectlass 24 (player) and name regex Crash.*

wobjectfindbyid[number id]

Gets a worldobject representing the object with the passed id

Parameters:

  • Param #0: id (number) - object id to find

Returns: wobject - 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: wobject - Returns a worldobject representing the currently opened container

Examples:

  • wobjectgetopencontainer[] - Returns a worldobject representing the currently opened container

actiontryselect[string obj]

Attempts to select a worldobject

Parameters:

  • Param #0: obj (string) - wobject to select

Returns: number - Returns 0

Examples:

  • actiontryselect[wobjectgetplayer[]] - Attempts to select the current player

actiontryuseitem[string obj]

Attempts to use a worldobject

Parameters:

  • Param #0: obj (string) - wobject to try to use

Returns: number - Returns 0

Examples:

  • actiontryuseitem[wobjectgetplayer[]] - Attempts to use the current player (opens backpack)

actiontryapplyitem[string useObj, string onObj]

Attempts to use a worldobject on another worldobject

Parameters:

  • Param #0: useObj (string) - wobject to use first
  • Param #1: onObj (string) - 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[string give, string destination]

Attempts to give a worldobject to another worlobject, like an npc

Parameters:

  • Param #0: give (string) - wobject to give
  • Param #1: destination (string) - 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[number spellId]

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[number spellId, wobject target]

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 (wobject) - 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[string key, string value]

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 key test to my value

statushudcolored[string key, string value, number color]

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 key test to my value in red

isfalse[number value]

Checks if a value is equal to false (0)

Parameters:

  • Param #0: value (number) - 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[number value]

Checks if a value is equal to true (1)

Parameters:

  • Param #0: value (number) - 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[number value, object truevalue, object falsevalue]

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 second argument

Parameters:

  • Param #0: value (number) - 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