|
|
@ -4415,24 +4415,17 @@ General script API
|
|
|
|
command-line. The ``name`` argument should be the name of the script without
|
|
|
|
command-line. The ``name`` argument should be the name of the script without
|
|
|
|
its extension, as would be used on the command line.
|
|
|
|
its extension, as would be used on the command line.
|
|
|
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
Example:
|
|
|
|
dfhack.run_script("armoks-blessing", "all")
|
|
|
|
|
|
|
|
Scipts that use a dash(``-``) in their arguments still require one when called
|
|
|
|
|
|
|
|
from ``dfhack.run_script``.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
dfhack.run_script("gaydar", "-all")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unlike ``dfhack.run_command``, ``dfhack.run_script`` allows a different
|
|
|
|
In DFHack prompt::
|
|
|
|
different script to be executed and its value passed as an argument to the main
|
|
|
|
|
|
|
|
function called by ``dfhack.run_script``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
repeat -time 14 -timeUnits days -command [ workorder ShearCreature ] -name autoShearCreature
|
|
|
|
dfhack.run_script("some_script", dfhack.gui.getDwarfmodeViewDims());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
While this implmenation is currently a functional, its purpose and stability
|
|
|
|
In lua script::
|
|
|
|
are limited. As such, ``dfhack.reqscript(name)`` should be used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note that the ``dfhack.run_script()`` function allows Lua errors propagate to the caller.
|
|
|
|
dfhack.run_script("repeat", "-time", "14", "-timeUnits", "days", "-command", "[", "workorder", "ShearCreature", "]", "-name", "autoShearCreature")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note that the ``dfhack.run_script()`` function allows Lua errors to propagate to the caller.
|
|
|
|
|
|
|
|
|
|
|
|
To run other types of commands (such as built-in commands, plugin commands, or
|
|
|
|
To run other types of commands (such as built-in commands, plugin commands, or
|
|
|
|
Ruby scripts), see ``dfhack.run_command()``. Note that this is slightly slower
|
|
|
|
Ruby scripts), see ``dfhack.run_command()``. Note that this is slightly slower
|
|
|
|