Delay 1000
if GK.RPA("text", "学习签退", 290, 468, 428, 535, true) or GK.RPA("text", "随机验证", 290, 468, 428, 535, true) or GK.RPA("text", "学习签到", 290, 468, 428, 535, true) then
//调用验证码识别
Call 验证码识别() 这样就报错
End If
if 1 = 1 then
call 验证码识别() 这样也不会报错
then
//Call 验证码识别() 这样就不会
Sub 验证码识别
If Dir.Exist(filepath) Then
TracePrint "存在"
Else
TracePrint "不存在!"
End If
TracePrint filepath
//滑块背景 路劲 filepathback
Dim filepathback = GetSdcardDir() & "/yzm1.jpg"
If Dir.Exist(filepathback) Then
TracePrint "存在"
Else
TracePrint "不存在!"
End If
TracePrint filepathback
//这段代码为【图片识别】的案例
//json = ttddm.tt_SendVerCode(username, password, filepath, typeid, typename, angle, remark)
//这段代码为【2张图滑块识别】的案例 filepath 是滑块 filepathback 是背景图
//json = ttddm.tt_SendXYCode(username, password, filepath, filepathback)
//这段代码为【点选识别】的案例
json = ttddm.tt_SendPointCode(username, password, filepath, typeid,angle, remark)
// 由于环境限制调式时 去除不等于号的空格
If json and json <> "" Then
TracePrint json
table = Cjson.Decode(json)
If table Then
If table["code"] = "0" Then
ID = table["data"]["id"]
//识别结果
Result = table["data"]["result"]
TracePrint "验证码识别结果为: ", Result
Call 返回值分割()
Else
TracePrint "验证码识别失败: ", table["message"]
End If
End If
Else
TracePrint "发送HTTP请求失败"
End If
Dir.Delete ("/storage/emulated/0/yzm.jpg")
Dir.Delete ("/storage/emulated/0/yzm1.jpg")
//报错
//Dim errorUrl="http://api.ttshitu.com/reporterror.json?id="
//Dim 返回值 = URL.Post(errorUrl & ID, "")
// TracePrint 返回值
End Sub
|