diff --git a/.gitattributes b/.gitattributes index 230773a..7a83a86 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,6 @@ *.png -text *.zip -text *.lr -text +/dlt.py filter=dlt + diff --git a/dlt.py b/dlt.py index 5036075..91e1ae6 100755 --- a/dlt.py +++ b/dlt.py @@ -35,8 +35,6 @@ - - def mode(serial, f="help", *args, **kwargs): serial = str(serial) package = "com.bilabila.arknightsspeedrun2" @@ -232,14 +230,26 @@ def clear(): x = {} save("config_multi_account.json", x) - def findNode(text="",path='tmp.xml'): + def findNode(text=""): import xml.etree.ElementTree as ET - x = adb("shell", "uiautomator", "dump", "/sdcard/window_dump.xml") - adb("pull", "/sdcard/window_dump.xml", path) - tree = ET.parse(path) + x = adb("exec-out", "uiautomator", "dump", "/dev/tty") + x = re.search("(<.+>)", x).group(1) + tree = ET.XML(x) + btn = None + for elem in tree.iter(): + elem = elem.attrib + if elem.get("text", None) == text: + btn = elem.get("bounds", None) + break + else: + return + btn = re.search("(\d+)[^\d]+(\d+)[^\d]+(\d+)[^\d]+(\d+)", btn).groups() + x = (int(btn[0]) + int(btn[2])) // 2 + y = (int(btn[1]) + int(btn[3])) // 2 + return x, y - return tree + # return ET.tostring(tree, encoding='unicode') def foreground(): x = adb("shell", "dumpsys", "activity", "recents") @@ -259,7 +269,6 @@ def stop(app=package): adb("shell", "am", "force-stop", app) def start(): - # 720x1280 only 华云 adb("shell", "input", "home") adb( "shell", @@ -278,7 +287,9 @@ def start(): # print("see_package",see_package) if foreground() == package: see_package = True - adb("shell", "input", "tap", "300", "1250") + x, y = findNode("确定") + if x and y: + adb("shell", "input", "tap", str(x), str(y)) # adb("shell", "input", "tap", "300", "1160") elif see_package: break @@ -350,7 +361,7 @@ def rg2(operator=None, times=None, skill=None, level=None): # 重启 restart(rg=True) - def restart(account='', hide=True, rg=False, game=False): + def restart(account="", hide=True, rg=False, game=False): if account: x = load("config_multi_account.json") c( diff --git a/docs/guide.md b/docs/guide.md index ca5fb4b..10e4528 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -438,11 +438,11 @@ pr => pr-a-2*99 pr-b-2*99 ... pr-a-1*99 pr-b-1*99 ... 点击`肉鸽/公招`按钮 -选择常见5、6星近卫,推荐(数字表示技能)临光1、煌2、山2、羽毛笔1、帕拉斯1、赫拉格2、史尔特尔2、银灰1、幽灵鲨1、拉狗2,更多干员测试见群精华消息。 +选择常见近卫,如(数字表示技能)耀光1、煌2、山2、帕拉斯1、赫拉格2、史尔特尔2、银灰1、羽毛笔1、幽灵鲨1、拉狗2。 -刷等级蜡烛应选`正式难度`,勾`多点蜡烛`、`跳过投币`,从0到110正常需要36小时,最快26小时。 +刷等级蜡烛应选`正式难度`,勾`多点蜡烛`、`跳过投币`,从0到110正常需36小时,最快26小时。 -刷源石锭应选`观光难度`,从0到999耗时与结局相关。双结局耗时10时14分(97个/时),三结局耗时8时10分(122个/时),低网络延迟+三结局耗时[7时21分](https://www.bilibili.com/video/BV11T4y1S7cj)(135个/时) +刷源石锭应选`观光难度`,从0到999的耗时与结局通关数量相关。双结局耗时10时14分(97个/时),三结局耗时8时10分(122个/时),低网络延迟+三结局耗时[7时21分](https://www.bilibili.com/video/BV11T4y1S7cj)(135个/时) 建议勾选每8小时做日常,并设置好关卡。建议配合QQ通知使用,会有每小时进度提醒与完成等级/源石锭/商品需求后的通知。 @@ -655,7 +655,7 @@ qqimagedeliver --username=12345 --password=abcde --maxtry=2 # 再密码登录 # 开打 0 m 9 restart # 开打,临时打第10个 -0 m 9 first 10 +0 m 9 restart 10 ### 肉鸽模式 # 设置官服账号,切号 diff --git a/main.lua b/main.lua index 768d880..a512b1f 100644 --- a/main.lua +++ b/main.lua @@ -50,7 +50,7 @@ default_findcolor_confidence = 95 / 100 -- 设成1000//30时,真机同时开着B服与官服时会出现点着点着脚本就停(从基建开始做邮件) frame_milesecond = 1000 // 30 milesecond_after_click = frame_milesecond -release_date = "2022.05.29 21:59" +release_date = "2022.05.30 17:30" ui_submit_color = "#ff0d47a1" ui_cancel_color = "#ff1976d2" ui_warn_color = "#ff33ccff" diff --git a/path.lua b/path.lua index 01c2243..c729dd7 100644 --- a/path.lua +++ b/path.lua @@ -4517,7 +4517,8 @@ path.前瞻投资 = function(lighter) ssleep(.5) end log(28, zl_best_operator) - if str2int(zl_best_operator, -1) < 1 then + local idx = str2int(zl_best_operator, -1) + if idx < 1 or idx > 12 then stop("请设置近卫干员序号(1~12)", false, true) end tap("近卫招募列表" .. (zl_best_operator or 1)) diff --git a/skill.lua b/skill.lua index 843ec11..40db1fa 100644 --- a/skill.lua +++ b/skill.lua @@ -642,6 +642,8 @@ manufacturingStationOperatorBest = function(operator, tradingStationNum, -- 禁止过小容量 if maxStorage + table.sum(storage) < 20 then base = -1 end + -- 禁止多次减容量 + if table.sum(storage) < -15 then base = -1 end if debug_mode then log(428.5, icon, icons, base, station, storage) end diff --git a/util.lua b/util.lua index 223677c..2407c3b 100644 --- a/util.lua +++ b/util.lua @@ -2745,7 +2745,7 @@ show_debug_ui = function() ui.addEditText(layout, "max_fight_failed_times", "2") newRow(layout) - addTextView(layout, "单号最大剿灭次数") + addTextView(layout, "单号最大成功剿灭次数") ui.addEditText(layout, "max_jmfight_times", "") -- newRow(layout)