Skip to content

Commit

Permalink
fix 肉鸽8小时后无限重启
Browse files Browse the repository at this point in the history
  • Loading branch information
tkkcc committed Jun 26, 2022
1 parent 2397878 commit b134317
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ArkLights is the <b> lightning fast</b> and <b> fully managed</b> Arknights game

## 开发

1. 参考[懒人精灵3.6.0无障碍模式IDE](http://bbs.lrappsoft.com:8002/forum.php?mod=forumdisplay&fid=2)内文档
1. 参考[懒人精灵无障碍模式IDE](http://bbs.lrappsoft.com:8002/forum.php?mod=forumdisplay&fid=2)内文档

1. 数据提取
```sh
Expand Down
22 changes: 12 additions & 10 deletions dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,16 @@ def user(
c(x, f"multi_account_user{first_empty_i}auto_recruit1", True)
c(x, f"multi_account_user{first_empty_i}auto_recruit4", True)
c(x, f"multi_account_user{first_empty_i}auto_recruit5", True)
for i in range(1, 13):
c(x, f"multi_account_user{i}now_job_ui" + str(i), True)
c(x, f"multi_account_user{i}now_job_ui8", False)
if fight or drug:
c(x, f"multi_account_inherit_toggle{first_empty_i}", "独立设置")
else:
c(x, f"multi_account_inherit_toggle{first_empty_i}", "继承设置")
c(x, f"multi_account_user{first_empty_i}fight_ui", fight or "jm hd ce ls ap pr")
c(x, f"multi_account_user{first_empty_i}max_drug_times", str(2 if drug else 0))
save("config_multi_account.json", x)
# print("username", username)

x = load("config_debug.json")
l = x["multi_account_choice_weekday_only"].split()
Expand Down Expand Up @@ -570,15 +572,15 @@ def rg1(username, password, server=None, fight=None):
c(x, "zl_max_coin", "")
save("config_extra.json", x)

x = load("config_debug.json")
c(x, "max_drug_times_" + str(1) + "day", "99")
c(x, "max_drug_times_" + str(2) + "day", "0")
c(x, "max_drug_times_" + str(3) + "day", "0")
c(x, "max_drug_times_" + str(4) + "day", "0")
c(x, "max_drug_times_" + str(5) + "day", "0")
c(x, "max_drug_times_" + str(6) + "day", "0")
c(x, "max_drug_times_" + str(7) + "day", "0")
save("config_debug.json", x)
# x = load("config_debug.json")
# c(x, "max_drug_times_" + str(1) + "day", "99")
# c(x, "max_drug_times_" + str(2) + "day", "99")
# c(x, "max_drug_times_" + str(3) + "day", "1")
# c(x, "max_drug_times_" + str(4) + "day", "1")
# c(x, "max_drug_times_" + str(5) + "day", "1")
# c(x, "max_drug_times_" + str(6) + "day", "1")
# c(x, "max_drug_times_" + str(7) + "day", "1")
# save("config_debug.json", x)

# 重启
restart()
Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ default_findcolor_confidence = 95 / 100
-- 设成1000//30时,真机同时开着B服与官服时会出现点着点着脚本就停(从基建开始做邮件)
frame_milesecond = 1000 // 30
milesecond_after_click = frame_milesecond
release_date = "2022.06.25 13:10"
release_date = "2022.06.26 12:05"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_warn_color = "#ff33ccff"
Expand Down
10 changes: 8 additions & 2 deletions path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ path.fallback = {
-- timeout = 0
x = appear({
"返回确认", "返回确认3", "主题曲已开放", "回归返回",
'start黄框', 'start黄框暗',
}, timeout)
-- disappear("开始行动", min(2, (time() - start_time) / 1000 * 2 / 2))
if x then return true end
Expand Down Expand Up @@ -1918,6 +1919,7 @@ path.总览换班 = function()
-- TODO wait bottom for stable
if not appear(bottom, .2) then reach_bottom = true end
end
if i == 60 then stop('总览换班滑动', 'cur') end
visitedy = {}
while f() do log(475) end
if reach_bottom then break end
Expand Down Expand Up @@ -2196,7 +2198,11 @@ path.线索交流 = function()
appear("线索传递")
clue_unlocked = false
path.线索布置()
if not clue_unlocked then path.线索传递() end
if not clue_unlocked then
path.线索传递()
path.线索传递()
path.线索传递()
end
return f(retry + 1)
end

Expand Down Expand Up @@ -4195,6 +4201,7 @@ path.前瞻投资 = function(lighter)

-- 并非首次
if zl_no_waste_last_time then
zl_no_waste_last_time = nil
saveConfig("hideUIOnce", "true")
save_extra_mode(extra_mode, extra_mode_multi)
restartScript()
Expand All @@ -4203,7 +4210,6 @@ path.前瞻投资 = function(lighter)
-- 首次
zl_no_waste_last_time = time()
if zl_no_waste then
-- todo
transfer_global_variable("multi_account_user0")
update_state_from_ui()
run(no_extra_job)
Expand Down
2 changes: 1 addition & 1 deletion release
Submodule release updated from 0dd782 to a0bef6
25 changes: 15 additions & 10 deletions util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,9 @@ show_debug_ui = function()
-- newRow(layout)
-- ui.addCheckBox(layout, "debug_disable_log", "禁用全部日志", false)

newRow(layout)
ui.addCheckBox(layout, "disable_oom_score_adj", "禁用oom_score_adj", false)

newRow(layout)
ui.addCheckBox(layout, "disable_hotupdate", "禁用自动更新", false)

Expand Down Expand Up @@ -3472,13 +3475,13 @@ enable_snapshot_service = disable_game_up_check_wrapper(function()
if isSnapshotServiceRun() then return end
if skip_snapshot_service_check then return end

if root_mode then
-- if root_mode then
-- log("enable snapshot service by root")
-- TODO need this?
exec("su root sh -c 'appops set " .. package .. " PROJECT_MEDIA allow'")
-- exec("su root sh -c 'appops set " .. package .. " PROJECT_MEDIA allow'")
-- exec("su root sh -c 'appops set " .. package ..
-- " SYSTEM_ALERT_WINDOW allow'")
end
-- end

-- log("3444", 3444)
-- if apk502 then
Expand All @@ -3503,10 +3506,10 @@ enable_snapshot_service = disable_game_up_check_wrapper(function()
-- return
-- end

if wait(function() return isSnapshotServiceRun() end) then return end
-- if wait(function() return isSnapshotServiceRun() end) then return end

openPermissionSetting()
-- _toast("请开启录屏权限")
openPermissionSetting()
if not wait(function()
if isSnapshotServiceRun() then return true end
local p = findOne("snap")
Expand Down Expand Up @@ -5018,6 +5021,7 @@ keepalive = function()
end

killacc = function()
exit()
-- collectgarbage("collect")
if not root_mode then return end
if disable_killacc1 then return end
Expand Down Expand Up @@ -5168,11 +5172,11 @@ while [[ $(date +%s) -lt $endTime ]]; do
continue
fi
snap=$(sed -rn '\''s|.*com.bilabila.arknightsspeedrun2:id/switch_snap.[^>]*bilabila[^>]*bounds=.\[([0-9]*),([0-9]*)\]\[([0-9]*),([0-9]*)\]..*|input tap $(((\1+\3)/2)) $(((\2+\4)/2))|p'\'' /sdcard/window_dump.xml)
if [[ -n $snap ]]; then
eval $snap
continue
fi
# snap=$(sed -rn '\''s|.*com.bilabila.arknightsspeedrun2:id/switch_snap.[^>]*bilabila[^>]*bounds=.\[([0-9]*),([0-9]*)\]\[([0-9]*),([0-9]*)\]..*|input tap $(((\1+\3)/2)) $(((\2+\4)/2))|p'\'' /sdcard/window_dump.xml)
# if [[ -n $snap ]]; then
# eval $snap
# continue
# fi
done
done
' > /dev/null & ]=]
Expand All @@ -5199,6 +5203,7 @@ end

oom_score_adj = function()
if not root_mode then return end
if disable_oom_score_adj then return end
-- if disable_oom_score_adj then return end
-- if not enable_oom_score_adj then return end
-- log("4032")
Expand Down

0 comments on commit b134317

Please sign in to comment.