How To Call It
This is an object method: call it with a colon on the Result object a search such as region:find(...) returns (nil when nothing matched) (match:<method>(...)). Result is not a global name; the method exists only on that object.
Returns true while the match coordinates still belong to the current screen; false after a rotation or display change.
Documented for app version 1.0.51Updated:
This is an object method: call it with a colon on the Result object a search such as region:find(...) returns (nil when nothing matched) (match:<method>(...)). Result is not a global name; the method exists only on that object.
In detection flow, refresh the screen with Snap.screenRefresh() first, then narrow the search area and confidence using Region and FindParam.
Takes no arguments. Returns a boolean (true or false).
It is typically combined with Snap, Region, Asset, and FindParam; you can feed the result into quickTap(), click(), or a follow-up OCR step.
The snippet below is a starter pattern that can be applied directly in runtime flow.
local match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
endFrom 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 match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
endlocal stepOk = true
local match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
end
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
local match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
end
end)
if not ok then
print("API step failed: Result:canClick: " .. tostring(err))
requestStop()
end-- In detection flow, refresh the screen with Snap.screenRefresh() first, then narrow the search area and confidence using Region and FindParam.
local function run_canclick_step()
local match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
end
end
local ok, err = pcall(run_canclick_step)
if not ok then
toast("Step failed")
print(err)
endSnap.screenRefresh()
local match = Region():find(Asset.image("target"), FindParam.timeout(3000))
if match then
local ok = match:canClick()
end
toast("Detection step completed")