forgetAllSettings()
Clears this script's whole settings file — every saved number, text and flag.
forgetAllSettings()
15 store commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.
forgetAllSettings()
Clears this script's whole settings file — every saved number, text and flag.
forgetAllSettings()
forgetSetting(key: string)
Removes one saved setting from this script's file.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to remove |
forgetSetting("trips")
hasSetting(key: string) -> bool
Whether this script has saved anything under a name — for telling a fresh run from a resumed one.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to look for |
if hasSetting("trips") { print("resuming") }
saveBag(key: string, bag: bag)
Saves a whole bag into this script's settings file, as JSON — the record partner of saveNumber. Load it back with savedBag. Refuses a bag that holds itself.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the setting to save under |
| bagrequired | bag | the bag to save, written as JSON |
saveBag("lastRun", bagOf("hp", 30))
saveFlag(key: string, value: bool)
Remembers a yes/no for this script under a name.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to save it under |
| valuerequired | bool | the yes/no to remember |
saveFlag("finishedSetup", true)
saveNumber(key: string, value: int)
Remembers a number for this script under a name, in its settings file. Read it back next run with savedNumber.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to save it under |
| valuerequired | int | the number to remember |
saveNumber("trips", 42)
saveNumbers(key: string, values: list<int>)
Remembers a whole list of numbers under a name — a seen-list or a route that should outlast a restart. Read it back with savedNumbers.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to save them under |
| valuesrequired | list<int> | the numbers to remember |
saveNumbers("seen", range(0, 3))
saveText(key: string, value: string)
Remembers a piece of text for this script under a name.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to save it under |
| valuerequired | string | the text to remember |
saveText("mode", "bank")
saveTexts(key: string, values: list<string>)
Remembers a whole list of strings under a name. Read it back with savedTexts.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name to save them under |
| valuesrequired | list<string> | the strings to remember |
saveTexts("names", menuOptions())
savedBag(key: string) -> bag?
The bag a setting holds, or none when the setting is missing or does not parse — the other half of saveBag, across runs and restarts.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the setting saveBag wrote |
if savedBag("lastRun") == none { print("first run") }
savedFlag(key: string, fallback: bool) -> bool
The yes/no saved under a name, or the fallback when nothing is saved.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name it was saved under |
| fallbackrequired | bool | what to use when nothing is saved yet |
if savedFlag("finishedSetup", false) { print("resuming") }
savedNumber(key: string, fallback: int) -> int
The number saved under a name, or the fallback on the first run before anything has been saved.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name it was saved under |
| fallbackrequired | int | what to use when nothing is saved yet |
let trips = savedNumber("trips", 0) print(trips)
savedNumbers(key: string) -> list<int>
The list of numbers saved under a name, or an empty list when nothing is saved.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name they were saved under |
print("seen", count(savedNumbers("seen")))
savedText(key: string, fallback: string) -> string
The text saved under a name, or the fallback when nothing is saved.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name it was saved under |
| fallbackrequired | string | what to use when nothing is saved yet |
if savedText("mode", "off") == "bank" { stop }
savedTexts(key: string) -> list<string>
The list of strings saved under a name, or an empty list when nothing is saved.
| Parameter | Type | What it does |
|---|---|---|
| keyrequired | string | the name they were saved under |
print("names", count(savedTexts("names")))