Skip to main content
Libraries let scripts reuse action lists as functions. By default, place YAML files in configs/Mikting/libs/. Set libs.dir to use another location and set allowSubfolders: true to load nested files. A library file declares version: 1 and a list of functions. This example adds two numbers and leaves the result in result:
Files without version: 1 are skipped with a warning. Call a function with miktingCallFunction:
The function receives the parent variables and the supplied parameters. Its parameter scope is isolated from the caller. Only result is copied back, using the storeAs name when supplied. Other variables created by the function stay in its scope. miktingInclude { path } serves a different purpose: it runs an {actions:[...]} snippet in the caller’s shared scope. Include paths must stay inside the bot working directory. On first load, Mikting creates the default library directory and copies the bundled math.yml, strings.yml, and store.yml examples from resources/libs/. Existing directories and edited files are preserved. Add or change a YAML file, then run /reload to load it. /mikting-libs lists function names and parameters.

Move libraries from the old location

If an existing install uses scripting/libs/mikting/, move those files to configs/Mikting/libs/ and set:
Run /reload after changing the path. Updating the addon keeps the configured libs.dir; it does not move files for you. Documentation home · Source Markdown