mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-02 08:24:07 +08:00
Opt: Now ALAS can start the app from other functions too
This commit is contained in:
98
alas.py
98
alas.py
@@ -100,7 +100,14 @@ class AzurLaneAutoScript:
|
|||||||
|
|
||||||
logger.hr('Reward Settings saved')
|
logger.hr('Reward Settings saved')
|
||||||
self.update_check()
|
self.update_check()
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
|
self.reward_when_finished()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def emulator(self):
|
def emulator(self):
|
||||||
for key, value in self.config.config['Emulator'].items():
|
for key, value in self.config.config['Emulator'].items():
|
||||||
@@ -124,6 +131,14 @@ class AzurLaneAutoScript:
|
|||||||
"""
|
"""
|
||||||
Method to run main chapter.
|
Method to run main chapter.
|
||||||
"""
|
"""
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run(self.config.CAMPAIGN_NAME)
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run(self.config.CAMPAIGN_NAME)
|
az.run(self.config.CAMPAIGN_NAME)
|
||||||
@@ -133,25 +148,50 @@ class AzurLaneAutoScript:
|
|||||||
"""
|
"""
|
||||||
Method to run daily missions.
|
Method to run daily missions.
|
||||||
"""
|
"""
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
from module.reward.reward import Reward
|
from module.reward.reward import Reward
|
||||||
az = Reward(self.config, device=self.device)
|
az = Reward(self.config, device=self.device)
|
||||||
az.daily_wrapper_run()
|
az.daily_wrapper_run()
|
||||||
|
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
|
from module.reward.reward import Reward
|
||||||
|
az = Reward(self.config, device=self.device)
|
||||||
|
az.daily_wrapper_run()
|
||||||
|
self.reward_when_finished()
|
||||||
|
|
||||||
|
|
||||||
def event(self):
|
def event(self):
|
||||||
"""
|
"""
|
||||||
Method to run event.
|
Method to run event.
|
||||||
"""
|
"""
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run(self.config.EVENT_STAGE, folder=self.config.EVENT_NAME)
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run(self.config.EVENT_STAGE, folder=self.config.EVENT_NAME)
|
az.run(self.config.EVENT_STAGE, folder=self.config.EVENT_NAME)
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
|
|
||||||
def sos(self):
|
def sos(self):
|
||||||
"""
|
"""
|
||||||
Method to SOS maps.
|
Method to SOS maps.
|
||||||
"""
|
"""
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.sos.sos import CampaignSos
|
||||||
|
az = CampaignSos(self.config, device=self.device)
|
||||||
|
az.run()
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.sos.sos import CampaignSos
|
from module.sos.sos import CampaignSos
|
||||||
az = CampaignSos(self.config, device=self.device)
|
az = CampaignSos(self.config, device=self.device)
|
||||||
az.run()
|
az.run()
|
||||||
@@ -161,18 +201,42 @@ class AzurLaneAutoScript:
|
|||||||
"""
|
"""
|
||||||
Method to War Archives maps.
|
Method to War Archives maps.
|
||||||
"""
|
"""
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.war_archives.war_archives import CampaignWarArchives
|
||||||
|
az = CampaignWarArchives(self.config, device=self.device)
|
||||||
|
az.run(self.config.WAR_ARCHIVES_STAGE, folder=self.config.WAR_ARCHIVES_NAME)
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.war_archives.war_archives import CampaignWarArchives
|
from module.war_archives.war_archives import CampaignWarArchives
|
||||||
az = CampaignWarArchives(self.config, device=self.device)
|
az = CampaignWarArchives(self.config, device=self.device)
|
||||||
az.run(self.config.WAR_ARCHIVES_STAGE, folder=self.config.WAR_ARCHIVES_NAME)
|
az.run(self.config.WAR_ARCHIVES_STAGE, folder=self.config.WAR_ARCHIVES_NAME)
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
def raid(self):
|
def raid(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.raid.run import RaidRun
|
||||||
|
az = RaidRun(self.config, device=self.device)
|
||||||
|
az.run()
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.raid.run import RaidRun
|
from module.raid.run import RaidRun
|
||||||
az = RaidRun(self.config, device=self.device)
|
az = RaidRun(self.config, device=self.device)
|
||||||
az.run()
|
az.run()
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
def event_daily_ab(self):
|
def event_daily_ab(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.event.campaign_ab import CampaignAB
|
||||||
|
az = CampaignAB(self.config, device=self.device)
|
||||||
|
az.run_event_daily()
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.event.campaign_ab import CampaignAB
|
from module.event.campaign_ab import CampaignAB
|
||||||
az = CampaignAB(self.config, device=self.device)
|
az = CampaignAB(self.config, device=self.device)
|
||||||
az.run_event_daily()
|
az.run_event_daily()
|
||||||
@@ -184,24 +248,56 @@ class AzurLaneAutoScript:
|
|||||||
az.daemon()
|
az.daemon()
|
||||||
|
|
||||||
def c11_affinity_farming(self):
|
def c11_affinity_farming(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run('campaign_1_1_affinity_farming')
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run('campaign_1_1_affinity_farming')
|
az.run('campaign_1_1_affinity_farming')
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
def c72_mystery_farming(self):
|
def c72_mystery_farming(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run('campaign_7_2_mystery_farming')
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run('campaign_7_2_mystery_farming')
|
az.run('campaign_7_2_mystery_farming')
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
def c124_leveling(self):
|
def c124_leveling(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run('campaign_12_4_leveling')
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run('campaign_12_4_leveling')
|
az.run('campaign_12_4_leveling')
|
||||||
self.reward_when_finished()
|
self.reward_when_finished()
|
||||||
|
|
||||||
def c122_leveling(self):
|
def c122_leveling(self):
|
||||||
|
from module.handler.login import LoginHandler
|
||||||
|
az = LoginHandler(self.config, device=self.device)
|
||||||
|
if az.app_ensure_start():
|
||||||
|
from module.campaign.run import CampaignRun
|
||||||
|
az = CampaignRun(self.config, device=self.device)
|
||||||
|
az.run('campaign_12_2_leveling')
|
||||||
|
self.reward_when_finished()
|
||||||
|
else:
|
||||||
from module.campaign.run import CampaignRun
|
from module.campaign.run import CampaignRun
|
||||||
az = CampaignRun(self.config, device=self.device)
|
az = CampaignRun(self.config, device=self.device)
|
||||||
az.run('campaign_12_2_leveling')
|
az.run('campaign_12_2_leveling')
|
||||||
|
|||||||
Reference in New Issue
Block a user