Appearance
sdk.profile
Per-character key/value store on game.storage, plus alarm predicates. Alarms log/callback as before and use the optional native alert sink.
lua
local M = require("sdk.profile")character
function · character(): string
Public alias of the storage namespace character.
Returns
| Type | Summary |
|---|---|
string | — |
path
function · path(name?: string): string
Sanitized game.storage key: profile_<character>_<name>.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
string | — |
save
function · save(name: string, data: ProfileValue): Result?, ErrorMessage?
JSON-write a profile blob. Prefer this over the legacy tab-separated format.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
data | ProfileValue | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
load
function · load(name: string): ProfileValue?, ErrorMessage?
JSON-read a profile; falls back to decode_legacy for pre-JSON blobs.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
ProfileValue?, ErrorMessage? | — |
remove
function · remove(name: string): boolean, ErrorMessage?
Delete one profile key from game.storage.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
boolean, ErrorMessage? | — |
clear_alarm
function · clear_alarm(name: string): Result
Drop one named alarm and its last-fire timestamp.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
Result | — |
reset
function · reset()
Clear all alarms (tests / logout). Does not wipe stored profiles.
check
function · check(snapshot?: table): table[]
Evaluate alarms against a snapshot; honors cooldown and optional native beep/flash.
Parameters
| Name | Type | Summary |
|---|---|---|
snapshot | table | — |
Returns
| Type | Summary |
|---|---|
table[] | — |
alarm
function · alarm(name: string, options?: ProfileAlarmOptions): Result?, ErrorMessage?
Register or replace an alarm and start the tick watcher.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
options | ProfileAlarmOptions | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |