Skip to content

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.

coroutine, table, string, utf8, math, bit32, os (time and date only), buffer and vector.

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.

print(...) is the same as swizzin.log(...). Output goes to the Script Console, not to a chat window.

Everything SwizzinIRC-specific is under the global table swizzin. See the API reference for every function.

--! name: Greeter
--! api: 1
--! permissions: send
swizzin.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.

  • swizzin.wildmatch(pattern, text) returns true when text matches 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.