How To Call It
FindParam is a global table: call its functions with a dot (FindParam.<method>(...)), not a colon.
Sets the scan rate in attempts per second (Hz): 1-30, default 3. The pause between attempts is 1000 / sRate ms, kept between 33 and 2000 ms; millisecond values such as 500 are clamped to 30.
Documented for app version 1.0.51Updated:
FindParam is a global table: call its functions with a dot (FindParam.<method>(...)), not a colon.
Parameter objects work best when prepared in a dedicated variable and reused across search or action calls.
Required: value. Returns a FindParam object.
This object is mostly used to prepare input for action APIs such as Region searches, click(), swipe() and Replay playback.
The snippet below is a starter pattern that can be applied directly in runtime flow.
local param = FindParam.timeout(5000):sRate(10)
local match = Region():find(Asset.image("target"), param)From foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
local param = FindParam.timeout(5000):sRate(10)
local match = Region():find(Asset.image("target"), param)local stepOk = true
local param = FindParam.timeout(5000):sRate(10)
local match = Region():find(Asset.image("target"), param)
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
local param = FindParam.timeout(5000):sRate(10)
local match = Region():find(Asset.image("target"), param)
end)
if not ok then
print("API step failed: FindParam.sRate: " .. tostring(err))
requestStop()
end-- Parameter objects work best when prepared in a dedicated variable and reused across search or action calls.
local function run_srate_step()
local param = FindParam.timeout(5000):sRate(10)
local match = Region():find(Asset.image("target"), param)
end
local ok, err = pcall(run_srate_step)
if not ok then
toast("Step failed")
print(err)
end-- Wait up to 10 s for a button, scanning 5 times per second, and tap it
Snap.screenRefresh()
local param = FindParam.timeout(10000):sRate(5):mScore(0.85)
local match = Region():find(Asset.image("continue_button"), param)
if match then
click(match)
else
print("continue_button did not appear")
end