fix(task): 修复 OCR 识别失败导致培育开始卡在 STEP 检测

This commit is contained in:
XcantloadX 2025-04-16 11:53:09 +08:00
parent 649d4465d8
commit 85bc509b9b
15 changed files with 12 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -1 +0,0 @@
{"definitions":{"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd":{"name":"Produce.ButtonPIdolOverview","displayName":"Pアイドルー覧 P偶像列表展示","type":"template","annotationId":"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd","useHintRect":false},"44ba8515-4a60-42c9-8878-b42e4e34ee15":{"name":"Produce.BoxStepIndicator","displayName":"培育准备页面 当前步骤","type":"hint-box","annotationId":"44ba8515-4a60-42c9-8878-b42e4e34ee15","useHintRect":false}},"annotations":[{"id":"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd","type":"rect","data":{"x1":49,"y1":736,"x2":185,"y2":759},"tip":"Pアイドルー覧 P偶像列表展示"},{"id":"44ba8515-4a60-42c9-8878-b42e4e34ee15","type":"rect","data":{"x1":4,"y1":11,"x2":405,"y2":99}}]}

View File

@ -1 +0,0 @@
{"definitions":{"7e3e3a94-e05c-477e-bd92-0afc172bdb94":{"name":"Produce.BoxSetCountIndicator","displayName":"培育开始页面 当前编成编号","type":"hint-box","annotationId":"7e3e3a94-e05c-477e-bd92-0afc172bdb94","useHintRect":false},"389bdefb-4b76-4ac3-9460-d59c144f8de7":{"name":"Produce.PointProduceNextSet","displayName":"培育开始页面 下一个编成","type":"hint-point","annotationId":"389bdefb-4b76-4ac3-9460-d59c144f8de7","useHintRect":false},"745d904e-19eb-4e15-b734-ef116e6e7c48":{"name":"Produce.PointProducePrevSet","displayName":"培育开始页面 上一个编成","type":"hint-point","annotationId":"745d904e-19eb-4e15-b734-ef116e6e7c48","useHintRect":false}},"annotations":[{"id":"7e3e3a94-e05c-477e-bd92-0afc172bdb94","type":"rect","data":{"x1":17,"y1":671,"x2":119,"y2":707}},{"id":"389bdefb-4b76-4ac3-9460-d59c144f8de7","type":"point","data":{"x":702,"y":832}},{"id":"745d904e-19eb-4e15-b734-ef116e6e7c48","type":"point","data":{"x":14,"y":832}}]}

View File

Before

Width:  |  Height:  |  Size: 790 KiB

After

Width:  |  Height:  |  Size: 790 KiB

View File

Before

Width:  |  Height:  |  Size: 996 KiB

After

Width:  |  Height:  |  Size: 996 KiB

View File

@ -0,0 +1 @@
{"definitions":{"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd":{"name":"Produce.ButtonPIdolOverview","displayName":"Pアイドルー覧 P偶像列表展示","type":"template","annotationId":"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd","useHintRect":false},"44ba8515-4a60-42c9-8878-b42e4e34ee15":{"name":"Produce.TextStepIndicator1","displayName":"1. アイドル選択","type":"template","annotationId":"44ba8515-4a60-42c9-8878-b42e4e34ee15","useHintRect":false}},"annotations":[{"id":"e88c9ad1-ec37-4fcd-b086-862e1e7ce8fd","type":"rect","data":{"x1":49,"y1":736,"x2":185,"y2":759},"tip":"Pアイドルー覧 P偶像列表展示"},{"id":"44ba8515-4a60-42c9-8878-b42e4e34ee15","type":"rect","data":{"x1":18,"y1":32,"x2":168,"y2":66}}]}

View File

@ -0,0 +1 @@
{"definitions":{"7e3e3a94-e05c-477e-bd92-0afc172bdb94":{"name":"Produce.BoxSetCountIndicator","displayName":"培育开始页面 当前编成编号","type":"hint-box","annotationId":"7e3e3a94-e05c-477e-bd92-0afc172bdb94","useHintRect":false},"389bdefb-4b76-4ac3-9460-d59c144f8de7":{"name":"Produce.PointProduceNextSet","displayName":"培育开始页面 下一个编成","type":"hint-point","annotationId":"389bdefb-4b76-4ac3-9460-d59c144f8de7","useHintRect":false},"745d904e-19eb-4e15-b734-ef116e6e7c48":{"name":"Produce.PointProducePrevSet","displayName":"培育开始页面 上一个编成","type":"hint-point","annotationId":"745d904e-19eb-4e15-b734-ef116e6e7c48","useHintRect":false},"a48324ae-7c1a-489e-b3c4-93d12267f88d":{"name":"Produce.TextStepIndicator2","displayName":"2. サポート選択","type":"template","annotationId":"a48324ae-7c1a-489e-b3c4-93d12267f88d","useHintRect":false}},"annotations":[{"id":"7e3e3a94-e05c-477e-bd92-0afc172bdb94","type":"rect","data":{"x1":17,"y1":671,"x2":119,"y2":707}},{"id":"389bdefb-4b76-4ac3-9460-d59c144f8de7","type":"point","data":{"x":702,"y":832}},{"id":"745d904e-19eb-4e15-b734-ef116e6e7c48","type":"point","data":{"x":14,"y":832}},{"id":"a48324ae-7c1a-489e-b3c4-93d12267f88d","type":"rect","data":{"x1":59,"y1":34,"x2":208,"y2":64}}]}

