Skip to content
Camoy edited this page Oct 12, 2012 · 6 revisions

Convention

Each table in the API consists of:

  • A create method, which will create a new version of that object.
  • Objects are tables that have __index set to the table of that type, and contain only 2 fields (ptr and type), related to implementation.
  • The table contains a function called getType() which returns the name of the type as a string.
  • The table contains a function called isA() which will return true if the object is or inherets directly or indirectly from the given string type.
  • The table's __call is set to create

Any additions to the table are noted in the documentation for that type.

API

Script

Table name: script

  • script:fromSource(source) - Loads a script from the provided source string.
  • script:fromFile(file) - Loads a script from the provided file name.
  • script:run() - Runs a script in its own Lua state.

Examples

Simple Script Usage

local s = script();
s:fromFile("test.lua");
s:run();
Clone this wiki locally