Difference between revisions of "Meta Expressions"

From VirindiPlugins
Jump to: navigation, search
m
m (Function Information)
Line 269: Line 269:
 
<div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest door, or false if no doors are visible.<br>
 
<div class="mw-collapsible-content">'''Description''': Returns a world object for the nearest door, or false if no doors are visible.<br>
  
'''Parameter count''': 0</div>
+
'''Parameter count''': 0
 +
 
 +
'''Example''': http://www.virindi.net/junk/door.jpg</div>
 
</div>
 
</div>
  
Line 287: Line 289:
 
'''Parameter count''': 1
 
'''Parameter count''': 1
  
'''Param 0 (Number)''': The template type number to look for.</div>
+
'''Param 0 (Number)''': The template type number to look for.
 +
 
 +
'''Example''': http://www.virindi.net/junk/expr-usingtemplates.jpg</div>
 
</div>
 
</div>
  
Line 329: Line 333:
 
'''Parameter count''': 1
 
'''Parameter count''': 1
  
'''Param 0 (WorldObject)''': The world object to attempt to select.</div>
+
'''Param 0 (WorldObject)''': The world object to attempt to select.
 +
 
 +
'''Example''': http://www.virindi.net/junk/select.jpg</div>
 
</div>
 
</div>
  
Line 436: Line 442:
 
<div class="mw-collapsible-content">'''Description''': Creates and returns a stopwatch object. Counting is not started.<br>
 
<div class="mw-collapsible-content">'''Description''': Creates and returns a stopwatch object. Counting is not started.<br>
  
'''Parameter count''': 0</div>
+
'''Parameter count''': 0
 +
 
 +
'''Example''': http://www.virindi.net/junk/stopwatch.jpg</div>
 
</div>
 
</div>
  

Revision as of 18:57, 5 January 2015

These expressions can set and retrieve variables, control chat output, and more.

This adds the "Expression" meta condition and the "Expression Action" and "Chat Expression" meta actions.

The "/vt mexec [expression]" command is used for testing these expressions

Notes

  • true is the same as 1, false is the same as 0. There are no actual booleans, just numbers.
  • There are two extra operators added since monster expressions: the ^ (xor) operator, and the ; operator. The ; operator works on any two types and simply returns the value of the first one. It has the lowest possible precedence. The idea is to use it to string together commands when you don't care about the result.
  • Unlike monster expressions, meta expressions do not trim spaces from the ends of strings.
  • Set variables persist until cleared by a command or until relog.
  • Formatting during the conversion of number to string is a string like this: http://msdn.microsoft.com/en-us/library/kfsatb94%28v=vs.110%29.aspx
  • All operator characters which occur in a string must be escaped with \
  • All numbers in a string must also be escaped.


Function Information

Expand to view details and available examples.

There are currently 48 meta functions.


[Expand]

testvar[1]

[Expand]

getvar[1]

[Expand]

setvar[2]

[Expand]

touchvar[1]

[Expand]

clearallvars[]

[Expand]

clearvar[1]

[Expand]

getcharintprop[1]

[Expand]

getchardoubleprop[1]

[Expand]

getcharquadprop[1]

[Expand]

getcharboolprop[1]

[Expand]

getcharstringprop[1]

[Expand]

getplayerlandcell[0]

[Expand]

getplayercoordinates[0]

[Expand]

coordinategetns[1]

[Expand]

coordinategetwe[1]

[Expand]

coordinategetz[1]

[Expand]

coordinatetostring[1]

[Expand]

coordinateparse[1]

[Expand]

coordinatedistancewithz[2]

[Expand]

coordinatedistanceflat[2]

[Expand]

wobjectgetphysicscoordinates[1]

[Expand]

wobjectgetname[1]

[Expand]

wobjectgetobjectclass[1]

[Expand]

wobjectgettemplatetype[1]

[Expand]

wobjectgetisdooropen[1]

[Expand]

wobjectfindnearestmonster[0]

[Expand]

wobjectfindnearestdoor[0]

[Expand]

wobjectfindnearestbyobjectclass[1]

[Expand]

wobjectfindininventorybytemplatetype[1]

[Expand]

wobjectfindininventorybyname[1]

[Expand]

wobjectfindininventorybynamerx[1]

[Expand]

wobjectgetselection[0]

[Expand]

wobjectgetplayer[0]

[Expand]

actiontryselect[1]

[Expand]

actiontryuseitem[1]

[Expand]

actiontryapplyitem[1]

[Expand]

isfalse[1]

[Expand]

istrue[1]

[Expand]

iif[3]

[Expand]

randint[2]

[Expand]

cstr[1]

[Expand]

strlen[1]

[Expand]

getobjectinternaltype[1]

[Expand]

cstrf[2]

[Expand]

stopwatchcreate[0]

[Expand]

stopwatchstart[1]

[Expand]

stopwatchstop[1]

[Expand]

stopwatchelapsedseconds[1]