From ComputerCraft Wiki
Revision as of 03:31, 10 June 2016 by Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=settings.set |args={{type|string}} name, {{type|any}} value |api=settings |addon=ComputerCraft |desc=Sets the specified setting to the specified...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Grid Redstone.png  Function settings.set
Sets the specified setting to the specified value. Values may be in the form of strings, numbers, booleans, or serialisable tables.

Settings apply until the next reboot, at which time the defaults are reloaded. If you wish your custom settings to persist, either save them to a file and reload them on startup, or save them to ".settings" specifically if you wish them to be automatically reloaded.

Settings may not be cleared by use of settings.set(); for eg, settings.set("shell.autocomplete", nil) is invalid. Instead use settings.unset() for this purpose.
Syntax settings.set(string name, any value)
Returns nil
Part of ComputerCraft
API settings


Grid paper.png  Example
Disables use of startup files from floppies on subsequent reboots by saving a new default settings file.
settings.set("shell.allow_disk_startup", false)".settings")

Grid disk.png Settings API Functions
settings.set - settings.get - settings.unset - settings.clear - settings.getNames - settings.load -