Lua · Useful information
The Lua page
Everything about scripts lives in one place: the Lua tab of the menu. Script UI never appears anywhere else.
Tabs
The row at the top has a Scripts tab, then one tab per script. A script with an error shows a warning icon on its tab.
Scripts tab
- New Script: makes a file from the template and opens it in the editor.
- From Clipboard: imports copied code as a new file.
- Folder: opens the scripts folder in Explorer.
- The list: switch a script on or off, open its page, edit, reload, or delete it. Delete moves the file to the Recycle Bin after you confirm.
- CONSOLE: every script's output. Click a line to copy it; hover to see a long line in full.
A script's tab
| Section | What is in it |
|---|---|
SCRIPT | Running or stopped, the error box (with Copy and Edit) when it failed, the script's ui.* settings, and its own page from on_menu. |
MANAGE | Name, version, author and description from the header, the script's frame time, and Rename, Duplicate, Move up and Move down. |
PERMISSIONS | Tick boxes for settings, chat and network. A permission the header asks for is marked. |
CONSOLE | Only this script's lines. |
Frame time is how long the script's callbacks took per frame, averaged. Keep it well under 1 ms.
Rename and Duplicate carry the settings values and permissions with the script. Load order (Move up / down) decides which script draws first.
Editor
The editor is the shared notepad window with line numbers.
| Key or button | Does |
|---|---|
Ctrl+S / Save | Saves the file and reloads the script at once. |
Tab | Indents. |
External Editor | Opens the file in your own editor (VS Code, Notepad++). Saving there reloads it within a second. |
Copy | Copies the whole script. |
The status line shows line and column, the line count, and whether there are unsaved changes.
Console
Lines are tagged with the script's name. Besides your print output you will see:
loaded, with the current setting values;error: …when the script stopped;needs permission: X, allow it on the script page, once per permission;menu: Label = valuewhen a page widget changed;set aim.rcs = trueafterconfig.setsettles;Label = valueafter aui.*setting was changed.