Skip to content

Commit

Permalink
fix hang on 同意协议
Browse files Browse the repository at this point in the history
  • Loading branch information
tkkcc committed Jul 27, 2023
1 parent a58ce61 commit 2874959
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 33 deletions.
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ default_auto_timeout_second = 300
-- 设成1000//30时,真机同时开着B服与官服时会出现点着点着脚本就停(从基建开始做邮件)
frame_milesecond = 1000 // 30
milesecond_after_click = frame_milesecond
release_date = "07.19 10:41"
release_date = "07.27 22:43"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_warn_color = "#ff33ccff"
Expand Down
27 changes: 22 additions & 5 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ path.base = {
}

path.bilibili_login = {

同意协议 = function() return path.fallback.同意协议() end,
活动公告返回 = function() return path.fallback.活动公告返回() end,
同意并继续 = function()
local p = findNode(point["同意并继续"])
Expand Down Expand Up @@ -567,6 +569,7 @@ path.bilibili_login_change = update(path.bilibili_login, {
}, nil, true)

path.login = {
同意协议 = function() return path.fallback.同意协议() end,
活动公告返回 = function() return path.fallback.活动公告返回() end,

阅读并同意 = function()
Expand All @@ -586,7 +589,7 @@ path.login = {
captcha = function() trySolveCapture() end,
ogame = true,
username_inputbox = disable_game_up_check_wrapper(function()
log(589,login_time_history)
log(589, login_time_history)

-- 把输入法关了
wait(function()
Expand Down Expand Up @@ -622,10 +625,8 @@ path.login = {
end

ssleep(.5) -- checkbox 需要延时
log(626,login_time_history)
if debug_mode then
ssleep(1000)
end
log(626, login_time_history)
if debug_mode then ssleep(1000) end
-- 开始唤醒时已经check了
-- check_login_frequency()
tap("login")
Expand Down Expand Up @@ -657,6 +658,7 @@ path.login = {
}

path.login_change = update(path.login, {

username_inputbox = true,
login_switch = function()
clickNodeFalse(findOne("login_switch"))
Expand All @@ -665,6 +667,21 @@ path.login_change = update(path.login, {
}, nil, true)

path.fallback = {
同意协议 = function()

-- findTap({text = "下一步"})

-- ssleep(1)
local p = findOne("同意协议")
if p ~= nil then
local left, top = p.bounds.l, p.bounds.t
tap({left - scale(10), top + scale(10)})
end
ssleep(1)
findTap({text = "下一步"})

end,

未来序曲 = function()
-- "188|529|F3C4A2,1368|199|FF793F,1356|918|393939"
local w = scale(1370 - 1920 // 2) + screen.width // 2
Expand Down
4 changes: 2 additions & 2 deletions point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ minscale = min(hscale, wscale)
maxscale = max(hscale, wscale)

point = {
同意协议 = {text = "我已阅读并同意以上协议"},
神州返回 = "1845|115|BFBFBF,1825|114|595959,1846|87|595959,1846|135|595959",
神州领取1 = "1081|895|9E9E9E",
神州领取2 = "1578|900|FFFFFF",
Expand Down Expand Up @@ -1874,7 +1875,7 @@ center = {

distance = {

["HD-1"] = {swip_right_max, -200},
["HD-1"] = {swip_right_max, -200},
["HD-2"] = {swip_right_max, -400},
["HD-3"] = {swip_right_max, -1100},
["HD-4"] = {swip_right_max, -1500},
Expand All @@ -1884,7 +1885,6 @@ distance = {
["HD-7"] = {swip_right_max, -2400},
["HD-8"] = {swip_right_max, -2600},


["11-1"] = {swip_right_max, -0},
["11-2"] = {swip_right_max, -209},
["11-3"] = {swip_right_max, -444},
Expand Down
2 changes: 1 addition & 1 deletion release
Submodule release updated from 9f32d9 to af93a4
49 changes: 25 additions & 24 deletions util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1934,10 +1934,10 @@ captureqqimagedeliver = function(log_level, log_title, log_detail, important)
-- tg
notifytg(img_url, info, telegram_chatid, telegram_token, telegram_api, sync)

--企业微信推送
-- 企业微信推送
local imgmd5 = fileMD5(getWorkPath() .. "/tmp.jpg")
notify_wechat(wechat_webhook_url, info, img, imgmd5)

-- cloud
cloud.addLog(log_level, log_title, log_detail, img_url)

Expand Down Expand Up @@ -2521,7 +2521,7 @@ notifytg = function(imgurl, info, chatid, bottoken, tgapi, sync)
if sync then wait(function() return not lock:exist(id) end, 30) end
end

--企业微信推送
-- 企业微信推送
notify_wechat = function(webhookurl, info, img, md5)
webhookurl = webhookurl or ''
info = info or ''
Expand All @@ -2537,26 +2537,20 @@ notify_wechat = function(webhookurl, info, img, md5)
end
end
print(webhookurl)
if string.find(webhookurl, "weixin.qq.com") == nil then webhookurl = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=' .. webhookurl end
--推送文字
local body = {
msgtype="text",
text= {
content= info
}
}
local res, code = httpPost(webhookurl, JsonEncode(body), 15, "Content-Type: application/json;charset=UTF-8")
if string.find(webhookurl, "weixin.qq.com") == nil then
webhookurl = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=' ..
webhookurl
end
-- 推送文字
local body = {msgtype = "text", text = {content = info}}
local res, code = httpPost(webhookurl, JsonEncode(body), 15,
"Content-Type: application/json;charset=UTF-8")
if code ~= 200 then print("Wechat text failed" .. status_code .. res) end
--推送图片 因为markdown格式限制4kb 使用文件上传获取media麻烦,故图片文字分开发送
-- 推送图片 因为markdown格式限制4kb 使用文件上传获取media麻烦,故图片文字分开发送
if img ~= nil then
local body ={
msgtype ="image",
image ={
base64 = img,
md5 = md5
}
}
local res, code = httpPost(webhookurl, JsonEncode(body), 15, "Content-Type: application/json;charset=UTF-8")
local body = {msgtype = "image", image = {base64 = img, md5 = md5}}
local res, code = httpPost(webhookurl, JsonEncode(body), 15,
"Content-Type: application/json;charset=UTF-8")
if code == 200 then
print("Wechat notify successfully")
else
Expand Down Expand Up @@ -2987,8 +2981,8 @@ show_debug_ui = function()

newRow(layout)
ui.addCheckBox(layout, "auto_update_gameclient",
"自动更新游戏客户端", false)
"自动更新游戏客户端", false)

newRow(layout)
ui.addCheckBox(layout, "delete_download_floder",
"自动清理download文件夹", false)
Expand Down Expand Up @@ -3866,7 +3860,14 @@ predebug_hook = function()
zl_skill_times = 100

disable_game_up_check = true
swip("HD-8")
-- swip("HD-8")
-- log(findOne("同意协议"))
-- local p = findOne("同意协议")
-- if p ~= nil then
-- local left, top = p.bounds.l, p.bounds.t
-- tap({left - scale(10), top + scale(10)})
-- end
findTap({text="下一步"})
exit()
end

Expand Down

0 comments on commit 2874959

Please sign in to comment.