mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-15 12:17:20 +08:00
Fix: Trigger device stuck detection in semi auto
- Add disable_stuck_detection to disable that
This commit is contained in:
@@ -6,8 +6,7 @@ from module.handler.ambush import MAP_AMBUSH_EVADE
|
||||
|
||||
class AzurLaneDaemon(CampaignBase):
|
||||
def daemon(self):
|
||||
self.config.ENABLE_GAME_STUCK_HANDLER = False
|
||||
self.device.config.ENABLE_GAME_STUCK_HANDLER = False
|
||||
self.device.disable_stuck_detection()
|
||||
|
||||
while 1:
|
||||
self.device.screenshot()
|
||||
|
||||
@@ -8,8 +8,7 @@ from module.os_handler.map_event import MapEventHandler
|
||||
|
||||
class AzurLaneDaemon(Combat, MapEventHandler):
|
||||
def daemon(self):
|
||||
self.config.ENABLE_GAME_STUCK_HANDLER = False
|
||||
self.device.config.ENABLE_GAME_STUCK_HANDLER = False
|
||||
self.device.disable_stuck_detection()
|
||||
|
||||
while 1:
|
||||
self.device.screenshot()
|
||||
|
||||
@@ -110,6 +110,16 @@ class Device(Screenshot, Control, AppControl):
|
||||
if self.config.ENABLE_GAME_STUCK_HANDLER:
|
||||
raise GameStuckError(f'Wait too long')
|
||||
|
||||
def disable_stuck_detection(self):
|
||||
"""
|
||||
Disable stuck detection and its handler. Usually uses in semi auto and debugging.
|
||||
"""
|
||||
def empty_function(*arg, **kwargs):
|
||||
return False
|
||||
|
||||
self.click_record_check = empty_function
|
||||
self.stuck_record_check = empty_function
|
||||
|
||||
def app_start(self):
|
||||
super().app_start()
|
||||
self.stuck_record_clear()
|
||||
|
||||
Reference in New Issue
Block a user