Lua scripting for wolfhack
Scripts are small Lua programs that add pages, windows, widgets, drawing, themes and tools to the wolfhack overlay. You write a text file, install it on the Scripts page of the overlay menu, switch it on, and it runs inside the overlay, every frame, until you switch it off.
This documentation describes API 1.1. Every function and example in it corresponds to what the overlay's script host really exposes; anything that is missing is listed on the gaps page instead of being promised.
Start here#
- New to scripts? Follow your first script: create a file, install it, switch it on, edit it and reload it.
- New to Lua? The beginner's guide teaches the parts of Lua that scripts use, with small examples.
- Know Lua already? Skim common knowledge for how the host runs your code, then use the API reference.
- Want something working to copy? The example scripts are complete, downloadable and tested against the real script host.
What a script can do#
| Area | What you get | Where |
|---|---|---|
| Interface | Tabs, cards and controls on the Scripts page; floating windows; draggable overlay widgets | ui |
| Drawing | Lines, shapes, text, images, gradients, shaders and a small 3D mesh on the overlay | draw, assets |
| Game data | Copies of what the overlay has read: the local player, players, bomb, dropped items, grenades | data, game data |
| Time | Frame events, timers, coroutine tasks, animation helpers | events, timer, task, anim |
| Settings | A saved key/value store and a private data folder | store, file |
| System | Media session, menu themes, key state, HTTPS requests | media, theme, input, net |
| Game memory | Reading, and with explicit permission writing, the game's memory (API 1.1) | mem |
How safe is it?#
A script runs inside the overlay's own process in a restricted Lua interpreter: no io, no os.execute, no debug, no package, no FFI, no DLLs, no bytecode. Every call into a script has a time budget and the interpreter has a memory cap. That limits what an honest bug can do to the overlay. It is not an operating-system sandbox, and it does not make a malicious script harmless: install only scripts you have read or trust. The permissions guide explains what each permission lets a script do and what the limits are.
About this documentation#
Pages are generated from structured source files, searched in your browser (press /), and checked against the host: docs-src/api-inventory.txt is a list of every function the host exposes, and the build refuses to publish an API page that documents something the host does not have. Each API entry shows the version that introduced it and the permission it needs.