View File

Before

Width:  |  Height:  |  Size: 890 KiB

After

Width:  |  Height:  |  Size: 890 KiB

View File

@ -0,0 +1 @@
{"definitions":{"f43c313b-8a7b-467b-8442-fc5bcb8b4388":{"name":"Produce.TextStepIndicator3","displayName":"3.メモリー選択","type":"template","annotationId":"f43c313b-8a7b-467b-8442-fc5bcb8b4388","useHintRect":false}},"annotations":[{"id":"f43c313b-8a7b-467b-8442-fc5bcb8b4388","type":"rect","data":{"x1":98,"y1":34,"x2":248,"y2":61}}]}

View File

Before

Width:  |  Height:  |  Size: 956 KiB

After

Width:  |  Height:  |  Size: 956 KiB

View File

@ -0,0 +1 @@
{"definitions":{"b62bf889-da3c-495a-8707-f3bde73efe92":{"name":"Produce.TextStepIndicator4","displayName":"4.開始確認","type":"template","annotationId":"b62bf889-da3c-495a-8707-f3bde73efe92","useHintRect":false}},"annotations":[{"id":"b62bf889-da3c-495a-8707-f3bde73efe92","type":"rect","data":{"x1":140,"y1":35,"x2":244,"y2":63}}]}

View File

@ -229,7 +229,7 @@ def do_produce(
logger.info('AP insufficient. Exiting produce.') logger.info('AP insufficient. Exiting produce.')
device.click(image.expect_wait(R.InPurodyuusu.ButtonCancel)) device.click(image.expect_wait(R.InPurodyuusu.ButtonCancel))
return False return False
# 1. 选择 PIdol [screenshots/produce/select_p_idol.png] # 1. 选择 PIdol [screenshots/produce/screenshot_produce_start_1_p_idol.png]
select_idol(idol_skin_id) select_idol(idol_skin_id)
it = Interval() it = Interval()
while True: while True:
@ -239,10 +239,10 @@ def do_produce(
dialog.no() dialog.no()
elif image.find(R.Common.ButtonNextNoIcon): elif image.find(R.Common.ButtonNextNoIcon):
device.click() device.click()
elif ocr.find(contains('サポート'), rect=R.Produce.BoxStepIndicator): elif image.find(R.Produce.TextStepIndicator2):
break break
# 2. 选择支援卡 自动编成 [screenshots/produce/select_support_card.png] # 2. 选择支援卡 自动编成 [screenshots/produce/screenshot_produce_start_2_support_card.png]
ocr.expect_wait(contains('サポート'), rect=R.Produce.BoxStepIndicator) image.expect_wait(R.Produce.TextStepIndicator2)
it = Interval() it = Interval()
while True: while True:
if image.find(R.Common.ButtonNextNoIcon, colored=True): if image.find(R.Common.ButtonNextNoIcon, colored=True):
@ -255,8 +255,8 @@ def do_produce(
device.click() device.click()
device.screenshot() device.screenshot()
it.wait() it.wait()
# 3. 选择回忆 自动编成 [screenshots/produce/select_memory.png] # 3. 选择回忆 自动编成 [screenshots/produce/screenshot_produce_start_3_memory.png]
ocr.expect_wait(contains('メモリー'), rect=R.Produce.BoxStepIndicator) image.expect_wait(R.Produce.TextStepIndicator3)
# 自动编成 # 自动编成
if memory_set_index is not None and not 1 <= memory_set_index <= 10: if memory_set_index is not None and not 1 <= memory_set_index <= 10:
raise ValueError('`memory_set_index` must be in range [1, 10].') raise ValueError('`memory_set_index` must be in range [1, 10].')
@ -268,12 +268,12 @@ def do_produce(
else: else:
select_set(memory_set_index) select_set(memory_set_index)
(SimpleDispatcher('do_produce.step_3') (SimpleDispatcher('do_produce.step_3')
.until(R.Produce.TextStepIndicator4)
.click(R.Common.ButtonNextNoIcon) .click(R.Common.ButtonNextNoIcon)
.click(R.Common.ButtonConfirm) .click(R.Common.ButtonConfirm)
.until(contains('開始確認'), rect=R.Produce.BoxStepIndicator)
).run() ).run()
# 4. 选择道具 [screenshots/produce/select_end.png] # 4. 选择道具 [screenshots/produce/screenshot_produce_start_4_end.png]
# TODO: 如果道具不足,这里加入推送提醒 # TODO: 如果道具不足,这里加入推送提醒
if conf().produce.use_note_boost: if conf().produce.use_note_boost:
if image.find(R.Produce.CheckboxIconNoteBoost): if image.find(R.Produce.CheckboxIconNoteBoost):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 KiB