自动化实战踩坑全记录 + 20 份运行日志归档
把 2026-10-05 无人值守养号过程中挖出的 14 个坑整理成 PITFALLS.md, 并按"离奇程度"排序。其中 6 个是 AALC 自身的缺陷或脆弱点。 最有价值的几条: - 人格详情页是"长按"打开的, 单击只能选中(移动端移植 UI 的反直觉设计)。 - 按名字选队会子串误匹配: "TEAMS #1" 是 "TEAMS #10" 的子串, 本机 40 个预设下极易命中空队伍, 且日志仍报"成功找到队伍 # 1"(假阳性), 症状是 0/5 刷屏 306 次、空转 27 分钟。 - 位置法选队会随列表滚动漂移, 落到 TEAMS #2; 固定偏移量补丁无效(已还原), 因为复位滑动的终点本身在漂移。 - 最终解法: 用游戏内 Team Code 把队伍复制进多个预设, 让落点不再有意义。 此后 10 轮 daily 全部 6/6 选队、0 卡死、0 错误。 - 同步到三阶会解锁并自动播放人格剧情, 导致脚本误报同步失败。 - 等级数字 OCR 两处都不可靠(网格小字与详情页艺术字), 改用 EXP 进度条反推。 - 主界面上按返回键会进入剧情 Drive; 拖拽滚动预设列表时起点必须在列表内。 logs/full/ 为 20 份原始日志的 gzip 归档(9.8MB -> 0.7MB), logs/summary.md 给出逐份指标对比与关键转折点, logs/*.txt 为四次关键事件的精简片段。 战果: 10 轮完整 daily, 升级 5 个人格(最高 Lv.04->36), 同步解锁技能3, 账号 037->041, 狂气 2896->3476 一分未花。
This commit is contained in:
+172
-4
@@ -195,14 +195,41 @@ def do_level_up():
|
|||||||
return ok, '升级前券=%s 目标等级=%s' % (before, target)
|
return ok, '升级前券=%s 目标等级=%s' % (before, target)
|
||||||
|
|
||||||
|
|
||||||
|
def skip_cutscene():
|
||||||
|
"""同步到三阶会解锁人格剧情并自动播放。ESC 会弹"是否跳过", 点 Confirm。
|
||||||
|
|
||||||
|
返回 True 表示确实跳过一个过场。
|
||||||
|
"""
|
||||||
|
items = state().get('items', [])
|
||||||
|
txt = screen_text(items)
|
||||||
|
if 'skip' not in txt.lower():
|
||||||
|
probe('keypress', {'key': 'esc'})
|
||||||
|
time.sleep(2)
|
||||||
|
items = state().get('items', [])
|
||||||
|
txt = screen_text(items)
|
||||||
|
if 'skip' in txt.lower():
|
||||||
|
conf = None
|
||||||
|
for it in items:
|
||||||
|
if it.get('text', '').strip().startswith('Confirm'):
|
||||||
|
conf = it
|
||||||
|
if conf:
|
||||||
|
click(conf['x'], conf['y'])
|
||||||
|
time.sleep(4)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def do_uptie():
|
def do_uptie():
|
||||||
"""在人格详情页执行同步。返回 (ok, 描述)"""
|
"""在人格详情页执行同步。返回 (ok, 描述)
|
||||||
|
|
||||||
|
注意: 同步成功会解锁并自动播放"人格剧情", 此时界面既没有 Uptied 字样
|
||||||
|
也不是失败——必须先跳过过场再判定, 否则会误报 FAIL。
|
||||||
|
"""
|
||||||
for attempt in range(2):
|
for attempt in range(2):
|
||||||
click(*BTN_UPTIE)
|
click(*BTN_UPTIE)
|
||||||
time.sleep(4)
|
time.sleep(4)
|
||||||
items = state().get('items', [])
|
items = state().get('items', [])
|
||||||
txt = screen_text(items)
|
txt = screen_text(items)
|
||||||
# Uptie 弹窗独有: 'Currency Req' / 'Stats Increased' / 'Skills Gained'
|
|
||||||
if ('Currency Req' in txt or 'Stats Increased' in txt
|
if ('Currency Req' in txt or 'Stats Increased' in txt
|
||||||
or 'Skills Gained' in txt or 'Skills Upgraded' in txt):
|
or 'Skills Gained' in txt or 'Skills Upgraded' in txt):
|
||||||
break
|
break
|
||||||
@@ -210,15 +237,24 @@ def do_uptie():
|
|||||||
return False, '未打开 Uptie 弹窗: ' + txt[:160]
|
return False, '未打开 Uptie 弹窗: ' + txt[:160]
|
||||||
click(*UPTIE_CONFIRM)
|
click(*UPTIE_CONFIRM)
|
||||||
time.sleep(4.5)
|
time.sleep(4.5)
|
||||||
|
|
||||||
|
if skip_cutscene():
|
||||||
|
time.sleep(3)
|
||||||
|
return True, '同步成功(并跳过了解锁的人格剧情)'
|
||||||
|
|
||||||
items = state().get('items', [])
|
items = state().get('items', [])
|
||||||
txt = screen_text(items)
|
txt = screen_text(items)
|
||||||
if 'Uptied' in txt or 'Enhanced' in txt or 'Gained' in txt:
|
if 'Uptied' in txt or 'Enhanced' in txt or 'Gained' in txt:
|
||||||
click(*UPTIE_DONE_CONFIRM)
|
click(*UPTIE_DONE_CONFIRM)
|
||||||
time.sleep(2.5)
|
time.sleep(2.5)
|
||||||
return True, '同步成功'
|
return True, '同步成功'
|
||||||
|
if 'Owned' in txt or 'Egoshard' in txt:
|
||||||
click(*UPTIE_CANCEL)
|
click(*UPTIE_CANCEL)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
return False, '同步未生效: ' + txt[:160]
|
return False, '同步未生效(通常缺自我碎片): ' + txt[:160]
|
||||||
|
click(*UPTIE_CANCEL)
|
||||||
|
time.sleep(2)
|
||||||
|
return False, '同步结果未知: ' + txt[:160]
|
||||||
|
|
||||||
|
|
||||||
def cmd_card(ci, ri, uptie=False):
|
def cmd_card(ci, ri, uptie=False):
|
||||||
@@ -242,9 +278,15 @@ def cmd_card(ci, ri, uptie=False):
|
|||||||
print('同步: %s (%s)' % ('OK' if ok2 else 'FAIL', desc2))
|
print('同步: %s (%s)' % ('OK' if ok2 else 'FAIL', desc2))
|
||||||
click(*BACK)
|
click(*BACK)
|
||||||
time.sleep(2.5)
|
time.sleep(2.5)
|
||||||
# 只在还不在网格时再退一层——避免多余返回键落到主界面上(那里会进剧情)
|
|
||||||
items = state().get('items', [])
|
items = state().get('items', [])
|
||||||
txt = screen_text(items)
|
txt = screen_text(items)
|
||||||
|
# 同步解锁的人格剧情可能在返回途中才弹出, 先跳过再判断
|
||||||
|
if 'skip' in txt.lower() or 'LOADING' in txt.upper():
|
||||||
|
skip_cutscene()
|
||||||
|
time.sleep(3)
|
||||||
|
items = state().get('items', [])
|
||||||
|
txt = screen_text(items)
|
||||||
|
# 只在还不在网格时再退一层——避免多余返回键落到主界面上(那里会进剧情)
|
||||||
if not ('IDENTITIES' in txt and 'Facades' in txt):
|
if not ('IDENTITIES' in txt and 'Facades' in txt):
|
||||||
click(*BACK)
|
click(*BACK)
|
||||||
time.sleep(2.5)
|
time.sleep(2.5)
|
||||||
@@ -255,6 +297,126 @@ def cmd_card(ci, ri, uptie=False):
|
|||||||
return 0 if ok else 1
|
return 0 if ok else 1
|
||||||
|
|
||||||
|
|
||||||
|
# 每级升级所需经验(来源 wiki "EXP per Level" 表)。
|
||||||
|
# EXP_NEED[L] = 从 L-1 级升到 L 级所需经验。
|
||||||
|
EXP_NEED = {
|
||||||
|
2: 10, 3: 12, 4: 15, 5: 20, 6: 27, 7: 40, 8: 59, 9: 88, 10: 125, 11: 168,
|
||||||
|
12: 227, 13: 298, 14: 381, 15: 482, 16: 591, 17: 728, 18: 885, 19: 1064,
|
||||||
|
20: 1261, 21: 1488, 22: 1739, 23: 2016, 24: 2327, 25: 2674, 26: 3047,
|
||||||
|
27: 3456, 28: 3899, 29: 4378, 30: 4899, 31: 3899, 32: 4378, 33: 4899,
|
||||||
|
34: 5468, 35: 6075, 36: 4899, 37: 5468, 38: 6075, 39: 6722, 40: 7413,
|
||||||
|
41: 6075, 42: 6722, 43: 7413, 44: 8156, 45: 8953, 46: 7413, 47: 7413,
|
||||||
|
48: 7413, 49: 7413, 50: 7413, 51: 8156, 52: 8156, 53: 8156, 54: 8156,
|
||||||
|
55: 8156, 56: 8953, 57: 8953, 58: 8953, 59: 8953, 60: 8953, 61: 9792,
|
||||||
|
62: 9792, 63: 9792, 64: 9792, 65: 9792,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def level_from_bar(cur, need, hint=None):
|
||||||
|
"""由详情页 EXP 进度条 "cur/need" 反推等级。
|
||||||
|
|
||||||
|
进度条分母 = 当前等级升下一级所需经验 = EXP_NEED[L+1]。
|
||||||
|
表里数值有重复(如 4899 对应 30/33/36), 用网格读到的等级作 tiebreak。
|
||||||
|
"""
|
||||||
|
cands = [lv - 1 for lv, v in EXP_NEED.items() if v == need and lv - 1 >= 1]
|
||||||
|
if not cands:
|
||||||
|
return None
|
||||||
|
if hint:
|
||||||
|
return min(cands, key=lambda c: abs(c - hint))
|
||||||
|
return cands[0]
|
||||||
|
|
||||||
|
|
||||||
|
def read_detail(hint=None):
|
||||||
|
"""从已打开的人格详情页读 (真实等级, 名字)。
|
||||||
|
|
||||||
|
网格里的小号艺术字 OCR 极不可靠(实测 LV14->'Lv.1', LV24->'LV2H');
|
||||||
|
详情页的大号等级也常被漏认(实测 LCB 罪人页只认出 '547/885')。
|
||||||
|
所以以 EXP 进度条反推为主, 直接读到的 LV 值为辅。
|
||||||
|
"""
|
||||||
|
items = state().get('items', [])
|
||||||
|
lv_cands = []
|
||||||
|
name = ''
|
||||||
|
bar = None
|
||||||
|
for it in items:
|
||||||
|
t = it.get('text', '').strip()
|
||||||
|
y = it.get('y', 0)
|
||||||
|
up = t.upper().replace(' ', '')
|
||||||
|
if up.startswith('LV') and 140 < y < 340:
|
||||||
|
v = parse_level(t)
|
||||||
|
if v:
|
||||||
|
lv_cands.append(v)
|
||||||
|
if 120 < y < 195 and len(t) > 6 and not up.startswith('LV'):
|
||||||
|
if not name:
|
||||||
|
name = t
|
||||||
|
if bar is None and 195 < y < 300 and '/' in t:
|
||||||
|
parts = [p for p in t.split('/') if p.strip().isdigit()]
|
||||||
|
if len(parts) == 2:
|
||||||
|
bar = (int(parts[0]), int(parts[1]))
|
||||||
|
|
||||||
|
direct = min(lv_cands) if lv_cands else None
|
||||||
|
from_bar = level_from_bar(bar[0], bar[1], hint=hint) if bar else None
|
||||||
|
|
||||||
|
if from_bar is not None and direct is not None:
|
||||||
|
# 两者都有时以进度条为准(数字识别比艺术字可靠), 但差异过大时告警
|
||||||
|
if abs(from_bar - direct) > 2:
|
||||||
|
print(' [warn] 进度条推算 Lv.%d 与直读 Lv.%d 不符, 取进度条'
|
||||||
|
% (from_bar, direct))
|
||||||
|
return from_bar, name
|
||||||
|
if from_bar is not None:
|
||||||
|
return from_bar, name
|
||||||
|
if direct is not None:
|
||||||
|
return direct, name
|
||||||
|
return None, name
|
||||||
|
|
||||||
|
|
||||||
|
def cmd_progress(target=34, uptie=True, max_try=6):
|
||||||
|
"""按网格等级升序依次打开详情, 以详情页真实等级判断, 升级第一个低于 target 的。
|
||||||
|
|
||||||
|
网格 OCR 会误读等级, 所以不能只信它——必须逐个打开核实。
|
||||||
|
"""
|
||||||
|
items = state().get('items', [])
|
||||||
|
cards = scan_grid(items)
|
||||||
|
team = sorted([c for c in cards if c[5]], key=lambda c: c[4])
|
||||||
|
if not team:
|
||||||
|
print('未找到队内(SELECTED)人格')
|
||||||
|
return 1
|
||||||
|
for ci, ri, cx, ry, ocr_lvl, sel, nm in team[:max_try]:
|
||||||
|
print('--- 候选 col=%d row=%d (网格读作 Lv.%s %s)' % (ci, ri, ocr_lvl, nm))
|
||||||
|
long_press(cx, ry)
|
||||||
|
time.sleep(4)
|
||||||
|
items = state().get('items', [])
|
||||||
|
txt = screen_text(items)
|
||||||
|
if 'Level Up' not in txt:
|
||||||
|
print(' 长按未打开详情, 跳过')
|
||||||
|
continue
|
||||||
|
true_lvl, true_name = read_detail(hint=ocr_lvl)
|
||||||
|
print(' 详情页: %s 真实等级=%s' % (true_name, true_lvl))
|
||||||
|
if true_lvl is None:
|
||||||
|
# 详情页读不到时退回网格值——网格会误读, 但总比跳过整张卡好
|
||||||
|
print(' 详情页读不到等级, 退回网格值 Lv.%s' % ocr_lvl)
|
||||||
|
true_lvl = ocr_lvl
|
||||||
|
if true_lvl >= target:
|
||||||
|
print(' 已达目标 Lv.%d, 跳过' % target)
|
||||||
|
click(*BACK)
|
||||||
|
time.sleep(2.5)
|
||||||
|
continue
|
||||||
|
ok, desc = do_level_up()
|
||||||
|
print(' 升级: %s (%s)' % ('OK' if ok else ('SKIP' if ok is None else 'FAIL'), desc))
|
||||||
|
if uptie:
|
||||||
|
ok2, desc2 = do_uptie()
|
||||||
|
print(' 同步: %s (%s)' % ('OK' if ok2 else 'FAIL', desc2))
|
||||||
|
click(*BACK)
|
||||||
|
time.sleep(2.5)
|
||||||
|
items = state().get('items', [])
|
||||||
|
txt = screen_text(items)
|
||||||
|
if not ('IDENTITIES' in txt and 'Facades' in txt):
|
||||||
|
click(*BACK)
|
||||||
|
time.sleep(2.5)
|
||||||
|
return 0 if ok else 1
|
||||||
|
print('前 %d 个候选都不需要升级或无法读取' % max_try)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def cmd_weakest(uptie=False):
|
def cmd_weakest(uptie=False):
|
||||||
items = state().get('items', [])
|
items = state().get('items', [])
|
||||||
cards = scan_grid(items)
|
cards = scan_grid(items)
|
||||||
@@ -288,6 +450,12 @@ def main():
|
|||||||
return cmd_back()
|
return cmd_back()
|
||||||
if args[0] == 'weakest':
|
if args[0] == 'weakest':
|
||||||
return cmd_weakest(uptie='--uptie' in args)
|
return cmd_weakest(uptie='--uptie' in args)
|
||||||
|
if args[0] == 'progress':
|
||||||
|
tgt = 34
|
||||||
|
for a in args[1:]:
|
||||||
|
if a.isdigit():
|
||||||
|
tgt = int(a)
|
||||||
|
return cmd_progress(target=tgt, uptie='--uptie' in args)
|
||||||
if args[0] == 'card' and len(args) >= 3:
|
if args[0] == 'card' and len(args) >= 3:
|
||||||
return cmd_card(int(args[1]), int(args[2]), uptie='--uptie' in args)
|
return cmd_card(int(args[1]), int(args[2]), uptie='--uptie' in args)
|
||||||
print(__doc__)
|
print(__doc__)
|
||||||
|
|||||||
Reference in New Issue
Block a user