Quickstart
Save, run, and inspect a first Lua script in the Sharp Scripts tab.
Sharp creates Atreia/Scripts in your Windows Documents folder. The Scripts tab shows the resolved folder in its tooltip. Use Refresh after adding a file if it has not appeared yet.
Start with an instant script for a one-time read. Use a module for a window, overlay, or repeated task. The script types guide explains the folder layout and how each kind runs.
Prefer to describe your idea to an AI? The step-by-step AI scripting guide covers assistant setup, MCP connections, Hello World, and testing your changes.
1. Create an instant script
Save instant/hello.lua under the resolved Scripts folder:
local name, err = game.local_name()
if not name then
log.warn(err)
return
end
log.info("Hello, " .. name)Select it in the Scripts tab and press Run. Instant scripts execute their top level and optional on_start, then close. Read the result in the tab or logs/instant_hello.log.
2. Create a persistent module
Save modules/my_overlay/main.lua:
function on_start()
log.info("My overlay loaded")
end
function on_tick(dt)
local position, err = game.local_position()
if position then
gfx.text(20, 80, string.format("X %.0f Y %.0f", position.x, position.y),
0xFFFFFFFF, 16)
end
end
function on_stop()
log.info("My overlay unloaded")
endPress Load. Edit and save the file, then Reload to use the saved version. Unload stops it. A module has its own callbacks, log, imports, and memory limit. Lifecycle explains callback timing.
3. Import a library
Use Download latest SDK in the Scripts tab before importing a shipped
library. It installs shared libraries into Scripts/lib/ without running them.
Use local sdk = require("sdk"), require("ui_sdk"), or another shipped library from a module. A module can also require("helpers") from its own folder. A file in lib/ is importable code, not a script to run directly. See bundled libraries.
Game functions can return a value or nil, error; check both values before using a result. See errors and limits.
Choose your next task
| Goal | Continue with | API to keep nearby |
|---|---|---|
| Browse ready-to-edit scripts | Example scripts | API reference |
| Display character or world information | Quest journal | Game reads and actions |
| Add a window or interactive controls | Configurable travel helper | UI SDK |
| Repeat work with pauses | Lifecycle and workers | Script API |
| Share a finished script | Script Store | Script types |