MatchResult
A match returned by find(), exist(), wait() and the other detection methods. It carries
the matched rectangle, its score and its label, and can be used directly by click methods.
Methods
| Method | Description |
|---|---|
getX() / getY() | Top-left corner of the match |
getWidth() / getHeight() | Size of the matched region |
getMiddleX() / getMiddleY() | Center coordinates |
getMiddlePoint() | Center as a Point |
getRegion() | The match as a Region |
getScore() | Match confidence from 0 to 1 |
getLabel() | Recognized text or template label |
highlight() | Draw the match on screen for a moment |
Example
local result = Screen:find("buy.png")
if result then
toast("Score: " .. result:getScore())
Screen:click(result:getMiddlePoint())
end