settings.set
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...")
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 |
Examples
Example | |
Disables use of startup files from floppies on subsequent reboots by saving a new default settings file. | |
Code |
settings.set("shell.allow_disk_startup", false) settings.save(".settings") |
Settings API Functions |
---|
settings.set - settings.get - settings.unset - settings.clear - settings.getNames - settings.load - settings.save |