> For the complete documentation index, see [llms.txt](https://anubiswiki.flyffbot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anubiswiki.flyffbot.com/lua-scripting.md).

# Lua Scripting

## Lua Scripting Tab Function Reference

This table describes each user-facing function in the Lua Scripting tab.

**API Reference:** <https://flyffbot.net/AnubisLuaScriptReference>

| Section           | Function                     | Control Type    | What It Does                                                                                               | Notes                                                                                |
| ----------------- | ---------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Cursor helper     | Click cursor x/y             | Status text     | Shows the current click cursor position inside the game window, or the last known in-game window position. | Shows unavailable if no valid cursor position is known.                              |
| Position helper   | Copy Current Player Position | Button          | Copies the current player position as a Lua table: { x = ..., y = ..., z = ... }.                          | Shows a top-display message if the position is unavailable or invalid.               |
| Script management | Script name                  | Text input      | Sets the name used when saving or selecting a Lua script.                                                  | Invalid filename characters are replaced with underscores.                           |
| Script management | Saved scripts                | Combo box       | Lists saved Lua scripts from the AppData OfficialFlyff LuaScripts folder.                                  | The list is sorted alphabetically.                                                   |
| Script management | Save Script                  | Button          | Saves the current editor text as a .lua file using the script name.                                        | Creates the LuaScripts folder if needed.                                             |
| Script management | Load Script                  | Button          | Loads the selected saved Lua script into the editor.                                                       | Shows a message if no script is selected or the file is missing.                     |
| Script management | Delete Script                | Button          | Deletes the selected saved Lua script file.                                                                | Refreshes the saved script list afterwards.                                          |
| Script management | Refresh                      | Button          | Reloads the saved Lua script list from disk.                                                               | Useful after external file changes.                                                  |
| Reference         | Open API Reference           | Button          | Opens the online Anubis Lua Script Reference in the browser.                                               | [API Reference](https://flyffbot.net/AnubisLuaScriptReference)                       |
| Execution         | Execute                      | Button          | Runs the current Lua editor content through the embedded Lua VM.                                           | If the Lua VM is already running, the tab shows an error instead.                    |
| Execution         | CTRL+C stop overlay          | Hotkey behavior | When a Lua script is running, the overlay tells you to press CTRL+C to stop the running script.            | The menu does not render normal tabs while a script is running.                      |
| Editor            | Lua Editor                   | Code editor     | Provides a Lua syntax-highlighted editor for writing scripts.                                              | Starts with an example script that logs nearby monsters and targets the nearest one. |
