IMPORTANT: THIS HAS BEEN CONVERTED FROM A MOD INTO A LIBRARY. PLEASE PLACE IT IN YOUR MODS FOLDER TO USE IT.
Added
New module structure: the file now returns a table via return M, usable with require.
Namespaced API surface — all functions live on M instead of _G. The old _G exports are gone.
4 new argument types on top of the original 5:
CMD_ARG_DURATION — parses 500ms, 5s, 2m, 1h30m, 2d into frames (30 fps). Plain numbers are treated as seconds.
CMD_ARG_COLOR — parses #rrggbb, rrggbb, or a named color (red, cyan, etc.). Returns {r, g, b, hex} with components in 0..255.
CMD_ARG_STRING_REST — rest-of-line argument, keeps commas, must be the last argument in the list.
CMD_ARG_PLAYER_LIST — a single player or @a (array of all connected MarioState).
Player selectors: @s (self), @p (nearest), @r (random) for CMD_ARG_PLAYER; @a additionally for CMD_ARG_PLAYER_LIST. Enabled via selectors = true per argument.
Optional arguments with default values.
... skip syntax — an optional argument can be explicitly bypassed at any position.
Enum support via choices = { "add", "remove", "toggle" }. Case-insensitive, normalized to the entry from choices.
min / max bounds for CMD_ARG_INTEGER and CMD_ARG_NUMBER.
Permission gating via options.permission:
"anyone" / "user" — no restriction.
"moderator" / "mod" — mods and host.
"host" / "server" / "admin" — host only.
Automatic Usage: line appended to every parse error, generated from the argument signature.
pcall protection around command bodies. On failure, the player sees a short message and the console gets the stack trace plus a dump of parsed arguments.
Registration-time validation:
CMD_ARG_STRING_REST must be the last argument.
Only one CMD_ARG_STRING_REST per command.
Mandatory arguments cannot follow optional ones.
command, description, args, func are all type-checked.
Duplicate command registration warning in the console.
Console logging helpers with color tags: log_error_console, log_warn_console.
Full LuaDoc annotations for every function, alias, and class.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.