Skip to content

Data Module

The data module stores persistent save data. The cache module stores temporary session data.


LAU provides 3 save slots: 1, 2, and 3.

FunctionArgumentsDescription
data.save(slot, list)number, listSaves a table to the specified slot.
data.load(slot)numberReturns the table stored in that slot, or null.
data.clear(slot)numberPermanently deletes all data in that slot.
lau-compiler.exe
varol mySettings = { speed = 25, autoSell = true }
data.save(1, mySettings)
print("[Data] Settings saved to Slot 1!")
varol loaded = data.load(1)
print("[Data] Loaded Speed: " + loaded.speed)
OUTPUT:
[Data] Settings saved to Slot 1! [Data] Loaded Speed: 25

The cache module is temporary session storage. It works like a small list of values you can add, read, remove, and reset during the current run.

FunctionReturnsDescription
cache.set(key, value)voidStores a value for the current session.
cache.get(key)anyGets a cached value, or null if it does not exist.
cache.remove(key)voidRemoves one cached value.
cache.reset()voidClears all cached values.
lau-compiler.exe
cache.set(1, "apples")
cache.set(2, "carrots")
print("[1] " + cache.get(1))
print("[2] " + cache.get(2))
OUTPUT:
[1] apples [2] carrots
cache.set(1, "hello")
cache.remove(1)
cache.set(1, 1)
cache.set(2, 2)
cache.reset()
cache.set(1, "farmMode")
print("Cache mode: " + cache.get(1))