StarRailCopilot/src.py

87 lines
3.0 KiB
Python
Raw Permalink Normal View History

2023-06-17 17:07:14 +00:00
from module.alas import AzurLaneAutoScript
from module.logger import logger
class StarRailCopilot(AzurLaneAutoScript):
def restart(self):
from tasks.login.login import Login
Login(self.config, device=self.device).app_restart()
def start(self):
from tasks.login.login import Login
Login(self.config, device=self.device).app_start()
2024-01-14 18:34:26 +00:00
def stop(self):
from tasks.login.login import Login
Login(self.config, device=self.device).app_stop()
2023-06-17 17:07:14 +00:00
def goto_main(self):
from tasks.login.login import Login
from tasks.base.ui import UI
if self.device.app_is_running():
logger.info('App is already running, goto main page')
UI(self.config, device=self.device).ui_goto_main()
else:
logger.info('App is not running, start app and goto main page')
Login(self.config, device=self.device).app_start()
UI(self.config, device=self.device).ui_goto_main()
2024-11-07 04:32:53 +00:00
def error_postprocess(self):
# Exit cloud game to reduce extra fee
if self.config.is_cloud_game:
from tasks.login.login import Login
Login(self.config, device=self.device).app_stop()
2023-06-17 17:09:09 +00:00
def dungeon(self):
from tasks.dungeon.dungeon import Dungeon
Dungeon(config=self.config, device=self.device).run()
2023-09-26 19:14:12 +00:00
def weekly(self):
from tasks.dungeon.weekly import WeeklyDungeon
WeeklyDungeon(config=self.config, device=self.device).run()
2023-06-18 10:41:58 +00:00
def daily_quest(self):
from tasks.daily.daily_quest import DailyQuestUI
DailyQuestUI(config=self.config, device=self.device).run()
def battle_pass(self):
from tasks.battle_pass.battle_pass import BattlePassUI
BattlePassUI(config=self.config, device=self.device).run()
2023-06-19 17:28:41 +00:00
def assignment(self):
from tasks.assignment.assignment import Assignment
Assignment(config=self.config, device=self.device).run()
2023-09-24 08:46:39 +00:00
def data_update(self):
from tasks.item.data_update import DataUpdate
DataUpdate(config=self.config, device=self.device).run()
def freebies(self):
from tasks.freebies.freebies import Freebies
Freebies(config=self.config, device=self.device).run()
2023-06-17 17:07:14 +00:00
def rogue(self):
from tasks.rogue.rogue import Rogue
Rogue(config=self.config, device=self.device).run()
2024-07-01 18:41:12 +00:00
def ornament(self):
from tasks.ornament.ornament import Ornament
Ornament(config=self.config, device=self.device).run()
def benchmark(self):
from module.daemon.benchmark import run_benchmark
run_benchmark(config=self.config)
def daemon(self):
from tasks.base.daemon import Daemon
Daemon(config=self.config, device=self.device, task="Daemon").run()
def planner_scan(self):
from tasks.planner.scan import PlannerScan
PlannerScan(config=self.config, device=self.device, task="PlannerScan").run()
2023-06-17 17:07:14 +00:00
if __name__ == '__main__':
src = StarRailCopilot('src')
src.loop()