Skip to main content

Human Assist

LCC.assist lets a device script ask the control center for human assistance. A request can include a screenshot and clear instructions, block until the operator submits a result, and then continue.

Request Types​

TypeAPIUse caseTypical script action
Text replyLCC.assist.ask_text()Captcha, SMS code, passcode, one-time tokenInput result.text into the focused field
Pick pointLCC.assist.pick_point()The operator needs to decide where to tap, such as a visual button or abnormal dialogCall touch.tap(result.x, result.y)
Remote controlLCC.assist.request_control()Slider verification, human check, login, security check, permission prompt, or other unstable flowWait for the operator to finish, then capture the new screen and continue

Instructions shown to the operator should be concrete and actionable. Do not use vague text such as "provide more information". Use direct instructions such as "remote-control the device, finish the current verification, then click Done", "enter the captcha in the screenshot", or "pick the center of the confirm button".

Screenshot Sources​

An assist request can include an image in several ways:

  • screenshotLocalPath: Local image path on the device; the SDK uploads it as a temporary resource on the controller.
  • screenshotPath: an existing relative path under the control center files root.
  • screenshotImage: an XXTouch ImageObject. The SDK converts it to a data URL without saving a file first.
  • screenshotImageData: PNG/JPEG binary image data. The SDK converts it to a data URL.
  • input.imageSrc: when the script already has a data:image/..., http(s)://..., or /api/... image URL, pass it through the input object for the frontend to display.

The SDK does not overwrite input.imageSrc. If input.imageSrc and path-based screenshots are not provided, the SDK converts screenshotImage or screenshotImageData into input.imageSrc.

Lifecycle​

Request states are pending (waiting), active (being handled), submitted (result submitted), cancelled, and expired. Only submitted indicates that a human result is available.

If LCC.assist.request() times out while waiting, it attempts to cancel that request. On normal script exit, cancellation is attempted for unfinished requests from the current instance. Tasks and results do not survive a controller restart; save results separately if they are needed later.

When the controller receives a device-stopped state, it cancels that device’s lua-script assist requests still in pending / active. This batch cancellation does not affect other devices, other sources, or submitted results.

Automatically uploaded screenshots are cleaned up when the controller starts. Save a separate copy under a resource path you manage for long-term reuse; do not treat the generated screenshotPath as a permanent file reference.

Inline images are no longer retained after a request is submitted, cancelled, or expired.

API List​