Skip to content

Commit

Permalink
Add: Task dungeon
Browse files Browse the repository at this point in the history
  • Loading branch information
LmeSzinc committed Jun 17, 2023
1 parent 1f8a938 commit 7e30ba8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions module/config/config_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def SERVER(self):

SCHEDULER_PRIORITY = """
Restart
> Dungeon
"""

"""
Expand Down
4 changes: 4 additions & 0 deletions src.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def goto_main(self):
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')
Expand Down
26 changes: 26 additions & 0 deletions tasks/dungeon/dungeon.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 7e30ba8

Please sign in to comment.