Luau fundamentals for SwizzScript
SwizzScript scripts are written in Luau, a Lua-based language. This page lists what is available inside the SwizzScript sandbox. For the language itself, see the Luau documentation at https://luau.org.
Available libraries
Section titled “Available libraries”coroutine, table, string, utf8, math, bit32, os (time and date only), buffer and vector.
Removed for safety
Section titled “Removed for safety”require, load, loadstring, dofile, loadfile, collectgarbage, getfenv, setfenv, newproxy, debug, io and package.
Scripts cannot read or write files, run programs, open sockets, or load other scripts.
Printing
Section titled “Printing”print(...) is the same as swizzin.log(...). Output goes to the Script Console, not to a chat window.
The swizzin table
Section titled “The swizzin table”Everything SwizzinIRC-specific is under the global table swizzin. See the API reference for every function.
A first example
Section titled “A first example”--! name: Greeter--! api: 1--! permissions: sendswizzin.on("join", function(e) swizzin.send(e.target, "Welcome, " .. e.nick .. "!")end)This does nothing until you turn the script on and approve the send permission. By default a script does not see your own events, so it will not greet you when you join.
Useful helpers
Section titled “Useful helpers”swizzin.wildmatch(pattern, text)returns true whentextmatches a pattern using*and?(case-insensitive).swizzin.strip(text)removes IRC colours and formatting.swizzin.networks()lists your networks as{id, name, state, nick}.swizzin.me(network?)returns your nickname on a network.