traceless.storage
Per-script persistent JSON storage. Calls outside a script invocation return nil or do nothing. Values must be JSON-encodable.
Storage belongs to the current account and script and is saved locally in Traceless\script_cache.dat; it is not synchronized with the server. The encoded data limit is 64 KiB per script and 8 MiB for the complete storage file. Exceeding a limit prevents that save and logs an error.
read
traceless.storage.read(key)
Returns: decoded value; or nil.
key is a string. Returns that script's current in-memory value by key; absent values return nil. Tables are shared references, not copies. Data is decoded when the script storage is initialized. Mutating a returned table alone does not mark the database dirty; call write again to request persistence.
write
traceless.storage.write(key, value)
Returns: none.
key is a string; value is stored in the script's in-memory table without copying or immediate JSON validation. nil removes the key. Marks storage dirty and requests saving after one second. Persistence uses the custom JSON codec; unsupported/cyclic values or size errors are logged during flushing rather than raised by write. This call returns no durability acknowledgement.
local traceless = require("traceless")
traceless.storage.write("settings", {enabled = true})
local settings = traceless.storage.read("settings")