Fix: [JP] Handle mail empty (#4114)

This commit is contained in:
LmeSzinc 2024-08-23 02:34:40 +08:00
parent b8c89285c1
commit 7eadaa7d8a
4 changed files with 5 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -25,6 +25,7 @@ MAIL_SELECT_CUBE = Button(area={'cn': (442, 401, 462, 421), 'en': (442, 401, 462
MAIL_SELECT_GEMS = Button(area={'cn': (442, 441, 462, 461), 'en': (442, 441, 462, 461), 'jp': (442, 460, 462, 480), 'tw': (442, 441, 462, 461)}, color={'cn': (241, 241, 241), 'en': (241, 241, 241), 'jp': (239, 239, 239), 'tw': (241, 241, 241)}, button={'cn': (442, 441, 462, 461), 'en': (442, 441, 462, 461), 'jp': (442, 460, 462, 480), 'tw': (442, 441, 462, 461)}, file={'cn': './assets/cn/freebies/MAIL_SELECT_GEMS.png', 'en': './assets/en/freebies/MAIL_SELECT_GEMS.png', 'jp': './assets/jp/freebies/MAIL_SELECT_GEMS.png', 'tw': './assets/tw/freebies/MAIL_SELECT_GEMS.png'})
MAIL_SELECT_MERIT = Button(area={'cn': (802, 401, 822, 421), 'en': (802, 401, 822, 421), 'jp': (802, 410, 822, 430), 'tw': (802, 401, 822, 421)}, color={'cn': (87, 87, 88), 'en': (87, 87, 88), 'jp': (239, 239, 239), 'tw': (87, 87, 88)}, button={'cn': (802, 401, 822, 421), 'en': (802, 401, 822, 421), 'jp': (802, 410, 822, 430), 'tw': (802, 401, 822, 421)}, file={'cn': './assets/cn/freebies/MAIL_SELECT_MERIT.png', 'en': './assets/en/freebies/MAIL_SELECT_MERIT.png', 'jp': './assets/jp/freebies/MAIL_SELECT_MERIT.png', 'tw': './assets/tw/freebies/MAIL_SELECT_MERIT.png'})
MAIL_SELECT_OIL = Button(area={'cn': (682, 401, 702, 421), 'en': (682, 401, 702, 421), 'jp': (682, 410, 702, 430), 'tw': (682, 401, 702, 421)}, color={'cn': (241, 240, 241), 'en': (241, 240, 241), 'jp': (239, 239, 239), 'tw': (241, 240, 241)}, button={'cn': (682, 401, 702, 421), 'en': (682, 401, 702, 421), 'jp': (682, 410, 702, 430), 'tw': (682, 401, 702, 421)}, file={'cn': './assets/cn/freebies/MAIL_SELECT_OIL.png', 'en': './assets/en/freebies/MAIL_SELECT_OIL.png', 'jp': './assets/jp/freebies/MAIL_SELECT_OIL.png', 'tw': './assets/tw/freebies/MAIL_SELECT_OIL.png'})
MAIL_WHITE_EMPTY = Button(area={'cn': (178, 375, 266, 400), 'en': (178, 375, 266, 400), 'jp': (178, 375, 266, 400), 'tw': (178, 375, 266, 400)}, color={'cn': (131, 141, 158), 'en': (131, 141, 158), 'jp': (131, 141, 158), 'tw': (131, 141, 158)}, button={'cn': (178, 375, 266, 400), 'en': (178, 375, 266, 400), 'jp': (178, 375, 266, 400), 'tw': (178, 375, 266, 400)}, file={'cn': './assets/cn/freebies/MAIL_WHITE_EMPTY.png', 'en': './assets/cn/freebies/MAIL_WHITE_EMPTY.png', 'jp': './assets/jp/freebies/MAIL_WHITE_EMPTY.png', 'tw': './assets/cn/freebies/MAIL_WHITE_EMPTY.png'})
OCR_DATA_KEY = Button(area={'cn': (132, 42, 233, 70), 'en': (132, 42, 233, 70), 'jp': (132, 42, 233, 70), 'tw': (132, 42, 233, 70)}, color={'cn': (74, 75, 86), 'en': (74, 75, 86), 'jp': (74, 75, 86), 'tw': (74, 75, 86)}, button={'cn': (132, 42, 233, 70), 'en': (132, 42, 233, 70), 'jp': (132, 42, 233, 70), 'tw': (132, 42, 233, 70)}, file={'cn': './assets/cn/freebies/OCR_DATA_KEY.png', 'en': './assets/en/freebies/OCR_DATA_KEY.png', 'jp': './assets/jp/freebies/OCR_DATA_KEY.png', 'tw': './assets/tw/freebies/OCR_DATA_KEY.png'})
PURCHASE_POPUP = Button(area={'cn': (907, 204, 934, 229), 'en': (907, 204, 934, 229), 'jp': (907, 204, 934, 229), 'tw': (907, 204, 934, 229)}, color={'cn': (176, 130, 110), 'en': (176, 130, 110), 'jp': (176, 130, 110), 'tw': (176, 130, 110)}, button={'cn': (907, 204, 934, 229), 'en': (907, 204, 934, 229), 'jp': (907, 204, 934, 229), 'tw': (907, 204, 934, 229)}, file={'cn': './assets/cn/freebies/PURCHASE_POPUP.png', 'en': './assets/en/freebies/PURCHASE_POPUP.png', 'jp': './assets/jp/freebies/PURCHASE_POPUP.png', 'tw': './assets/tw/freebies/PURCHASE_POPUP.png'})
REWARD_RECEIVE = Button(area={'cn': (1192, 520, 1255, 536), 'en': (1192, 522, 1254, 534), 'jp': (1186, 518, 1259, 536), 'tw': (1192, 520, 1255, 536)}, color={'cn': (191, 178, 163), 'en': (195, 182, 168), 'jp': (208, 197, 183), 'tw': (191, 178, 163)}, button={'cn': (1192, 520, 1255, 536), 'en': (1192, 522, 1254, 534), 'jp': (1186, 518, 1259, 536), 'tw': (1192, 520, 1255, 536)}, file={'cn': './assets/cn/freebies/REWARD_RECEIVE.png', 'en': './assets/en/freebies/REWARD_RECEIVE.png', 'jp': './assets/jp/freebies/REWARD_RECEIVE.png', 'tw': './assets/cn/freebies/REWARD_RECEIVE.png'})

View File

@ -64,10 +64,13 @@ class MailWhite(UI):
if self.appear(MAIL_BATCH_CLAIM, offset=(20, 20)):
logger.info('Mail entered')
return True
if self.appear(MAIL_WHITE_EMPTY, offset=(20, 20)):
logger.info('Mail empty')
return False
if not has_mail and self.appear(GOTO_MAIN_WHITE, offset=(20, 20)):
timeout.start()
if timeout.reached():
logger.info('Mail empty')
logger.info('Mail empty, wait GOTO_MAIN_WHITE timeout')
return False
# Click