From 8d7cf092fd6f3f1cf68e6b48b8f3dc42ef40dcfa Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 13 Jun 2012 21:12:36 +0400 Subject: Add Lua API for access to some contextual and low-level info. --- Lua API.html | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'Lua API.html') diff --git a/Lua API.html b/Lua API.html index 568090a7..02e7abf3 100644 --- a/Lua API.html +++ b/Lua API.html @@ -345,17 +345,18 @@ ul.auto-toc {
  • Burrows module
  • Buildings module
  • Constructions module
  • +
  • Internal API
  • -
  • Core interpreter context
  • -
  • Plugins @@ -862,6 +863,18 @@ One notable difference is that these explicit wrappers allow argument count adjustment according to the usual lua rules, so trailing false/nil arguments can be omitted.

    +
    +

    Internal API

    +

    These functions are intended for the use by dfhack developers, +and are only documented here for completeness:

    + +
    -

    Core interpreter context

    +

    Core interpreter context

    While plugins can create any number of interpreter instances, there is one special context managed by dfhack core. It is the only context that can receive events from DF and plugins.

    @@ -1307,7 +1339,7 @@ Using timeout_active(id,nil) cancels the timer
  • -

    Event type

    +

    Event type

    An event is just a lua table with a predefined metatable that contains a __call metamethod. When it is invoked, it loops through the table with next and calls all contained values. @@ -1333,14 +1365,14 @@ order using dfhack.safecall.

    -

    Plugins

    +

    Plugins

    DFHack plugins may export native functions and events to lua contexts. They are automatically imported by mkmodule('plugins.<name>'); this means that a lua module file is still necessary for require to read.

    The following plugins have lua support.

    -

    burrows

    +

    burrows

    Implements extended burrow manipulations.

    Events:

    -

    sort

    +

    sort

    Does not export any native functions as of now. Instead, it calls lua code to perform the actual ordering of list items.

    -- cgit v1.2.1