diff --git a/assets/share/item/synthesize/SYNTHESIZE_INSUFFICIENT.png b/assets/share/item/synthesize/SYNTHESIZE_INSUFFICIENT.png new file mode 100644 index 000000000..004bc15c9 Binary files /dev/null and b/assets/share/item/synthesize/SYNTHESIZE_INSUFFICIENT.png differ diff --git a/tasks/item/assets/assets_item_synthesize.py b/tasks/item/assets/assets_item_synthesize.py index e6cdabcdb..a9c4bf67c 100644 --- a/tasks/item/assets/assets_item_synthesize.py +++ b/tasks/item/assets/assets_item_synthesize.py @@ -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( diff --git a/tasks/item/synthesize.py b/tasks/item/synthesize.py index aebc2d64d..8a4ab1805 100644 --- a/tasks/item/synthesize.py +++ b/tasks/item/synthesize.py @@ -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