Dev: Add Rogue image tracking

This commit is contained in:
LmeSzinc 2023-12-09 21:39:37 +08:00
parent d5ab439de2
commit 304c122d80
4 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import threading
from datetime import timedelta
from module.base.base import ModuleBase
from module.base.timer import Timer
from module.base.utils import crop
from module.config.stored.classes import now
@ -125,8 +125,7 @@ class DungeonState(UI):
self.dungeon_get_simuni_point(image)
self.dungeon_update_stamina(image)
thread = threading.Thread(target=func, args=(self.device.image,))
thread.start()
ModuleBase.worker.submit(func, self.device.image)
def dungeon_stamina_delay(self, dungeon: DungeonList):
"""

View File

@ -338,6 +338,7 @@ class MapControl(Combat, AimDetectorMixin):
list[str]: A list of walk result
"""
logger.hr('Goto', level=1)
self.screenshot_tracking_add()
self.map_A_timer.clear()
self.map_E_timer.clear()
self.map_run_2x_timer.clear()

View File

@ -65,6 +65,7 @@ class RouteLoader(UI):
self.route_obj.route_module = module
self.route_obj.plane = self.plane
self.device.screenshot_tracking.clear()
# before_route()
try:
@ -102,3 +103,5 @@ class RouteLoader(UI):
except (GameStuckError, GameTooManyClickError):
logger.error(f'Route failed: {route}')
raise
self.device.screenshot_tracking.clear()

View File

@ -237,6 +237,7 @@ class RouteLoader(RogueUI, MinimapWrapper, RouteLoader_, CharacterSwitch):
"""
# To have a newer image, since previous loadings took some time
route = self.position_find(skip_first_screenshot=False)
self.screenshot_tracking_add()
super().route_run(route)
def rogue_run(self, skip_first_screenshot=True):