1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-19 06:03:34 +08:00
Files
AzurLaneAutoScript/module/shop/shop_reward.py

49 lines
1.7 KiB
Python
Raw Normal View History

2023-05-25 23:03:17 +08:00
from module.logger import logger
2021-12-24 12:35:34 -05:00
from module.shop.shop_core import CoreShop
2021-07-10 23:11:32 -04:00
from module.shop.shop_general import GeneralShop
from module.shop.shop_guild import GuildShop
2022-06-05 22:42:08 +08:00
from module.shop.shop_medal import MedalShop2
2021-07-10 23:11:32 -04:00
from module.shop.shop_merit import MeritShop
from module.shop.ui import ShopUI
class RewardShop(ShopUI):
def run_frequent(self):
# Munitions shops
2021-09-23 22:04:03 +08:00
self.ui_goto_shop()
GeneralShop(self.config, self.device).run()
2021-09-23 22:04:03 +08:00
self.config.task_delay(server_update=True)
2021-09-23 22:04:03 +08:00
def run_once(self):
# Munitions shops
self.ui_goto_shop()
2021-09-23 22:04:03 +08:00
2023-05-25 23:03:17 +08:00
current = self._shop_bottom_navbar.get_active(main=self)
logger.info(f'Shop nav actives at left={current}')
2023-05-25 23:03:17 +08:00
if current is not None:
current += 1
# prototype, core, merit, general, event
# core, merit, general, event, event (2 event shops sometimes)
if self.shop_bottom_navbar_ensure(left=current - 1):
MeritShop(self.config, self.device).run()
2021-09-23 22:04:03 +08:00
2023-05-25 23:03:17 +08:00
if self.shop_bottom_navbar_ensure(left=current - 2):
CoreShop(self.config, self.device).run()
else:
logger.error('Cannot get the position of general shop, skip merit shop and core shop')
self.shop_swipe()
# meta, medal, guild, prototype, core
if self.shop_bottom_navbar_ensure(left=3):
GuildShop(self.config, self.device).run()
2021-12-24 12:35:34 -05:00
2023-05-25 23:03:17 +08:00
if self.shop_bottom_navbar_ensure(left=2):
2022-06-05 22:42:08 +08:00
MedalShop2(self.config, self.device).run()
2022-06-05 22:42:08 +08:00
# Cannot go back to general shop so don't stay in page_munitions
self.ui_goto_main()
2021-12-22 00:46:39 +08:00
self.config.task_delay(server_update=True)