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: Tekli secim / Dialog: Radio group
-- RadioGroup ile mod secimi
local cfg = Setting.builder()
cfg:setTitle("Mod Secimi")
cfg:add("mod", RadioGroup({"Yavas", "Normal", "Hizli", "Cok Hizli"}, 1))
cfg:add("bolge", RadioGroup({"Tam Ekran", "Ust Yari", "Alt Yari", "Orta Alan"}, 0))
Setting.setDialog(cfg:build())
Setting.show()
-- Seçimi oku (0-tabanlı indeks)
local modSecim = tonumber(Setting.get("mod")) or 1
local bolgeSecim = tonumber(Setting.get("bolge")) or 0
-- Moda gore gecikme belirle
local gecikmeler = {1000, 500, 200, 50}
local gecikme = gecikmeler[modSecim + 1] or 500
-- Bolgeye gore Region belirle
local tamEkran = Region()
local sw = tamEkran:getW()
local sh = tamEkran:getH()
local bolgeler = {
{0, 0, sw, sh},
{0, 0, sw, math.floor(sh / 2)},
{0, math.floor(sh / 2), sw, sh - math.floor(sh / 2)},
{math.floor(sw * 0.18), math.floor(sh * 0.20), math.floor(sw * 0.64), math.floor(sh * 0.58)}
}
local b = bolgeler[bolgeSecim + 1]
local region = Region(b[1], b[2], b[3], b[4])
toast("Mod: " .. modSecim .. ", Gecikme: " .. gecikme .. "ms")