Fix: domain_exit_interact() was early stopped after handle_popup_confirm()

This commit is contained in:
LmeSzinc 2023-10-02 17:16:14 +08:00
parent 745d82ae9f
commit b0acd6aac8

View File

@ -1,3 +1,4 @@
from module.base.timer import Timer
from module.logger import logger from module.logger import logger
from tasks.base.page import page_rogue from tasks.base.page import page_rogue
from tasks.combat.interact import CombatInteract from tasks.combat.interact import CombatInteract
@ -15,6 +16,7 @@ class RogueExit(CombatInteract):
""" """
logger.info(f'Domain exit interact') logger.info(f'Domain exit interact')
clicked = False clicked = False
confirm = Timer(1.5, count=5)
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
skip_first_screenshot = False skip_first_screenshot = False
@ -29,6 +31,7 @@ class RogueExit(CombatInteract):
clicked = True clicked = True
continue continue
if self.handle_popup_confirm(): if self.handle_popup_confirm():
confirm.reset()
continue continue
logger.info(f'Interact loading') logger.info(f'Interact loading')
@ -41,8 +44,9 @@ class RogueExit(CombatInteract):
# End # End
if self.is_in_main(): if self.is_in_main():
logger.info('Entered another domain') if confirm.reached():
break logger.info('Entered another domain')
break
if self.ui_page_appear(page_rogue): if self.ui_page_appear(page_rogue):
logger.info('Rogue cleared') logger.info('Rogue cleared')
break break
@ -51,4 +55,5 @@ class RogueExit(CombatInteract):
self.device.click(BLESSING_CONFIRM) self.device.click(BLESSING_CONFIRM)
continue continue
if self.handle_popup_confirm(): if self.handle_popup_confirm():
confirm.reset()
continue continue