Skip to content

Commit

Permalink
feat: daily_forgottenhall
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Sep 22, 2023
1 parent e802f5c commit f632e25
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
7 changes: 7 additions & 0 deletions app/setting_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ def __init__(self, parent=None):
"此设置不会影响领取无名勋礼经验,大月卡玩家请不要开启此功能",
"srpass_enable"
)
self.dailyForgottenhallEnableCard = SwitchSettingCard1(
FIF.TILES,
self.tr('启用完成1次「忘却之庭」'),
"请解锁混沌回忆并配置了队伍1后再打开该选项",
"daily_forgottenhall_enable"
)
# self.photoEnableCard = SwitchSettingCard1(
# FIF.PHOTO,
# self.tr('启用每日拍照'),
Expand Down Expand Up @@ -451,6 +457,7 @@ def __initLayout(self):
self.DailyGroup.addSettingCard(self.mailEnableCard)
self.DailyGroup.addSettingCard(self.assistEnableCard)
self.DailyGroup.addSettingCard(self.srpassEnableCard)
self.DailyGroup.addSettingCard(self.dailyForgottenhallEnableCard)
# self.DailyGroup.addSettingCard(self.photoEnableCard)
# self.DailyGroup.addSettingCard(self.synthesisEnableCard)
self.DailyGroup.addSettingCard(self.lastRunTimeCard)
Expand Down
2 changes: 2 additions & 0 deletions assets/config/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ dispatch_enable: true # 领取派遣奖励
mail_enable: true # 领取邮件奖励
assist_enable: true # 领取支援奖励
srpass_enable: false # 领取无名勋礼奖励

daily_forgottenhall_enable: false # 完成1次「忘却之庭」每日实训
daily_tasks: # 每日实训
完成1个日常任务: false
完成1次「拟造花萼(金)」: false
Expand Down
43 changes: 22 additions & 21 deletions tasks/weekly/forgottenhall.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,24 +269,25 @@ def start():

@staticmethod
def start_daily():
try:
flag = False
logger.hr(_("准备回忆一"), 2)
screen.change_to("memory")
auto.mouse_scroll(30, 1)
time.sleep(2)
if auto.click_element("01", "text", max_retries=10, crop=(18.0 / 1920, 226.0 / 1080, 1896.0 / 1920, 656.0 / 1080)):
if auto.find_element("./assets/images/forgottenhall/team1.png", "image", 0.8, max_retries=10, crop=(610 / 1920, 670 / 1080, 118 / 1920, 218 / 1080)):
auto.take_screenshot(crop=(30 / 1920, 115 / 1080, 530 / 1920, 810 / 1080))
for character in config.forgottenhall_team1:
auto.click_element(f"./assets/images/character/{character[0]}.png", "image",
0.8, max_retries=10, scale_range=(0.8, 1.2), take_screenshot=False)
if auto.click_element("回忆", "text", max_retries=10, crop=(1546 / 1920, 962 / 1080, 343 / 1920, 62 / 1080), include=True):
ForgottenHall.click_message_box()
if ForgottenHall.start_fight(1, 1):
flag = True
logger.info(_("回忆一完成"))
return flag
except Exception as e:
logger.error(_("回忆一失败: {error}").format(error=e))
return False
if config.daily_forgottenhall_enable:
try:
flag = False
logger.hr(_("准备回忆一"), 2)
screen.change_to("memory")
auto.mouse_scroll(30, 1)
time.sleep(2)
if auto.click_element("01", "text", max_retries=10, crop=(18.0 / 1920, 226.0 / 1080, 1896.0 / 1920, 656.0 / 1080)):
if auto.find_element("./assets/images/forgottenhall/team1.png", "image", 0.8, max_retries=10, crop=(610 / 1920, 670 / 1080, 118 / 1920, 218 / 1080)):
auto.take_screenshot(crop=(30 / 1920, 115 / 1080, 530 / 1920, 810 / 1080))
for character in config.forgottenhall_team1:
auto.click_element(f"./assets/images/character/{character[0]}.png", "image",
0.8, max_retries=10, scale_range=(0.8, 1.2), take_screenshot=False)
if auto.click_element("回忆", "text", max_retries=10, crop=(1546 / 1920, 962 / 1080, 343 / 1920, 62 / 1080), include=True):
ForgottenHall.click_message_box()
if ForgottenHall.start_fight(1, 1):
flag = True
logger.info(_("回忆一完成"))
return flag
except Exception as e:
logger.error(_("回忆一失败: {error}").format(error=e))
return False

0 comments on commit f632e25

Please sign in to comment.