1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-15 05:17:24 +08:00
Files
AzurLaneAutoScript/module/event/campaign_ab.py

32 lines
1.2 KiB
Python
Raw Normal View History

import os
2020-03-29 01:22:46 +08:00
from module.campaign.run import CampaignRun
from module.logger import logger
2020-03-29 01:22:46 +08:00
RECORD_SINCE = (0,)
CAMPAIGN_NAME = ['a1', 'a2', 'a3', 'b1', 'b2', 'b3']
# CAMPAIGN_ALL = ['a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'c1', 'c2', 'c3', 'd1', 'd2', 'd3'] # Trying implement all event maps
2020-03-29 01:22:46 +08:00
class CampaignAB(CampaignRun):
def run(self, name, folder='campaign_main', total=0):
2020-03-29 01:22:46 +08:00
name = name.lower()
option = ('EventABRecord', name)
if not self.config.record_executed_since(option=option, since=RECORD_SINCE):
super().run(name=name, folder=folder, total=1)
2020-03-29 01:22:46 +08:00
self.config.record_save(option=option)
def run_event_daily(self):
existing = [file[:-3] for file in os.listdir(f'./campaign/{self.config.EVENT_NAME_AB}') if file[-3:] == '.py']
for name in existing:
if name.lower().startswith('sp'):
logger.warning(f'{self.config.EVENT_NAME_AB} seems to be a SP event, skip daily_ab')
logger.warning(f'Existing map files: {existing}')
return False
2020-03-29 01:22:46 +08:00
for name in CAMPAIGN_NAME:
if name not in existing:
continue
2020-03-29 01:22:46 +08:00
self.run(name=name, folder=self.config.EVENT_NAME_AB)