Request a Picked Point (LCC.assist.pick_point)
Declaration
result, err, task = LCC.assist.pick_point(options)
Parameters
- options
Table. Assist request configuration. See Common Options and Return Objects. This function setstype = "point"automatically.
Return Values
- result
Table ornil. On success, includes physical device coordinatesxandy. - err
String ornil. Failure reason. - task
Table ornil. The latest task state.
Notes
Use this when the operator can decide where to tap from the screenshot and the script can directly tap the returned coordinate.
result.xandresult.yare physical device coordinates and can be used directly withtouch.tap(result.x, result.y).
If you pass a cropped screenshot, also passimageRect; the control center maps the picked image coordinate back to physical device coordinates.
Example
local result, err = LCC.assist.pick_point({
title = "Pick confirm button",
text = "Pick the center of the confirm button",
screenshotLocalPath = XXT_SCRIPTS_PATH .. "/screen.png",
timeout = 180,
})
if result then
touch.tap(result.x, result.y)
end
Cropped-image example:
local result, err = LCC.assist.pick_point({
title = "Pick button",
text = "Pick the confirm button in this cropped image",
screenshotLocalPath = XXT_SCRIPTS_PATH .. "/button-crop.png",
imageRect = { left = 120, top = 360, width = 300, height = 160 },
})