#
config
Read and write cheat settings from Lua using string keys; each key has a fixed type (bool, int, float, color, multi, or string). The in-game menu and ui controls reference the same keys-often via config_name on a widget.
A file named config_names.txt is generated in the configs folder containing the names of the configuration keys.
#
Get and set
config.get(key: string)
- Reads a value by config key. Return shape depends on the key’s type:
- bool — single boolean
- int / float — single number
- string — single string
- color — four values
r, g, b, ain 0–255 (use multiple assignment) - multi — table with string keys (e.g.
"0","1") mapping to booleans
local autostrafe = secret.config.get("misc_auto_strafe")
local smooth = secret.config.get("misc_auto_strafe_smooth")
local r, g, b, a = secret.config.get("Scheme")
print("Scheme:", r, g, b, a)
local multi = secret.config.get("some_multi_key")
for k, v in pairs(multi) do
print(k, v)
end
config.set(key: string, value: boolean | number | string | table)
- Writes a value;
valuemust match the key’s type:- bool — boolean
- int / float — number
- string — string
- color — table with 1-based indices
1-4, channels 0–255 (stored internally normalized) - multi — table with string keys that parse as integers and boolean values
secret.config.set("misc_auto_strafe", false)
secret.config.set("misc_auto_strafe_smooth", 50)
secret.config.set("Scheme", { 255, 255, 255, 255 })
secret.config.set("some_multi_key", {
["0"] = true,
["1"] = false,
})
config.type(key: string): string
- Returns
"bool","int","float","color","multi", or"string".
local t = secret.config.type("misc_auto_strafe")
if t == "bool" then
-- ...
end
#
Files
config.load(config_name: string)
- Loads a saved config by basename (file extension is applied internally).
secret.config.load("my_config")
config.save(config_name: string)
- Saves current settings under the configs directory; creates directories when needed.
secret.config.save("my_config")
config.list(): table
- 1-based array of saved config basenames (no paths).
local names = secret.config.list()
for i, name in ipairs(names) do
print(i, name)
end
config.directory(): string
- Absolute path of the configs folder.
print(secret.config.directory())