Pref: Lower screenshot speed during teleportation

This commit is contained in:
LmeSzinc 2024-07-06 01:03:43 +08:00
parent 7389788278
commit 81a26d5e78
2 changed files with 13 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import numpy as np
from module.base.base import ModuleBase
from module.base.button import ClickButton
from module.base.decorator import run_once
from module.base.timer import Timer
from module.base.utils import get_color
from module.exception import ScriptError
@ -614,7 +615,12 @@ class DungeonUI(DungeonState):
"""
logger.hr('Dungeon enter', level=2)
DUNGEON_LIST.use_plane = bool(dungeon.is_Calyx_Crimson)
skip_first_load = True
skip_first_load = skip_first_screenshot
@run_once
def screenshot_interval_set():
self.device.screenshot_interval_set('combat')
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
@ -624,11 +630,13 @@ class DungeonUI(DungeonState):
# End
if self.appear(enter_check_button):
logger.info(f'Arrive {enter_check_button.name}')
self.device.screenshot_interval_set()
break
# Additional
# Popup that confirm character switch
if self.handle_popup_confirm():
self.interval_reset(page_guide.check_button)
continue
# Click teleport
@ -640,6 +648,7 @@ class DungeonUI(DungeonState):
entrance = DUNGEON_LIST.keyword2button(dungeon)
if entrance is not None:
self.device.click(entrance)
screenshot_interval_set()
self.interval_reset(page_guide.check_button)
continue
else:

View File

@ -261,6 +261,7 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward):
or page_rogue if rogue cleared
"""
logger.info('Wait next domain')
self.device.screenshot_interval_set('combat')
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
@ -270,10 +271,12 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward):
# End
if self.is_in_main():
logger.info('Entered another domain')
self.device.screenshot_interval_set()
self.wait_until_minimap_stabled()
break
if self.is_page_rogue_main():
logger.info('Rogue cleared')
self.device.screenshot_interval_set()
break
if self.match_template_color(ROGUE_REPORT, interval=2):