Skip to content

Commit

Permalink
dlt support all resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
tkkcc committed May 30, 2022
1 parent 6b9a667 commit a221fa4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
*.png -text
*.zip -text
*.lr -text
/dlt.py filter=dlt


31 changes: 21 additions & 10 deletions dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@





def mode(serial, f="help", *args, **kwargs):
serial = str(serial)
package = "com.bilabila.arknightsspeedrun2"
Expand Down Expand Up @@ -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")
Expand All @@ -259,7 +269,6 @@ def stop(app=package):
adb("shell", "am", "force-stop", app)

def start():
# 720x1280 only 华云
adb("shell", "input", "home")
adb(
"shell",
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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通知使用,会有每小时进度提醒与完成等级/源石锭/商品需求后的通知。

Expand Down Expand Up @@ -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

### 肉鸽模式
# 设置官服账号,切号
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.05.29 21:59"
release_date = "2022.05.30 17:30"
ui_submit_color = "#ff0d47a1"
ui_cancel_color = "#ff1976d2"
ui_warn_color = "#ff33ccff"
Expand Down
3 changes: 2 additions & 1 deletion path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a221fa4

Please sign in to comment.