menu.* (alias config.*) declares the knobs on the script's card in the menu. Declare
params at the top level of the script - they register when the script loads, appear on the
card, and their values are exposed to the script as globals named by key.
Config globals are plain values but use the prelude accessors - they survive missing keys
and type drift:
lua
local fov = menu.get('fov') -- number, 0 when missinglocal on = menu.get_bool('active') -- toggles are 0/1 numberslocal key = menu.get_str('aimkey') -- keybind/dropdown stringlocal bone = menu.get_str('bone')
Values persist per script (numeric and string maps are saved with the manifest and synced
to the cloud config) and are restored into the sandbox on activation - a script always
reads the user's last setting.
menu.group(name) / menu.card(name) starts a card; params without an explicit card
argument land on the last declared one. Limits (enforced on declaration, excess params are
dropped): 8 cards per script; per card 12 sliders, 8 toggles, 4 keybinds, 4 dropdowns,
2 pixel shapes. Re-declaring an existing key replaces the param instead of stacking a
duplicate.
The menu harvests the schema by dry-loading the script (no ticks), so knobs render even for
inactive scripts. Keep menu.* calls at the top level and free of side effects - they run
during schema harvest too.