Fixed a number of spelling and grammatical errors. Should be set now. Added better examples and removed redundant words.

develop
Gabe Rau 2021-03-20 15:49:53 -06:00
parent 374fc763eb
commit cc376eeb55
1 changed files with 8 additions and 15 deletions

@ -4415,29 +4415,22 @@ 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
than ``dfhack.run_script()`` for Lua scripts. than ``dfhack.run_script()`` for Lua scripts.
* ``dfhack.script_help([name, [extension]])`` * ``dfhack.script_help([name, [extension]])``
Returns the contents of the embedded documentation of the specified script. Returns the contents of the embedded documentation of the specified script.