1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 19:55:12 +00:00

fix: exit emulator, aas, shutdown

allow tactical challenge to be completed
This commit is contained in:
RedDeadDepresso 2024-01-06 19:29:47 +00:00
parent 47f87741fd
commit 8a6851d24c
2 changed files with 32 additions and 13 deletions

View File

@ -233,21 +233,40 @@ class AzurLaneAutoScript:
del_cached_property(self, 'config')
continue
elif method == 'exit_aas':
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_aas()
exit(1)
if abs(task.next_run - datetime.now()) >= timedelta(minutes=2): # ensure tactical challenge is fully ran
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_aas()
exit(1)
release_resources()
self.device.release_during_wait()
if not self.wait_until(task.next_run):
del_cached_property(self, 'config')
continue
elif method == 'exit_emulator':
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_emulator()
exit(1) # stops AAS from restarting emulator
if abs(task.next_run - datetime.now()) >= timedelta(minutes=2):
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_emulator()
exit(1) # stops AAS from restarting emulator
release_resources()
self.device.release_during_wait()
if not self.wait_until(task.next_run):
del_cached_property(self, 'config')
continue
elif method == 'exit_aas_emulator':
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_emulator()
self.exit_aas()
exit(1)
if abs(task.next_run - datetime.now()) >= timedelta(minutes=2):
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.exit_emulator()
self.exit_aas()
exit(1)
release_resources()
self.device.release_during_wait()
if not self.wait_until(task.next_run):
del_cached_property(self, 'config')
continue
elif method == 'shutdown':
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.shutdown()
if abs(task.next_run - datetime.now()) >= timedelta(minutes=2):
self.config.Optimization_WhenTaskQueueEmpty = 'goto_main'
self.shutdown()
release_resources()
self.device.release_during_wait()
if not self.wait_until(task.next_run):

View File

@ -221,7 +221,7 @@
},
"WhenTaskQueueEmpty": {
"name": "When Task Queue is Empty",
"help": "Close Blue Archive when there are no pending tasks, can help reduce CPU.\nExit AAS, emulator and shutdown should be set while AAS is running tasks otherwise it won't start and after their execution it will be reset to Goto Main Page.\nExit AAS and emulator are only available on Windows.\nExit emulator is only possible if instance name and emulator path follow the same auto-filled values according to 'Serial' in Emulator Settings",
"help": "Close Blue Archive when there are no pending tasks, can help reduce CPU.\nExit AAS, emulator and shutdown should be set while AAS is running tasks otherwise it won't start; after their execution it will be reset to Goto Main Page.\nExit AAS and emulator are only available on Windows.\n\nExit emulator is only possible if instance name and emulator path actually follow the same auto-filled values according to 'Serial' in Emulator Settings.\nFor example, for Bluestacks 5 the instance name and Bluestacks 5 installation path must be respectively:\nNougat64\nC:/Program Files/BlueStacks_nxt/HD-Player.exe",
"stay_there": "Stay There",
"goto_main": "Goto Main Page",
"close_game": "Close Game",