mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 13:49:26 +08:00
Fix: Trigger device stuck detection in semi auto
- Add disable_stuck_detection to disable that
This commit is contained in:
@@ -16,7 +16,6 @@ class Config:
|
||||
"""
|
||||
Paste the config of map file here
|
||||
"""
|
||||
ENABLE_GAME_STUCK_HANDLER = False
|
||||
pass
|
||||
|
||||
|
||||
@@ -50,6 +49,7 @@ if __name__ == '__main__':
|
||||
|
||||
cfg = AzurLaneConfig(CONFIG).merge(Config())
|
||||
al = ModuleBase(cfg)
|
||||
al.device.disable_stuck_detection()
|
||||
view = View(cfg)
|
||||
al.device.screenshot()
|
||||
view.load(al.device.image)
|
||||
|
||||
@@ -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