Ready-to-use Code ExampleRegionAssetSnapFindParam

Wait for Image and Click

Waits until a specific image appears on screen, then clicks it automatically. Region:wait() periodically scans the screen until timeout. Ideal for game screen transitions and loading screens.

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.

-- Gorsel bekle ve tikla / Wait for image and click
-- Parametreler: zaman asimi, tarama hizi

local zamanAsimi = 10000
local taramaHizi = 500

Snap.screenRefresh()
local region = Region()
local param = FindParam.timeout(zamanAsimi)
param:sRate(taramaHizi)
param:mScore(85)

toast("Gorsel bekleniyor...")
local match = region:wait(Asset.image("devam_butonu"), param)
if match then
  toast("Gorsel bulundu! Tiklaniyor...")
  quickTap(match)
  wait(500)
else
  toast("Zaman asimi: gorsel bulunamadi")
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.
  • Avoid overly wide Region areas; a tighter area scans faster and reduces false matches.