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 {
dfhack.getOSType()
+Returns the OS type string from symbols.xml.
+dfhack.getDFVersion()
+Returns the DF version string from symbols.xml.
+dfhack.getDFPath()
+Returns the DF directory path.
+dfhack.getHackPath()
+Returns the dfhack directory path, i.e. ".../df/hack/".
+dfhack.isWorldLoaded()
Checks if the world is loaded.
These functions are intended for the use by dfhack developers, +and are only documented here for completeness:
+dfhack.internal.getAddress(name)
+Returns the global address name, or nil.
+dfhack.internal.setAddress(name, value)
+Sets the global address name. Returns the value of getAddress before the change.
+dfhack.internal.getBase()
+Returns the base address of the process.
+dfhack.internal.getMemRanges()
+Returns a sequence of tables describing virtual memory ranges of the process.
+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 timerAn 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.
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.
-- cgit v1.2.1