mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-17 18:05:25 +08:00
Fix: Catch exception in the first screenshot
This commit is contained in:
2
alas.py
2
alas.py
@@ -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}`')
|
||||||
|
|||||||
Reference in New Issue
Block a user