Lua
Use lightweight Lua scripts for fast, simple automation logic.
Overview
Lua scripts run inside the FaustBot scripting runtime and can call any CPH API method available to actions and triggers.
Setup
- Enable the Lua scripting plugin in settings.
- Create a new script action and select Lua as the language.
- Use the CPH API for integrations, triggers, and variables.
Examples
Basic Lua script
-- Read a variable and send a message
local user = args["user"]
local points = CPH.GetUserVar(user, "points", 0)
CPH.SendMessage(user .. " has " .. points .. " points")See the getting started guide for multi-language examples.
Tips
- Keep scripts focused and reusable for easier maintenance.
- Use variables to share state across actions.
- Log outputs during testing to validate results.