mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Add: Task dungeon
This commit is contained in:
parent
1f8a9383f7
commit
7e30ba8d9f
@ -10,6 +10,7 @@ class ManualConfig:
|
||||
|
||||
SCHEDULER_PRIORITY = """
|
||||
Restart
|
||||
> Dungeon
|
||||
"""
|
||||
|
||||
"""
|
||||
|
4
src.py
4
src.py
@ -22,6 +22,10 @@ class StarRailCopilot(AzurLaneAutoScript):
|
||||
Login(self.config, device=self.device).app_start()
|
||||
UI(self.config, device=self.device).ui_goto_main()
|
||||
|
||||
def dungeon(self):
|
||||
from tasks.dungeon.dungeon import Dungeon
|
||||
Dungeon(config=self.config, device=self.device).run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
src = StarRailCopilot('src')
|
||||
|
26
tasks/dungeon/dungeon.py
Normal file
26
tasks/dungeon/dungeon.py
Normal file
@ -0,0 +1,26 @@
|
||||
from module.logger import logger
|
||||
from tasks.combat.combat import Combat
|
||||
from tasks.dungeon.keywords import DungeonList
|
||||
from tasks.dungeon.ui import DungeonUI
|
||||
|
||||
|
||||
class Dungeon(DungeonUI, Combat):
|
||||
def run(self, dungeon: DungeonList = None, team: int = None):
|
||||
if dungeon is None:
|
||||
dungeon = DungeonList.find(self.config.Dungeon_Name)
|
||||
if team is None:
|
||||
team = self.config.Dungeon_Team
|
||||
|
||||
# Run
|
||||
if not self.dungeon_goto(dungeon):
|
||||
logger.error('Please check you dungeon settings')
|
||||
self.config.Scheduler_Enable = False
|
||||
self.config.task_stop()
|
||||
|
||||
self.combat(team)
|
||||
|
||||
# Scheduler
|
||||
# Recover 1 trailbaze power each 6 minutes
|
||||
cover = max(60 - self.state.TrailblazePower, 0) * 6
|
||||
logger.info(f'Currently has {self.state.TrailblazePower} Need {cover} minutes to reach 60')
|
||||
self.config.task_delay(minute=cover)
|
Loading…
Reference in New Issue
Block a user