How To Call It
Setting is a global table: call its functions with a dot (Setting.<method>(...)), not a colon.
Saves a setting. Call it with a dot: Setting:set(...) would write the value under the wrong key.
Documented for app version 1.0.51Updated:
Setting is a global table: call its functions with a dot (Setting.<method>(...)), not a colon.
In dialog and HUD flow, validate user input and complete the sequence with close/dispose steps to keep the UI stable.
Required: key, value. Returns nothing.
You can combine it with Setting.builder(), Dialog, Checkbox, EditText, Hud, and Console to build richer operator-facing flows.
The snippet below is a starter pattern that can be applied directly in runtime flow.
Setting.set("delay", "750")From foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
Setting.set("delay", "750")local stepOk = true
Setting.set("delay", "750")
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
Setting.set("delay", "750")
end)
if not ok then
print("API step failed: Setting.set: " .. tostring(err))
requestStop()
end-- In dialog and HUD flow, validate user input and complete the sequence with close/dispose steps to keep the UI stable.
local function run_set_step()
Setting.set("delay", "750")
end
local ok, err = pcall(run_set_step)
if not ok then
toast("Step failed")
print(err)
endlocal dialog = Setting.builder()
dialog:add("delay", EditText("500", 1, "Delay"))
dialog:add("enabled", Checkbox(true, "Enabled"))
Setting.setDialog(dialog:build())
Setting.show()
Setting.set("delay", "750")