Merge remote-tracking branch 'gaberau/patch-1' into develop

develop
lethosor 2021-03-20 19:15:25 -04:00
commit 3926482047
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 13 additions and 3 deletions

@ -4411,11 +4411,21 @@ General script API
* ``dfhack.run_script(name[,args...])``
Run a Lua script in hack/scripts/, as if it was started from the DFHack
Run a Lua script in hack/scripts/, as if it were started from the DFHack
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 it would be used on the command line.
Note that this function lets Lua errors propagate to the caller.
Example:
In DFHack prompt::
repeat -time 14 -timeUnits days -command [ workorder ShearCreature ] -name autoShearCreature
In Lua script::
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
Ruby scripts), see ``dfhack.run_command()``. Note that this is slightly slower