The Lua library
Scripts see a restricted subset of Lua 5.4's standard library. The lists below are the functions the host actually exposes (from docs-src/api-inventory.txt, generated by the overlay's test run). For how they behave, see the Lua 5.4 manual; for what was removed and why, see what this Lua has and lacks.
Base functions#
assert, collectgarbage (modes "count", "collect", "step" only), error, getmetatable, ipairs, load (source text only, never bytecode), next, pairs, pcall, print (writes to the script's console), rawequal, rawget, rawlen, rawset, require, select, setmetatable, tonumber, tostring, type, unpack, xpcall, plus the values _G and _VERSION.
pcall, xpcall and coroutine.resume re-raise the host's time-budget error instead of swallowing it.
string#
byte, char, find, format, gmatch, gsub, len, lower, match, pack, packsize, rep, reverse, sub, unpack, upper. Pattern matching is limited to 8 million steps per call.
table#
concat, insert, move, pack, remove, sort, unpack.
math#
abs, acos, asin, atan, ceil, cos, deg, exp, floor, fmod, huge, log, max, maxinteger, min, mininteger, modf, pi, rad, random, randomseed, sin, sqrt, tan, tointeger, type, ult, and the overlay's additions clamp, lerp, round, sign, remap.
utf8#
char, charpattern, codepoint, codes, len, offset.
coroutine#
close, create, isyieldable, resume, running, status, wrap, yield. Prefer task, which the host resumes for you.
os#
clock, date, time only. Use os.date("%H:%M", time.wall()) to format the real time.
Not available#
io, package, debug, loadfile, dofile, string.dump, ffi, os.execute, os.remove, os.getenv, os.exit and the rest of os. See the gaps page for the consequences.