settings.set

From ComputerCraft Wiki
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

Examples

Grid paper.png  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")


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