1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-18 01:01:29 +08:00

Fix: Catch exception in the first screenshot

This commit is contained in:
LmeSzinc
2022-02-24 18:11:36 +08:00
parent ea34121410
commit cfc95091ed

View File

@@ -52,6 +52,7 @@ class AzurLaneAutoScript:
def run(self, command): def run(self, command):
try: try:
self.device.screenshot()
self.__getattribute__(command)() self.__getattribute__(command)()
return True return True
except TaskEnd: except TaskEnd:
@@ -389,7 +390,6 @@ class AzurLaneAutoScript:
logger.info(f'Scheduler: Start task `{task}`') logger.info(f'Scheduler: Start task `{task}`')
self.device.stuck_record_clear() self.device.stuck_record_clear()
self.device.click_record_clear() self.device.click_record_clear()
self.device.screenshot()
logger.hr(task, level=0) logger.hr(task, level=0)
success = self.run(inflection.underscore(task)) success = self.run(inflection.underscore(task))
logger.info(f'Scheduler: End task `{task}`') logger.info(f'Scheduler: End task `{task}`')