P

PlayMUD.online

Lua roadmap

Automation Architecture

Lua is the power layer beneath simple UI tools.

The goal is not to delete the current trigger, alias, and variable UI. The goal is to make those tools easy mode while Lua powers advanced behavior.

Two Layers

Persistent settings stay in the server database: triggers, aliases, scripts, saved variables, hotkeys, and UI state.

Runtime automation state is shared by browser-side Lua while connected: temporary variables, counters, combat state, and event handlers. It is not written to MariaDB.

Current API

send(command)
echo(text)
vars.name = value
state.name = value
highlight(fg, bg)
gauge.create(id, options)
status.create(id, options)

Helper Example

function captureTarget(text)
  local target = string.match(text, "^You are now fighting (.+)%.$")
  if target then
    vars.target = target
    echo("Target set to " .. vars.target)
  end
end

Put reusable helpers in Lua Scripts, then call them from Lua triggers or Lua aliases.

Echo Color Tags

Lua echo() supports readable inline tags such as <green>, <bg:#202000>, and <#12FA00>.

See Echo Colors for the tag syntax and named color list.

Safety Decisions

  • Lua runs in isolated browser workers with CPU and action limits.
  • Scripts cannot access the DOM, network, browser storage, or unrestricted operating-system APIs.
  • Persistent variables autosave; temporary state does not.
  • A runtime error disables only its responsible trigger, alias, or script validation and appears in Activity.