Introduction
Welcome to the xiao Lua documentation.
Scripts run in an embedded LuaJIT 2.1 VM inside the client. The pages on the left list every function a script can call, with its exact signature, its behaviour and an example.
Usage
Every custom API lives under the global xiao table: xiao.paint, xiao.packet, xiao.fs... The standard Lua
libraries keep their usual global names (math, string, table, os, bit, coroutine, debug).
local paint = xiao.paint
local red = paint.color.rgb(255, 0, 0)
local white = paint.color.rgb(255, 255, 255)
local black = paint.color.rgb(0, 0, 0)
paint.listener.add("hello", function(width, height)
paint.circle.filled(paint.point.vector2(width / 2, height / 2), red, 60)
paint.text.center(paint.point.vector2(width / 2, height / 2 - 8), "bonjour", white, black)
end)
Open the Lua tab, paste this script and press Execute: a red circle with bonjour appears in the middle of the
screen. Clear VM removes it. See Running scripts for the editor, the console and the time limits.
local paint = xiao.paint is only a shortcut: paint.circle.filled and xiao.paint.circle.filled are the same
function. The shortcut also saves two table lookups per call.
Sandbox
Scripts cannot reach the disk or the system outside C:\xiaohook.