Add: Handle rogue reward

This commit is contained in:
LmeSzinc 2023-10-01 16:24:00 +08:00
parent da314d31d5
commit fdcd2feb47
3 changed files with 67 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,15 @@
from module.base.button import Button, ButtonWrapper
# This file was auto-generated, do not modify it manually. To generate:
# ``` python -m dev_tools.button_extract ```
ROGUE_REPORT = ButtonWrapper(
name='ROGUE_REPORT',
share=Button(
file='./assets/share/rogue/reward/ROGUE_REPORT.png',
area=(1198, 19, 1223, 42),
search=(1178, 0, 1243, 62),
color=(203, 165, 119),
button=(382, 645, 894, 700),
),
)

52
tasks/rogue/route/exit.py Normal file
View File

@ -0,0 +1,52 @@
from module.logger import logger
from tasks.base.page import page_rogue
from tasks.combat.interact import CombatInteract
from tasks.rogue.assets.assets_rogue_reward import ROGUE_REPORT
from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM
class RogueExit(CombatInteract):
def domain_exit_interact(self, skip_first_screenshot=True):
"""
Pages:
in: page_main, DUNGEON_COMBAT_INTERACT
out: page_main
or page_rogue if rogue cleared
"""
logger.info(f'Domain exit interact')
clicked = False
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
# End
if clicked and not self.is_in_main():
break
if self.handle_combat_interact():
clicked = True
continue
if self.handle_popup_confirm():
continue
logger.info(f'Interact loading')
skip_first_screenshot = True
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
# End
if self.is_in_main():
logger.info('Entered another domain')
break
if self.ui_page_appear(page_rogue):
logger.info('Rogue cleared')
break
if self.appear(ROGUE_REPORT, interval=2):
self.device.click(BLESSING_CONFIRM)
continue