SaveSlotCmdrUtils
Functions
formatValue
SaveSlotCmdrUtils.formatValue(value: any,depth: number?--
defaults to 3
) → string
Renders a JSON-shaped value on a single line, for console output. Tables become {a = 1, b = 2}
and arrays [1, 2], nested up to depth levels before collapsing to "...".
formatDuration
SaveSlotCmdrUtils.formatDuration(seconds: number) → stringRenders a duration in seconds as its two largest units, e.g. "1h 23m", "23m 4s", or "45s".
formatTimestamp
SaveSlotCmdrUtils.formatTimestamp(unixTime: number,now: number?) → string
Renders a unix timestamp as UTC plus how long ago it was, e.g. "2026-08-12 14:03 UTC (3 hours ago)".
The relative part is what an admin actually reads; the absolute one is what they quote back. A
timestamp ahead of now (clock skew) prints the absolute part alone. now defaults to os.time().
formatSummaryLines
SaveSlotCmdrUtils.formatSummaryLines(summary: SaveSlotData.SaveSlotSummary | string | nil) → {string}Renders a slot's SaveSlotData.SaveSlotSummary as one line per summary provider, keyed by provider name (see HasSaveSlots.RegisterSummaryProvider). A legacy plain-string summary is passed through as its own line, and a summary with nothing in it yields no lines at all.
formatSlotBlock
SaveSlotCmdrUtils.formatSlotBlock(metadata: SaveSlotData.SaveSlotMetadata,status: string?,--
appended to the header, e.g. "Active"
now: number?--
defaults to os.time(), for the relative timestamps
) → string
Renders one slot as the block saveslot-list prints for it: a header naming the slot, then an
indented line of playtime and timestamps, then a line per summary provider. Lines with nothing
behind them are left out, so a slot that has never been played prints as its header alone.