Import "yzm.lua"
'-------------------------------- 定义数据 ----------------------------------------
Dim ts = time()
Dim user = "" '用户名
Dim pwd = "" '密码
Dim softID = 0 '软件ID
Dim software = "联众打码2.0" '接入联众答题的软件版本号
Dim sdk = "Android-lua1.3.1" '接口版本号
Dim Secret = "" '安全码,在开发者后台-安全中心获取
Dim filepath = "" '图片路径
Dim captchaType = 0 '验证码类型
Dim minlen = 0 '验证码最短长度(可选)
Dim maxlen = 0 '验证码最大长度(可选)
'-------------------------------- 测试范例 ----------------------------------------
dim ret, captchaId
//发送验证码
ret = yzm.lz_SendVerCode(ts, softID, software, sdk, Secret, user, pwd, filepath, captchaType, minlen, maxlen)
If ret <> "" Then
captchaId = ret
TracePrint "验证码ID是: " & captchaId
Else
TracePrint "验证码发送失败,错误原因: " & yzm.LassError()
End If
//获取验证码结果
ret = yzm.lz_GetVerCode(ts, softID, software, sdk, Secret, user, pwd, captchaId)
If ret <> "" Then
TracePrint "验证码识别结果: " & ret
Else
TracePrint "验证码结果获取失败,错误原因: " & yzm.LassError()
End If
//一键打码
ret = yzm.lz_RecYZM_A(ts, softID, software, sdk, Secret, user, pwd, filepath, captchaType, minlen, maxlen)
If ret <> "" Then
TracePrint "验证码识别结果: " & ret
Else
TracePrint "验证码结果获取失败,错误原因: " & yzm.LassError()
End If
//获取用户余额
ret = yzm.lz_GetUserInfo(ts, softID, software, sdk, secret, user, pwd)
If ret <> "" Then
TracePrint "当前账户余额为: " & ret
Else
TracePrint "获取余额失败,错误原因: " & yzm.LassError()
End If
//验证码报错
ret = yzm.lz_ReportError(ts, softID, software, sdk, secret, user, pwd, captchaId)
If ret Then
TracePrint "验证码报错成功"
Else
TracePrint "报错失败,错误原因: " & yzm.LassError()
End If