Documentation

zScript Objects

Various Lua functions return a reference to a zScript Object. There are several types of Objects (alias, variable, trigger, etc). Each one has it's own properties associated with that setting type.

However, all object references have the following common properties:

name
The name (or short IDname in some cases) of the object
index
The numeric index of the object with the list of settings. Can be used with the various "getxxx" functions to retrieve a specific object
isvalid
Returns true if the Lua object still points to a valid zScript object. If the zScript object is deleted, isvalid will return false. Use this if it is possible for the object to have been deleted since the original pointer was obtained
class
Returns the Class Object that contains the given setting.
value
Returns the value assigned to the object. This might be a script (like with an alias), or just a value (like with a variable)
enabled
Can be used to enable or disable the setting. Returns the current enabled state (true/false).
fullname
Some settings have a short name and a long name. Use this to return the long name of a setting.
priority
Returns the priority of a setting. Can be used to change the priority
comment
Sets the user-defined note/comment field for each setting as shown in the Package Editor
beginupdate()
this function prevents the object from being updated within TeSSH until a corresponding endupdate() function is called.
endupdate()
tells TeSSH that the Lua script is done changing the object and it should be refreshed within the TeSSH user interface.

Consult the sections about each specific Object type for details on object-specific properties.

Add comment

Login or register to post comments