Ready-to-use Code ExampleSettingDialogTabLayoutEditTextCheckboxRadioGroup

Dialog: Tabbed Settings Panel

Creates an advanced settings panel with multiple tabs using TabLayout. Each tab can combine different components (EditText, Checkbox, RadioGroup). Ideal for complex macros.

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: Sekmeli ayar paneli / Dialog: Tabbed settings
-- TabLayout ile gelismis coklu sekme ayarlari

local cfg = Setting.builder()
cfg:setTitle("Gelismis Ayarlar")

-- Sekme 1: Genel
cfg:add("tab", TabLayout({"Genel", "Tarama", "Bildirim"}))

-- Genel sekmesi
cfg:add("gecikme", EditText("500", 1, "Ana gecikme (ms)"))
cfg:add("tekrar", EditText("100", 1, "Maksimum tekrar"))
cfg:add("mod", RadioGroup({"Döngü", "Tek Seferlik", "Zamanlı"}, 0))

-- Tarama sekmesi
cfg:add("eslesme", EditText("80", 1, "Eşleşme oranı (%)"))
cfg:add("taramaHz", EditText("300", 1, "Tarama hizi (ms)"))
cfg:add("cokluAra", Checkbox(false, "Coklu hedef ara"))

-- Bildirim sekmesi
cfg:add("titresim", Checkbox(true, "Titresim"))
cfg:add("sesUyari", Checkbox(false, "Ses uyarısı"))
cfg:add("logTut", Checkbox(true, "Log dosyasi tut"))
cfg:add("logDosya", EditText("makro_log.txt", 1, "Log dosya adi"))

Setting.setDialog(cfg:build())
Setting.show()

-- Tum degerleri oku
local gecikme = tonumber(Setting.get("gecikme")) or 500
local tekrar = tonumber(Setting.get("tekrar")) or 100
local mod = tonumber(Setting.get("mod")) or 0
local eslesme = tonumber(Setting.get("eslesme")) or 80
local taramaHz = tonumber(Setting.get("taramaHz")) or 300
local titresim = Setting.get("titresim") == "true"
local logTut = Setting.get("logTut") == "true"
local logDosya = Setting.get("logDosya") or "makro_log.txt"

toast("Ayarlar yuklendi: " .. gecikme .. "ms, " .. tekrar .. " tekrar")

if logTut then
  File.write(logDosya, "Makro basladi - Mod: " .. mod .. "\n")
end

if titresim then
  System.vibrate(100)
end

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.