Console
Per-runtime console buffer. The dashboard's "Console" pane reads from the same ConsoleHandle, so anything pushed here surfaces in the UI in real time. FIFO-evicted at 2 000 entries by default to bound memory for long-running scripts.
local client = getClient()
local console = client:console() -- or getConsole()
console:clear()
console:add("your own message") -- same as print(...)
for i, entry in pairs(console.entries) do
print("{} {} {}", entry.timestamp, entry.type, entry.content)
end
Constructors
getConsole()
| Field | Type |
|---|---|
| Signature | () → Console |
| Returns | Console — runtime's shared console handle |
| Async | no |
Doesn't require a parent client.
client:console()
| Field | Type |
|---|---|
| Signature | (self: Client) → Console |
| Returns | Console — same buffer getConsole() reads from |
| Async | no |
Fields
console.entries
| Field | Type |
|---|---|
| Signature | Console.entries: {ConsoleEntry} |
| Returns | {ConsoleEntry} — 1-indexed snapshot of every entry currently in the buffer |
Snapshot at access time — re-read to see new pushes.
for i, entry in pairs(console.entries) do
print(entry.timestamp, entry.type, entry.content)
end
Methods
console:clear()
| Field | Type |
|---|---|
| Signature | (self: Console) → () |
| Returns | nothing |
| Async | no |
Wipe every entry. Used by the dashboard's "Clear" button and by :scripting():execute() between runs (fresh runtime, fresh console).
console:add(msg)
| Field | Type |
|---|---|
| Signature | (self: Console, msg: string) → () |
| Returns | nothing |
| Async | no |
Push a single "info"-tagged entry. Equivalent to print(msg) but without the multi-arg join — pass the already-formatted string.
ConsoleEntry fields
| Field | Type | Notes |
|---|---|---|
timestamp | number | Wall-clock epoch milliseconds when the entry was pushed. |
type | string | Free-form tag — "info" for print() and console:add(), "error" for raised errors. |
content | string | Rendered content as a single string. Multi-arg print(a, b, c) already gets joined upstream. |
print(...)
| Field | Type |
|---|---|
| Signature | (...: any) → () |
| Returns | nothing |
| Async | no |
Override of Lua's stock print. Pushes one "info"-tagged entry to the runtime console — same buffer getConsole() and getLogs() read from. No stdout output.
{} placeholders in the first string argument get interpolated with the remaining args:
print("walked to {} {} in {}s", x, y, elapsed)
When no {} placeholders are present, args are space-joined via tostring() — same convention as Lua's built-in print.