1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-07-13 10:58:02 +08:00

Feat: add module smart_mgmt

This commit is contained in:
positnuec
2026-07-10 07:25:18 +08:00
parent f92ee9907d
commit 9cc7aa804b
16 changed files with 727 additions and 6 deletions

20
alas.py
View File

@@ -15,6 +15,7 @@ from module.logger import logger
from module.notify import handle_notify
RESTART_SENSITIVE_TASKS = ['OpsiObscure', 'OpsiAbyssal', 'OpsiCrossMonth']
DEVICE_FREE_TASKS = 'DowntimeFetch'
class AzurLaneAutoScript:
@@ -198,6 +199,10 @@ class AzurLaneAutoScript:
LoginHandler(self.config, device=self.device).app_start()
UI(self.config, device=self.device).ui_goto_main()
def downtime_fetch(self):
from module.smart_mgmt.downtime_fetch import DowntimeFetch
DowntimeFetch(config=self.config).run()
def research(self):
from module.research.research import RewardResearch
RewardResearch(config=self.config, device=self.device).run()
@@ -570,9 +575,8 @@ class AzurLaneAutoScript:
self.config.task_call('Restart')
# Get task
task = self.get_next_task()
# Init device and change server
_ = self.device
self.device.config = self.config
# Network-only tasks skip device init and screenshot
device_free_task = task == DEVICE_FREE_TASKS
# Skip first restart
if task == 'Restart' and self.is_first_task:
logger.info('Skip task `Restart` at scheduler start')
@@ -582,10 +586,14 @@ class AzurLaneAutoScript:
# Run
logger.info(f'Scheduler: Start task `{task}`')
self.device.stuck_record_clear()
self.device.click_record_clear()
# Init device and change server
if not device_free_task:
_ = self.device
self.device.config = self.config
self.device.stuck_record_clear()
self.device.click_record_clear()
logger.hr(task, level=0)
success = self.run(inflection.underscore(task))
success = self.run(inflection.underscore(task), skip_first_screenshot=device_free_task)
logger.info(f'Scheduler: End task `{task}`')
self.is_first_task = False