修复运行日志复核发现的任务控制与结果误判
This commit is contained in:
+13
-5
@@ -411,6 +411,7 @@ def cmd_progress(target=34, uptie=True, max_try=6):
|
|||||||
if not team:
|
if not team:
|
||||||
print('未找到队内(SELECTED)人格')
|
print('未找到队内(SELECTED)人格')
|
||||||
return 1
|
return 1
|
||||||
|
unreadable = 0
|
||||||
for ci, ri, cx, ry, ocr_lvl, sel, nm in team[:max_try]:
|
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))
|
print('--- 候选 col=%d row=%d (网格读作 Lv.%s %s)' % (ci, ri, ocr_lvl, nm))
|
||||||
# 长按前先清残留弹窗: 一张卡没关干净, 后面每张都会被挡住
|
# 长按前先清残留弹窗: 一张卡没关干净, 后面每张都会被挡住
|
||||||
@@ -422,13 +423,16 @@ def cmd_progress(target=34, uptie=True, max_try=6):
|
|||||||
txt = screen_text(items)
|
txt = screen_text(items)
|
||||||
if not detail_page_open(txt):
|
if not detail_page_open(txt):
|
||||||
print(' 长按未打开详情, 跳过')
|
print(' 长按未打开详情, 跳过')
|
||||||
|
unreadable += 1
|
||||||
continue
|
continue
|
||||||
true_lvl, true_name, _ = read_detail(hint=ocr_lvl)
|
true_lvl, true_name, _ = read_detail(hint=ocr_lvl)
|
||||||
print(' 详情页: %s 真实等级=%s' % (true_name, true_lvl))
|
print(' 详情页: %s 真实等级=%s' % (true_name, true_lvl))
|
||||||
if true_lvl is None:
|
if true_lvl is None:
|
||||||
# 详情页读不到时退回网格值——网格会误读, 但总比跳过整张卡好
|
print(' 详情页读不到等级, 无法确认是否需要升级, 跳过')
|
||||||
print(' 详情页读不到等级, 退回网格值 Lv.%s' % ocr_lvl)
|
unreadable += 1
|
||||||
true_lvl = ocr_lvl
|
click(*BACK)
|
||||||
|
time.sleep(2.5)
|
||||||
|
continue
|
||||||
if true_lvl >= target:
|
if true_lvl >= target:
|
||||||
print(' 已达目标 Lv.%d, 跳过' % target)
|
print(' 已达目标 Lv.%d, 跳过' % target)
|
||||||
click(*BACK)
|
click(*BACK)
|
||||||
@@ -436,6 +440,7 @@ def cmd_progress(target=34, uptie=True, max_try=6):
|
|||||||
continue
|
continue
|
||||||
ok, desc = do_level_up(hint=true_lvl)
|
ok, desc = do_level_up(hint=true_lvl)
|
||||||
print(' 升级: %s (%s)' % ('OK' if ok else ('SKIP' if ok is None else 'FAIL'), desc))
|
print(' 升级: %s (%s)' % ('OK' if ok else ('SKIP' if ok is None else 'FAIL'), desc))
|
||||||
|
ok2 = True
|
||||||
if uptie:
|
if uptie:
|
||||||
ok2, desc2 = do_uptie()
|
ok2, desc2 = do_uptie()
|
||||||
print(' 同步: %s (%s)' % ('OK' if ok2 else 'FAIL', desc2))
|
print(' 同步: %s (%s)' % ('OK' if ok2 else 'FAIL', desc2))
|
||||||
@@ -446,8 +451,11 @@ def cmd_progress(target=34, uptie=True, max_try=6):
|
|||||||
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)
|
||||||
return 0 if ok else 1
|
return 0 if ok and ok2 else 1
|
||||||
print('前 %d 个候选都不需要升级或无法读取' % max_try)
|
if unreadable:
|
||||||
|
print('FAIL: %d 个候选未能核实详情等级, 不能判定为无需升级' % unreadable)
|
||||||
|
return 1
|
||||||
|
print('已核实的 %d 个候选均达到目标等级, 无需升级' % len(team[:max_try]))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user