mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Add: Handle rogue reward
This commit is contained in:
parent
da314d31d5
commit
fdcd2feb47
BIN
assets/share/rogue/reward/ROGUE_REPORT.png
Normal file
BIN
assets/share/rogue/reward/ROGUE_REPORT.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
15
tasks/rogue/assets/assets_rogue_reward.py
Normal file
15
tasks/rogue/assets/assets_rogue_reward.py
Normal 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
52
tasks/rogue/route/exit.py
Normal 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
|
Loading…
Reference in New Issue
Block a user