Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
1. 优化 怒号光明 判定,减少导航失败
2. 选中干员加检测,解决网络加载导致选中干员失效问题
3. 优化 信用奖励返回 判定,解决信用未满而传递线索
4. 优化 接收线索判定,解决因前一任务通知而跳过问题
  • Loading branch information
tkkcc committed Dec 14, 2021
1 parent 5d003d6 commit 5df91bb
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 37 deletions.
2 changes: 2 additions & 0 deletions 0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
curl 'http://localhost:9090/script/del?name=test' -X 'POST'
}
release() {
git add -u
cd release
cp /F:/software/懒人精灵3.6.0/out/main.lr script.lr
# cp /F:/software/懒人精灵3.6.0/tmp/明日方舟速通.apk .
numfmt --to=iec $(stat -c %s script.lr)
git add -u
git commit --amend -m "$(md5sum script.lr | cut -d' ' -f1)"
git push --force
Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ skip_snapshot_service_check = true
-- 设成10以下时,单核机作战导航失败率高,真机基建缩放也会有问题
frame_milesecond = 1000 // 30
milesecond_after_click = frame_milesecond
release_date = "2021.12.14 15:23"
release_date = "2021.12.14 19:46"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_page_width = -2
Expand Down
56 changes: 30 additions & 26 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ path.bilibili_login_change = update(path.bilibili_login, {
path.邮件收取 = function()
path.跳转("邮件")
local state = sample("邮件提示")
-- log(119,state)
-- log(point['sample'])
-- log(first_point['sample'])
-- log(rfl['sample'])
-- log(123,findOne("sample"))
-- exit()
if not wait(function()
if not findOne(state) then return true end
tap("收取所有邮件")
Expand Down Expand Up @@ -531,7 +525,11 @@ path.宿舍换班 = function()
end
tap("清空选择")
end, 5) then return end
tapAll(map(function(i) return "干员选择列表" .. i end, range(6, 10)))
if not wait(function()
if not findOne("干员未选中") then return true end
tapAll(map(function(i) return "干员选择列表" .. i end, range(6, 10)))
disappear("干员未选中")
end, 5) then return end
if not wait(function()
if findAny({
"隐藏", "进驻信息", "进驻信息选中",
Expand Down Expand Up @@ -732,8 +730,12 @@ path.总览换班 = function()
end
end, 5) then return end

tapAll(map(function(j) return "干员选择列表" .. j end,
range(2 * limit, limit + 1, -1)))
if not wait(function()
if not findOne("干员未选中") then return true end
tapAll(map(function(j) return "干员选择列表" .. j end,
range(2 * limit, limit + 1, -1)))
disappear("干员未选中")
end, 5) then return end
if not wait(function()
if findOne("撤下干员") then return true end
tap("确认蓝")
Expand Down Expand Up @@ -786,9 +788,12 @@ path.总览换班 = function()

log("limit", limit)

tapAll(
map(function(j) return "干员选择列表" .. j end, range(1, limit)))

if not wait(function()
if not findOne("干员未选中") then return true end
tapAll(map(function(j) return "干员选择列表" .. j end,
range(1, limit)))
disappear("干员未选中")
end, 5) then return end
if not wait(function()
if findOne("撤下干员") then return true end
tap("确认蓝")
Expand Down Expand Up @@ -897,12 +902,13 @@ path.线索搜集 = function()
tap("制造站进度")
end, 10) then return end

-- goto a controllable state
-- 进入可控状态
if not wait(function()
if not findOne("线索传递") then return true end
tapCard("线索布置列表1")
end, 5) then return end

-- 回到线索主界面,处理交流结束情况
if not wait(function()
if findOne("线索传递") then return true end
tap("解锁线索上")
Expand All @@ -914,10 +920,10 @@ path.线索搜集 = function()
end
end, 5) then return end

log(588)
-- 等待前一任务的通知消失
appear("接收线索白", 5)

-- TODO may be overlaped by notification
-- so we put it after some job without notification
-- 接收线索
wait(function()
if not findOne("线索传递") then return true end
if not findOne("接收线索有") then return true end
Expand All @@ -936,29 +942,27 @@ path.线索搜集 = function()
end, 10)
if not findOne("线索传递") then return end

log(501)

-- 信用奖励,已满则传递线索
f = function(retry)
if retry > 10 or no_friend then return true end

-- 进入信用奖励界面
if not wait(function()
if findOne("信用奖励返回") then return true end
tap("信用奖励有")
end, 5) then return end

if not appear("未达线索上限", .2) and findOne("信用奖励返回") then
log(733)
-- 已满则传递,并循环
if not appear("未达线索上限", .2) then
tap("返回")
appear("线索传递")
clue_unlocked = false
path.线索布置()
if not clue_unlocked then path.线索传递() end
return f(retry + 1)
end
log(734)

-- if not findOne("信用奖励返回") then return f() end

-- 未满则收取奖励
if findOne("信用奖励领取") then
if not wait(function()
if findOne("线索传递") then return true end
Expand All @@ -967,14 +971,14 @@ path.线索搜集 = function()
else
tap("返回")
end

-- 确保回到线索界面,退出
if not appear("线索传递") then return end
return true
end
if not f(0) then return end
if not appear("线索传递") then return end
path.线索布置()
-- if not appear("线索传递") then return end
-- path.访问好友()
end

-- tap with offset -50,50
Expand Down Expand Up @@ -1189,6 +1193,7 @@ path.任务收集 = function()
tap("任务有列表" .. i)
end, 5) then return end
-- wait 0.5 for next
-- TODO can we remove this timeout
appear(point["任务有列表"], .5)
end
end
Expand Down Expand Up @@ -1784,7 +1789,6 @@ path.剿灭 = function(x)
if not appear("主页") then return end

if not wait(function()
-- if findOne("怒号光明") then return true end
if findOne("主题曲界面") then return true end
tap("主题曲")
end) then return end
Expand Down
9 changes: 6 additions & 3 deletions point.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,11 @@ point = {
传递列表 = {{1791, 260}, {1791, 472}, {1791, 720}, {1791, 932}},
信用奖励有 = "1794|254|FFFFFF,1835|239|7D0022",
接收线索有 = "1796|458|FFFFFF,1833|396|7D0022",
接收线索白 = "1795|396|FFFFFF,1795|409|FFFFFF",
线索传递 = "1764|589|FFFFFF,1764|609|FFFFFF,1757|869|FFFFFF",
信用奖励领取 = "1286|864|0075A8",
未达线索上限 = "521|914|E9E9E9",
信用奖励返回 = "593|948|E9E9E9",
信用奖励返回 = "960|948|E9E9E9",
会客厅有 = "1797|245|FF6802",
-- 342 is choose to avoid tapping 干员 if 进驻信息选中
会客厅 = {1523, 342},
Expand Down Expand Up @@ -385,7 +386,9 @@ point = {
提示 = "637|56|313131",
右上角 = {1919, 1079},
右下角确认 = {1821, 1018},
怒号光明 = "552|409|000000,411|405|000000,288|403|000000",
-- 怒号光明 = "552|409|000000,411|405|000000,288|403|000000",
-- 怒号光明 = "288|403|000000",
怒号光明 = "79|352|000000",
二次呼吸 = "454|421|000000",
终端 = "138|125|313131,738|125|7D0022,1543|131|313131,188|56|313131",
跳转 = "534|62|313131,534|62|313131,272|62|313131,137|62|313131",
Expand Down Expand Up @@ -944,10 +947,10 @@ center = {
传递列表 = "center_center",
信用奖励有 = "right_center",
接收线索有 = "right_center",
接收线索白 = "right_center",
线索传递 = "right_center",
信用奖励领取 = "center_center",
未达线索上限 = "center_center",
未达线索上限2 = "center_center",
信用奖励返回 = "center_center",
会客厅有 = "center_center_maxscale",
会客厅 = "center_center_maxscale",
Expand Down
2 changes: 1 addition & 1 deletion release
Submodule release updated from 513869 to 6fc486
17 changes: 11 additions & 6 deletions util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ show_help_ui = function()
3. 脚本没有任何反应,可尝试关闭游戏后启动脚本。
更新:
2021-12-14 修复密码输入错误与截屏权限未开导致的定时任务失败。
2021-12-14 修复密码输入错误与截屏权限未开导致的定时任务失败。修复多次传递线索。
]])

newRow(layout)
Expand Down Expand Up @@ -2059,14 +2059,17 @@ input = function(selector, text)
if type(text) ~= 'string' or #text == 0 then return end

wait(function()
log(2)
local node = findOne(selector)
if not node then return true end
nodeLib.setText(node, '')
node = findOne(selector)
if node and #node.text == 0 then return true end
if 1 then return true end
-- node = findOne(selector)
-- if node and #node.text == 0 then return true end
end, 5)

wait(function()
log(3)
local node = findOne(selector)
if not node then return true end
nodeLib.setText(node, text)
Expand Down Expand Up @@ -2193,9 +2196,11 @@ end
predebug_hook = function()
if not predebug then return end
ssleep(1)
input("inputbox", '11111111111')
log(findOne('inputbox'))
log(#findOne('inputbox').text)
while true do if not appear("怒号光明", 0.5) then stop(1) end end
exit()
input("bilibili_username_inputbox", '11111111111')
-- log(findOne('inputbox'))
-- log(#findOne('inputbox').text)
exit()

keepCapture()
Expand Down

0 comments on commit 5df91bb

Please sign in to comment.