From b2015a6909a5d943754fdea58f8d0b7aa8baddbe Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 27 May 2024 22:03:49 +0800 Subject: [PATCH 1/4] Fix: Handle character switch popup during rogue tp --- tasks/rogue/entry/entry.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tasks/rogue/entry/entry.py b/tasks/rogue/entry/entry.py index acba8caf1..12856df89 100644 --- a/tasks/rogue/entry/entry.py +++ b/tasks/rogue/entry/entry.py @@ -323,8 +323,13 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI): if self.ui_page_appear(page_rogue): break + # Additional if self.appear_then_click(REWARD_CLOSE, interval=2): continue + # Popup that confirm character switch + if self.handle_popup_confirm(): + continue + # Click if self.appear(page_guide.check_button, interval=2): buttons = TELEPORT.match_multi_template(self.device.image) if len(buttons): @@ -355,11 +360,11 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI): if self.config.RogueDebug_DebugMode: # Always run return - + if self.config.stored.SimulatedUniverseFarm.is_expired(): # Expired, reset farming counter self.config.stored.SimulatedUniverseFarm.set(0) - + if self.config.stored.SimulatedUniverse.is_expired(): # Expired, do rogue pass From 4f1da32256c97aa8deebe8e3e769cde50f242240 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 27 May 2024 23:17:15 +0800 Subject: [PATCH 2/4] Fix: Handle random ocr error on data update --- tasks/item/data_update.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/item/data_update.py b/tasks/item/data_update.py index bd87efdb6..635ea96ea 100644 --- a/tasks/item/data_update.py +++ b/tasks/item/data_update.py @@ -8,13 +8,20 @@ from tasks.base.ui import UI from tasks.item.assets.assets_item_data import OCR_DATA +class DataDigit(Digit): + def after_process(self, result): + result = re.sub(r'[l|]', '1', result) + result = re.sub(r'[oO]', '0', result) + return super().after_process(result) + + class DataUpdate(UI): def _get_data(self): """ Page: in: page_item """ - ocr = Digit(OCR_DATA) + ocr = DataDigit(OCR_DATA) timeout = Timer(2, count=6).start() credit, jade = 0, 0 From 1b1b72c208909b07214e6ea7823303568f6459e3 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 27 May 2024 23:32:11 +0800 Subject: [PATCH 3/4] Fix: Allow a total of 6 double calyx --- tasks/dungeon/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/dungeon/event.py b/tasks/dungeon/event.py index 291baec5e..3b1101f9c 100644 --- a/tasks/dungeon/event.py +++ b/tasks/dungeon/event.py @@ -83,7 +83,10 @@ class DungeonEvent(UI): def _get_double_event_remain(self, button) -> int: ocr = DoubleEventOcr(button) remain, _, total = ocr.ocr_single_line(self.device.image) - if total not in [3, 12]: + # 3 is double relic + # 12 is double calyx + # 6 is double calyx on beginner account + if total not in [3, 6, 12]: logger.warning(f'Invalid double event remain') remain = 0 return remain From 66c41648be67e66bda79ce3b01df9dc2d291d923 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 27 May 2024 23:42:30 +0800 Subject: [PATCH 4/4] Fix: Default dungeon wasn't converted to 2.0 --- config/template.json | 4 ++-- module/config/argument/args.json | 4 ++-- module/config/argument/argument.yaml | 4 ++-- module/config/config_generated.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/template.json b/config/template.json index 9d666a02e..ec49a8559 100644 --- a/config/template.json +++ b/config/template.json @@ -47,8 +47,8 @@ "ServerUpdate": "04:00" }, "Dungeon": { - "Name": "Calyx_Golden_Treasures", - "NameAtDoubleCalyx": "Calyx_Golden_Treasures", + "Name": "Calyx_Golden_Treasures_Jarilo_VI", + "NameAtDoubleCalyx": "Calyx_Golden_Treasures_Jarilo_VI", "NameAtDoubleRelic": "Cavern_of_Corrosion_Path_of_Providence", "Team": 1 }, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 64f0ee68d..d6fb6a215 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -222,7 +222,7 @@ "Dungeon": { "Name": { "type": "select", - "value": "Calyx_Golden_Treasures", + "value": "Calyx_Golden_Treasures_Jarilo_VI", "option": [ "Calyx_Golden_Memories_Jarilo_VI", "Calyx_Golden_Memories_The_Xianzhou_Luofu", @@ -277,7 +277,7 @@ }, "NameAtDoubleCalyx": { "type": "select", - "value": "Calyx_Golden_Treasures", + "value": "Calyx_Golden_Treasures_Jarilo_VI", "option": [ "Calyx_Golden_Memories_Jarilo_VI", "Calyx_Golden_Memories_The_Xianzhou_Luofu", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 0dc814a8f..ba2e252e3 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -99,10 +99,10 @@ CloudStorage: Dungeon: Name: # Dungeon names will be injected in config updater - value: Calyx_Golden_Treasures + value: Calyx_Golden_Treasures_Jarilo_VI option: [ ] NameAtDoubleCalyx: - value: Calyx_Golden_Treasures + value: Calyx_Golden_Treasures_Jarilo_VI option: [ ] NameAtDoubleRelic: value: Cavern_of_Corrosion_Path_of_Providence diff --git a/module/config/config_generated.py b/module/config/config_generated.py index efb301bda..7e2d932b5 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -46,8 +46,8 @@ class GeneratedConfig: CloudStorage_CloudRemainFree = {} # Group `Dungeon` - Dungeon_Name = 'Calyx_Golden_Treasures' # Calyx_Golden_Memories_Jarilo_VI, Calyx_Golden_Memories_The_Xianzhou_Luofu, Calyx_Golden_Memories_Penacony, Calyx_Golden_Aether_Jarilo_VI, Calyx_Golden_Aether_The_Xianzhou_Luofu, Calyx_Golden_Aether_Penacony, Calyx_Golden_Treasures_Jarilo_VI, Calyx_Golden_Treasures_The_Xianzhou_Luofu, Calyx_Golden_Treasures_Penacony, Calyx_Crimson_Destruction_Herta_StorageZone, Calyx_Crimson_Destruction_Luofu_ScalegorgeWaterscape, Calyx_Crimson_Preservation_Herta_SupplyZone, Calyx_Crimson_Preservation_Penacony_ClockStudiosThemePark, Calyx_Crimson_The_Hunt_Jarilo_OutlyingSnowPlains, Calyx_Crimson_The_Hunt_Penacony_SoulGladScorchsandAuditionVenue, Calyx_Crimson_Abundance_Jarilo_BackwaterPass, Calyx_Crimson_Abundance_Luofu_FyxestrollGarden, Calyx_Crimson_Erudition_Jarilo_RivetTown, Calyx_Crimson_Harmony_Jarilo_RobotSettlement, Calyx_Crimson_Harmony_Penacony_TheReverieDreamscape, Calyx_Crimson_Nihility_Jarilo_GreatMine, Calyx_Crimson_Nihility_Luofu_AlchemyCommission, Stagnant_Shadow_Spike, Stagnant_Shadow_Perdition, Stagnant_Shadow_Duty, Stagnant_Shadow_Blaze, Stagnant_Shadow_Scorch, Stagnant_Shadow_Ire, Stagnant_Shadow_Rime, Stagnant_Shadow_Icicle, Stagnant_Shadow_Nectar, Stagnant_Shadow_Fulmination, Stagnant_Shadow_Doom, Stagnant_Shadow_Gust, Stagnant_Shadow_Celestial, Stagnant_Shadow_Quanta, Stagnant_Shadow_Abomination, Stagnant_Shadow_Roast, Stagnant_Shadow_Mirage, Stagnant_Shadow_Puppetry, Cavern_of_Corrosion_Path_of_Gelid_Wind, Cavern_of_Corrosion_Path_of_Jabbing_Punch, Cavern_of_Corrosion_Path_of_Drifting, Cavern_of_Corrosion_Path_of_Providence, Cavern_of_Corrosion_Path_of_Holy_Hymn, Cavern_of_Corrosion_Path_of_Conflagration, Cavern_of_Corrosion_Path_of_Elixir_Seekers, Cavern_of_Corrosion_Path_of_Darkness, Cavern_of_Corrosion_Path_of_Dreamdive - Dungeon_NameAtDoubleCalyx = 'Calyx_Golden_Treasures' # Calyx_Golden_Memories_Jarilo_VI, Calyx_Golden_Memories_The_Xianzhou_Luofu, Calyx_Golden_Memories_Penacony, Calyx_Golden_Aether_Jarilo_VI, Calyx_Golden_Aether_The_Xianzhou_Luofu, Calyx_Golden_Aether_Penacony, Calyx_Golden_Treasures_Jarilo_VI, Calyx_Golden_Treasures_The_Xianzhou_Luofu, Calyx_Golden_Treasures_Penacony, Calyx_Crimson_Destruction_Herta_StorageZone, Calyx_Crimson_Destruction_Luofu_ScalegorgeWaterscape, Calyx_Crimson_Preservation_Herta_SupplyZone, Calyx_Crimson_Preservation_Penacony_ClockStudiosThemePark, Calyx_Crimson_The_Hunt_Jarilo_OutlyingSnowPlains, Calyx_Crimson_The_Hunt_Penacony_SoulGladScorchsandAuditionVenue, Calyx_Crimson_Abundance_Jarilo_BackwaterPass, Calyx_Crimson_Abundance_Luofu_FyxestrollGarden, Calyx_Crimson_Erudition_Jarilo_RivetTown, Calyx_Crimson_Harmony_Jarilo_RobotSettlement, Calyx_Crimson_Harmony_Penacony_TheReverieDreamscape, Calyx_Crimson_Nihility_Jarilo_GreatMine, Calyx_Crimson_Nihility_Luofu_AlchemyCommission + Dungeon_Name = 'Calyx_Golden_Treasures_Jarilo_VI' # Calyx_Golden_Memories_Jarilo_VI, Calyx_Golden_Memories_The_Xianzhou_Luofu, Calyx_Golden_Memories_Penacony, Calyx_Golden_Aether_Jarilo_VI, Calyx_Golden_Aether_The_Xianzhou_Luofu, Calyx_Golden_Aether_Penacony, Calyx_Golden_Treasures_Jarilo_VI, Calyx_Golden_Treasures_The_Xianzhou_Luofu, Calyx_Golden_Treasures_Penacony, Calyx_Crimson_Destruction_Herta_StorageZone, Calyx_Crimson_Destruction_Luofu_ScalegorgeWaterscape, Calyx_Crimson_Preservation_Herta_SupplyZone, Calyx_Crimson_Preservation_Penacony_ClockStudiosThemePark, Calyx_Crimson_The_Hunt_Jarilo_OutlyingSnowPlains, Calyx_Crimson_The_Hunt_Penacony_SoulGladScorchsandAuditionVenue, Calyx_Crimson_Abundance_Jarilo_BackwaterPass, Calyx_Crimson_Abundance_Luofu_FyxestrollGarden, Calyx_Crimson_Erudition_Jarilo_RivetTown, Calyx_Crimson_Harmony_Jarilo_RobotSettlement, Calyx_Crimson_Harmony_Penacony_TheReverieDreamscape, Calyx_Crimson_Nihility_Jarilo_GreatMine, Calyx_Crimson_Nihility_Luofu_AlchemyCommission, Stagnant_Shadow_Spike, Stagnant_Shadow_Perdition, Stagnant_Shadow_Duty, Stagnant_Shadow_Blaze, Stagnant_Shadow_Scorch, Stagnant_Shadow_Ire, Stagnant_Shadow_Rime, Stagnant_Shadow_Icicle, Stagnant_Shadow_Nectar, Stagnant_Shadow_Fulmination, Stagnant_Shadow_Doom, Stagnant_Shadow_Gust, Stagnant_Shadow_Celestial, Stagnant_Shadow_Quanta, Stagnant_Shadow_Abomination, Stagnant_Shadow_Roast, Stagnant_Shadow_Mirage, Stagnant_Shadow_Puppetry, Cavern_of_Corrosion_Path_of_Gelid_Wind, Cavern_of_Corrosion_Path_of_Jabbing_Punch, Cavern_of_Corrosion_Path_of_Drifting, Cavern_of_Corrosion_Path_of_Providence, Cavern_of_Corrosion_Path_of_Holy_Hymn, Cavern_of_Corrosion_Path_of_Conflagration, Cavern_of_Corrosion_Path_of_Elixir_Seekers, Cavern_of_Corrosion_Path_of_Darkness, Cavern_of_Corrosion_Path_of_Dreamdive + Dungeon_NameAtDoubleCalyx = 'Calyx_Golden_Treasures_Jarilo_VI' # Calyx_Golden_Memories_Jarilo_VI, Calyx_Golden_Memories_The_Xianzhou_Luofu, Calyx_Golden_Memories_Penacony, Calyx_Golden_Aether_Jarilo_VI, Calyx_Golden_Aether_The_Xianzhou_Luofu, Calyx_Golden_Aether_Penacony, Calyx_Golden_Treasures_Jarilo_VI, Calyx_Golden_Treasures_The_Xianzhou_Luofu, Calyx_Golden_Treasures_Penacony, Calyx_Crimson_Destruction_Herta_StorageZone, Calyx_Crimson_Destruction_Luofu_ScalegorgeWaterscape, Calyx_Crimson_Preservation_Herta_SupplyZone, Calyx_Crimson_Preservation_Penacony_ClockStudiosThemePark, Calyx_Crimson_The_Hunt_Jarilo_OutlyingSnowPlains, Calyx_Crimson_The_Hunt_Penacony_SoulGladScorchsandAuditionVenue, Calyx_Crimson_Abundance_Jarilo_BackwaterPass, Calyx_Crimson_Abundance_Luofu_FyxestrollGarden, Calyx_Crimson_Erudition_Jarilo_RivetTown, Calyx_Crimson_Harmony_Jarilo_RobotSettlement, Calyx_Crimson_Harmony_Penacony_TheReverieDreamscape, Calyx_Crimson_Nihility_Jarilo_GreatMine, Calyx_Crimson_Nihility_Luofu_AlchemyCommission Dungeon_NameAtDoubleRelic = 'Cavern_of_Corrosion_Path_of_Providence' # Cavern_of_Corrosion_Path_of_Gelid_Wind, Cavern_of_Corrosion_Path_of_Jabbing_Punch, Cavern_of_Corrosion_Path_of_Drifting, Cavern_of_Corrosion_Path_of_Providence, Cavern_of_Corrosion_Path_of_Holy_Hymn, Cavern_of_Corrosion_Path_of_Conflagration, Cavern_of_Corrosion_Path_of_Elixir_Seekers, Cavern_of_Corrosion_Path_of_Darkness, Cavern_of_Corrosion_Path_of_Dreamdive Dungeon_Team = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9