mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:27:33 +08:00
Opt: Improves event filter and stage load
This commit is contained in:
parent
1a16e31138
commit
6c1e3d3aba
8
alas.py
8
alas.py
@ -227,19 +227,19 @@ class AzurLaneAutoScript:
|
||||
|
||||
def event_a(self):
|
||||
from module.event.campaign_abcd import CampaignABCD
|
||||
CampaignABCD(config=self.config, device=self.device).run(DailyEventABCD=self.config.EventA_StageFilter, LastStageABCD=self.config.EventA_LastStage)
|
||||
CampaignABCD(config=self.config, device=self.device).run()
|
||||
|
||||
def event_b(self):
|
||||
from module.event.campaign_abcd import CampaignABCD
|
||||
CampaignABCD(config=self.config, device=self.device).run(DailyEventABCD=self.config.EventB_StageFilter, LastStageABCD=self.config.EventB_LastStage)
|
||||
CampaignABCD(config=self.config, device=self.device).run()
|
||||
|
||||
def event_c(self):
|
||||
from module.event.campaign_abcd import CampaignABCD
|
||||
CampaignABCD(config=self.config, device=self.device).run(DailyEventABCD=self.config.EventC_StageFilter, LastStageABCD=self.config.EventC_LastStage)
|
||||
CampaignABCD(config=self.config, device=self.device).run()
|
||||
|
||||
def event_d(self):
|
||||
from module.event.campaign_abcd import CampaignABCD
|
||||
CampaignABCD(config=self.config, device=self.device).run(DailyEventABCD=self.config.EventD_StageFilter, LastStageABCD=self.config.EventD_LastStage)
|
||||
CampaignABCD(config=self.config, device=self.device).run()
|
||||
|
||||
def event_sp(self):
|
||||
from module.event.campaign_sp import CampaignSP
|
||||
|
@ -12,8 +12,8 @@ class CampaignABCD(EventBase):
|
||||
stages = [EventStage(file) for file in os.listdir(f'./campaign/{self.config.Campaign_Event}')]
|
||||
stages = self.convert_stages(stages)
|
||||
logger.attr('Stage', [str(stage) for stage in stages])
|
||||
logger.attr('StageFilter', kwargs.get("DailyEventABCD"))
|
||||
STAGE_FILTER.load(kwargs.get("DailyEventABCD"))
|
||||
logger.attr('StageFilter', self.config.EventDaily_StageFilter)
|
||||
STAGE_FILTER.load(self.config.EventDaily_StageFilter)
|
||||
self.convert_stages(STAGE_FILTER)
|
||||
stages = [str(stage) for stage in STAGE_FILTER.apply(stages)]
|
||||
logger.attr('Filter sort', ' > '.join(stages))
|
||||
@ -24,12 +24,12 @@ class CampaignABCD(EventBase):
|
||||
self.config.task_stop()
|
||||
|
||||
# Start from last stage
|
||||
logger.info(f'LastStage {kwargs["last_stage"]}, recorded at {self.config.Scheduler_NextRun}')
|
||||
logger.info(f'LastStage {self.config.EventDaily_LastStage}, recorded at {self.config.Scheduler_NextRun}')
|
||||
if get_server_last_update(self.config.Scheduler_ServerUpdate) >= self.config.Scheduler_NextRun:
|
||||
logger.info('LastStage outdated, reset')
|
||||
kwargs["last_stage"] = 0
|
||||
self.config.EventDaily_LastStage = 0
|
||||
else:
|
||||
last = str(kwargs["last_stage"]).lower()
|
||||
last = str(self.config.EventDaily_LastStage).lower()
|
||||
last = self.convert_stages(last)
|
||||
if last in stages:
|
||||
stages = stages[stages.index(last) + 1:]
|
||||
@ -47,7 +47,7 @@ class CampaignABCD(EventBase):
|
||||
pass
|
||||
if self.run_count > 0:
|
||||
with self.config.multi_set():
|
||||
kwargs["last_stage"] = stage
|
||||
self.config.EventDaily_LastStage = stage
|
||||
self.config.task_delay(minute=0)
|
||||
else:
|
||||
self.config.task_stop()
|
||||
|
Loading…
Reference in New Issue
Block a user