mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-09 20:00:02 +08:00
Fix: Catch RequestHumanTakeover in benchmark
This commit is contained in:
parent
b40850200b
commit
f81d53cf68
@ -197,14 +197,10 @@ class Benchmark(DaemonBase, CampaignUI):
|
||||
return tuple(screenshot), tuple(click)
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.config.override(Emulator_ScreenshotMethod='ADB')
|
||||
self.device.uninstall_minicap()
|
||||
self.ui_goto_campaign()
|
||||
self.campaign_set_chapter('7-2')
|
||||
except RequestHumanTakeover:
|
||||
logger.critical('Request human takeover')
|
||||
return
|
||||
self.config.override(Emulator_ScreenshotMethod='ADB')
|
||||
self.device.uninstall_minicap()
|
||||
self.ui_goto_campaign()
|
||||
self.campaign_set_chapter('7-2')
|
||||
|
||||
logger.attr('DeviceType', self.config.Benchmark_DeviceType)
|
||||
logger.attr('TestScene', self.config.Benchmark_TestScene)
|
||||
@ -236,6 +232,10 @@ class Benchmark(DaemonBase, CampaignUI):
|
||||
return method
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
b = Benchmark('alas', task='Benchmark')
|
||||
b.run()
|
||||
def run_benchmark(config):
|
||||
try:
|
||||
Benchmark(config, task='Benchmark').run()
|
||||
return True
|
||||
except RequestHumanTakeover:
|
||||
logger.critical('Request human takeover')
|
||||
return False
|
||||
|
@ -162,9 +162,9 @@ class ProcessManager:
|
||||
|
||||
AzurLaneUncensored(config=config_name, task="AzurLaneUncensored").run()
|
||||
elif func == "Benchmark":
|
||||
from module.daemon.benchmark import Benchmark
|
||||
from module.daemon.benchmark import run_benchmark
|
||||
|
||||
Benchmark(config=config_name, task="Benchmark").run()
|
||||
run_benchmark(config=config_name)
|
||||
elif func == "GameManager":
|
||||
from module.daemon.game_manager import GameManager
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user