Copyable Example Code
You can paste this into the code editor; still verify target image, region, color, text, and timing values in your own device flow.
-- Dialog: checkbox
local cfg = Setting.builder()
cfg:setTitle("Features")
cfg:add("sound", Checkbox(true, "Sound alert"))
cfg:add("log", Checkbox(false, "Write a log file"))
cfg:add("hud", Checkbox(true, "Show HUD"))
cfg:add("fast", Checkbox(false, "Fast mode"))
local result = cfg:build():show()
if type(result) ~= "table" then return end
-- Checkbox values are real booleans, not "true"/"false" strings.
local soundOn = result["sound"] == true
local logOn = result["log"] == true
local hudOn = result["hud"] == true
local fastMode = result["fast"] == true
if hudOn then
local hud = Hud(10, 10, 250, 40, false)
hud:setText("Macro active")
hud:show()
end
if soundOn then
System.vibrate(200)
end
toast("Log: " .. tostring(logOn) .. ", fast: " .. tostring(fastMode))