diff --git a/LUA_API.rst b/LUA_API.rst index d9488d60f..938664379 100644 --- a/LUA_API.rst +++ b/LUA_API.rst @@ -598,6 +598,14 @@ 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. +* ``dfhack.isWorldLoaded()`` + + Checks if the world is loaded. + +* ``dfhack.isMapLoaded()`` + + Checks if the world and map are loaded. + * ``dfhack.TranslateName(name[,in_english,only_last_name])`` Convert a language_name or only the last name part to string. @@ -950,6 +958,18 @@ Core context specific functions: Boolean value; *true* in the core context. +* ``dfhack.timeout(time,mode,callback)`` + + Arranges for the callback to be called once the specified + period of time passes. The ``mode`` argument specifies the + unit of time used, and may be one of ``'frames'`` (raw FPS), + ``'ticks'`` (unpaused FPS), ``'days'``, ``'months'``, + ``'years'`` (in-game time). All timers other than + ``'frames'`` are cancelled when the world is unloaded, + and cannot be queued until it is loaded again. + Returns the timer id, or *nil* if unsuccessful due to + world being unloaded. + * ``dfhack.onStateChange.foo = function(code)`` Event. Receives the same codes as plugin_onstatechange in C++. diff --git a/Lua API.html b/Lua API.html index 40706d14f..b96d12156 100644 --- a/Lua API.html +++ b/Lua API.html @@ -855,6 +855,12 @@ 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.