Ready-to-use Code ExampleSettingDialogCheckbox

Dialog: Checkbox

Presents on/off options with Checkbox components. Result-table values are real Boolean true/false values, not strings.

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: Onay kutusu / Dialog: Checkbox
-- Checkbox ile açık/kapalı seçenekler

local cfg = Setting.builder()
cfg:setTitle("Ozellik Secimi")

cfg:add("sesli", Checkbox(true, "Sesli bildirim"))
cfg:add("log", Checkbox(false, "Log dosyasina yaz"))
cfg:add("hud", Checkbox(true, "HUD goster"))
cfg:add("hizli", Checkbox(false, "Hizli mod"))

local result = cfg:build():show()
if type(result) ~= "table" then return end

-- Checkbox values are real booleans, not "true"/"false" strings.
local sesliAktif = result["sesli"] == true
local logAktif = result["log"] == true
local hudAktif = result["hud"] == true
local hizliMod = result["hizli"] == true

if hudAktif then
  local hud = Hud(10, 10, 250, 40, false)
  hud:setText("Makro aktif")
  hud:show()
end

if sesliAktif then
  System.vibrate(200)
end

toast("Log: " .. tostring(logAktif) .. ", Hizli: " .. tostring(hizliMod))

Implementation and Adaptation Notes

  • Before running, replace sample values such as image names, text, colors, coordinates, and file paths with your own macro values.
  • For examples that use Region or coordinates, retest the target area on different resolutions and DPI values.
  • Tune mScore, timeout, and scan rate in a test macro first, then move the verified values into the production macro.