Request a Text Reply (LCC.assist.ask_text)
Declaration
result, err, task = LCC.assist.ask_text(options)
Parameters
- options
Table. Assist request configuration. See Common Options and Return Objects. This function setstype = "text"automatically.
Return Values
- result
Table ornil. Usually{ kind = "text-reply", text = "..." }on success. - err
String ornil. Failure reason. - task
Table ornil. The latest task state.
Notes
Use this for captchas, SMS codes, passcodes, or other cases where the operator provides text and the script can continue.
Do not use text reply when the operator needs to decide what the next action should be. Userequest_control()instead.
Example
local result, err = LCC.assist.ask_text({
title = "Enter captcha",
text = "Please read the captcha in the screenshot and enter it",
screenshotLocalPath = XXT_SCRIPTS_PATH .. "/captcha.png",
timeout = 120,
})
if result then
sys.input_text(result.text, false)
else
nLog("assist failed", err)
end