Fix: synthesize_confirm() ends with SYNTHESIZE_INSUFFICIENT

This commit is contained in:
LmeSzinc 2024-06-18 02:37:29 +08:00
parent a7bebab04d
commit 68c918b221
3 changed files with 16 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -63,6 +63,16 @@ SYNTHESIZE_CONFIRM = ButtonWrapper(
button=(730, 641, 998, 675),
),
)
SYNTHESIZE_INSUFFICIENT = ButtonWrapper(
name='SYNTHESIZE_INSUFFICIENT',
share=Button(
file='./assets/share/item/synthesize/SYNTHESIZE_INSUFFICIENT.png',
area=(510, 564, 1220, 594),
search=(490, 544, 1240, 614),
color=(177, 102, 95),
button=(510, 564, 1220, 594),
),
)
SYNTHESIZE_INVENTORY = ButtonWrapper(
name='SYNTHESIZE_INVENTORY',
share=Button(

View File

@ -392,6 +392,9 @@ class Synthesize(CombatObtain, ItemUI):
def appear_confirm():
return self.image_color_count(SYNTHESIZE_CONFIRM, color=(226, 229, 232), threshold=221, count=1000)
def appear_insufficient():
return self.image_color_count(SYNTHESIZE_INSUFFICIENT, color=(172, 95, 87), threshold=221, count=5000)
# SYNTHESIZE_CONFIRM -> reward_appear
while 1:
if skip_first_screenshot:
@ -423,6 +426,9 @@ class Synthesize(CombatObtain, ItemUI):
if appear_confirm():
logger.info('Synthesize end')
break
if appear_insufficient():
logger.info('Synthesize end, item insufficient')
break
# Click
if self.handle_reward(click_button=SYNTHESIZE_MINUS):
continue