From cfd8c1d4f131c24d8a9dd2b21c2433260f146343 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 19 Oct 2023 00:21:00 +0800 Subject: [PATCH] Add: Add rogue task to scheduler and prefer occurrence --- config/template.json | 2 +- module/config/argument/args.json | 2 +- module/config/argument/argument.yaml | 2 +- module/config/config_generated.py | 2 +- module/config/config_manual.py | 1 + src.py | 5 +++++ tasks/rogue/rogue.py | 8 ++++++-- tasks/rogue/route/base.py | 2 +- 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/config/template.json b/config/template.json index 9d45a5cbc..f3555c1b4 100644 --- a/config/template.json +++ b/config/template.json @@ -177,7 +177,7 @@ "World": "Simulated_Universe_World_7", "Path": "The_Hunt", "Bonus": "Blessing Cosmos", - "DomainStrategy": "combat", + "DomainStrategy": "occurrence", "ImmersionReward": "immersifier", "StopCondition": "weekly_point_reward" }, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index af95ad18d..d5606991c 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1205,7 +1205,7 @@ }, "DomainStrategy": { "type": "select", - "value": "combat", + "value": "occurrence", "option": [ "combat", "occurrence" diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 1063df056..818fe0204 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -214,7 +214,7 @@ RogueWorld: value: Blessing Cosmos option: [ Blessing Cosmos, Miracle Cosmos, Fragmented Cosmos ] DomainStrategy: - value: combat + value: occurrence option: [ combat, occurrence ] ImmersionReward: value: immersifier diff --git a/module/config/config_generated.py b/module/config/config_generated.py index e51128211..da728f6bb 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -120,7 +120,7 @@ class GeneratedConfig: RogueWorld_World = 'Simulated_Universe_World_7' # Simulated_Universe_World_3, Simulated_Universe_World_4, Simulated_Universe_World_5, Simulated_Universe_World_6, Simulated_Universe_World_7 RogueWorld_Path = 'The_Hunt' # Preservation, Remembrance, Nihility, Abundance, The_Hunt, Destruction, Elation RogueWorld_Bonus = 'Blessing Cosmos' # Blessing Cosmos, Miracle Cosmos, Fragmented Cosmos - RogueWorld_DomainStrategy = 'combat' # combat, occurrence + RogueWorld_DomainStrategy = 'occurrence' # combat, occurrence RogueWorld_ImmersionReward = 'immersifier' # do_not_claim, immersifier, immersifier_trailblaze_power RogueWorld_StopCondition = 'weekly_point_reward' # weekly_point_reward, 100_elite_boss, non_stop diff --git a/module/config/config_manual.py b/module/config/config_manual.py index 7f8c9904f..36b6d7d13 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -13,6 +13,7 @@ class ManualConfig: > BattlePass > DailyQuest > Assignment > Freebies > DataUpdate > Weekly > Dungeon + > Rogue """ """ diff --git a/src.py b/src.py index c706eb32c..5cb317b84 100644 --- a/src.py +++ b/src.py @@ -50,6 +50,11 @@ class StarRailCopilot(AzurLaneAutoScript): from tasks.freebies.freebies import Freebies Freebies(config=self.config, device=self.device).run() + def rogue(self): + from tasks.rogue.rogue import Rogue + Rogue(config=self.config, device=self.device).run() + + if __name__ == '__main__': src = StarRailCopilot('src') src.loop() diff --git a/tasks/rogue/rogue.py b/tasks/rogue/rogue.py index 0ab598058..e6d6c973a 100644 --- a/tasks/rogue/rogue.py +++ b/tasks/rogue/rogue.py @@ -4,7 +4,7 @@ from tasks.rogue.exception import RogueTeamNotPrepared from tasks.rogue.route.loader import RouteLoader -class RogueHandler(RouteLoader, RogueEntry): +class Rogue(RouteLoader, RogueEntry): def rogue_once(self): """ Do a complete rogue run. @@ -24,8 +24,12 @@ class RogueHandler(RouteLoader, RogueEntry): self.rogue_reward_claim() return True + def run(self): + self.rogue_once() + self.config.task_delay(server_update=True) + if __name__ == '__main__': - self = RogueHandler('src', task='Rogue') + self = Rogue('src', task='Rogue') self.device.screenshot() self.rogue_once() diff --git a/tasks/rogue/route/base.py b/tasks/rogue/route/base.py index e144403e5..1b29d0821 100644 --- a/tasks/rogue/route/base.py +++ b/tasks/rogue/route/base.py @@ -273,7 +273,7 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent): self.rotation_set(end_rotation, threshold=10) logger.hr('Find domain exit', level=2) - direction = self.predict_door(self.device.image) + direction = self.predict_door() direction_limit = 55 if direction is not None: if abs(direction) > direction_limit: