mux package

mux is the built-in server API available to every Lua module. It is supplied by the game server rather than loaded with require. Lua callbacks and commands run with the server’s #1 authority model; scripts should still use the callback context to identify the object and enactor that triggered them.

Functions

Objects and state

FunctionDescription
mux.objectCreates a validated handle for a database object.

Styled text

FunctionDescription
mux.is_printable_asciiTests whether a string contains only printable ASCII bytes.
mux.markupValidates styled-text markup.
mux.styleApplies styles described by an options table.
mux.strip_styleRemoves markup and ANSI styling.
mux.text_widthReturns the visible byte width of styled text.
mux.truncate_textTruncates styled text to a visible width.

Connections and flows

FunctionDescription
mux.notifySends a message to an object.
mux.connected_playersLists player connections visible to the normal who command.
mux.who_summaryReturns the non-privileged WHO summary.
mux.telnet_environment_hasTests whether a NEW-ENVIRON variable is defined.
mux.telnet_environment_getGets a NEW-ENVIRON variable.
mux.flow_startStarts an interactive flow on a descriptor.

Types

TypeDescription
ObjectA validated handle for a native database object.
AttributeAccess to an object’s supported native attributes.
StateTyped, persistent state in one object namespace.

Availability and limits

Runtime database operations are unavailable during @lua/check. The Lua sandbox does not expose filesystem, operating-system, debugger, FFI, coroutine, or dynamic code-loading APIs. VM memory and persistent-state limits still apply while using these functions.