AzurLaneAutoScript/module/guild/guild_reward.py

44 lines
1.2 KiB
Python
Raw Permalink Normal View History

from module.guild.lobby import GuildLobby
from module.guild.logistics import GuildLogistics
from module.guild.operations import GuildOperations
from module.ui.page import page_guild, page_main
class RewardGuild(GuildLobby, GuildLogistics, GuildOperations):
def run(self):
"""
ALAS handler function for guild reward loop
Returns:
bool: If executed
Pages:
in: page_main
out: page_main
"""
2021-09-25 23:29:10 +08:00
if not self.config.GuildLogistics_Enable and not self.config.GuildOperation_Enable:
self.config.Scheduler_Enable = False
self.config.task_stop()
self.ui_ensure(page_guild)
success = True
# Lobby
self.guild_lobby()
# Logistics
2021-09-25 23:29:10 +08:00
if self.config.GuildLogistics_Enable:
success &= self.guild_logistics()
# Operation
2021-09-25 23:29:10 +08:00
if self.config.GuildOperation_Enable:
success &= self.guild_operations()
self.ui_goto(page_main)
# Scheduler
if success:
self.config.task_delay(server_update=True)
else:
self.config.task_delay(success=False, server_update=True)