Lua scripts
cap_lua manages a sandboxed Lua root (demo: /fatfs/scripts/), exposing tools to list, edit, and run scripts synchronously or asynchronously. Paths are validated—only .lua files under the root run.
Which native hooks scripts can call (GPIO, delays, publishing events to the router, …) depends on registered lua_module_* modules. claw_event_router’s run_script action can also launch Lua without the LLM.
basic_demo comes with several example scripts:
camera_preview_demo.lua: demonstrates combined usage ofcamera,display,board_manager, anddelay.system_demo.lua: demonstrates reading time, uptime, IP, and memory/Wi‑Fi information from thesystemmodule.clock_dial_demo.lua/flappybird.lua: comprehensive demos of display rendering and script interaction.
cap_lua Tool list, async execution, and automation run_script
Lua extension modules lua_module_* registration and native APIs inside scripts