diff --git a/assets/cn/combat/obtain/MAY_OBTAIN.SEARCH.png b/assets/cn/combat/obtain/MAY_OBTAIN.SEARCH.png index 9a91ca8cb..36f63ce6f 100644 Binary files a/assets/cn/combat/obtain/MAY_OBTAIN.SEARCH.png and b/assets/cn/combat/obtain/MAY_OBTAIN.SEARCH.png differ diff --git a/assets/en/combat/obtain/MAY_OBTAIN.SEARCH.png b/assets/en/combat/obtain/MAY_OBTAIN.SEARCH.png index 2f6d2936a..36f63ce6f 100644 Binary files a/assets/en/combat/obtain/MAY_OBTAIN.SEARCH.png and b/assets/en/combat/obtain/MAY_OBTAIN.SEARCH.png differ diff --git a/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png b/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png index 0d923be6b..9d2547d14 100644 Binary files a/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png and b/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png differ diff --git a/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.SEARCH.png b/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.SEARCH.png new file mode 100644 index 000000000..3954dedae Binary files /dev/null and b/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.SEARCH.png differ diff --git a/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png b/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png index edd967cda..f64697fca 100644 Binary files a/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png and b/assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png differ diff --git a/tasks/combat/assets/assets_combat_obtain.py b/tasks/combat/assets/assets_combat_obtain.py index 09aea60b3..1306d4bb4 100644 --- a/tasks/combat/assets/assets_combat_obtain.py +++ b/tasks/combat/assets/assets_combat_obtain.py @@ -38,14 +38,14 @@ MAY_OBTAIN = ButtonWrapper( cn=Button( file='./assets/cn/combat/obtain/MAY_OBTAIN.png', area=(813, 379, 893, 397), - search=(812, 330, 895, 468), + search=(800, 166, 975, 545), color=(63, 71, 87), button=(813, 379, 893, 397), ), en=Button( file='./assets/en/combat/obtain/MAY_OBTAIN.png', area=(813, 379, 922, 397), - search=(812, 330, 922, 468), + search=(800, 166, 975, 545), color=(53, 61, 78), button=(813, 379, 922, 397), ), diff --git a/tasks/dungeon/assets/assets_dungeon_event.py b/tasks/dungeon/assets/assets_dungeon_event.py index 5afe54516..0242a4fe2 100644 --- a/tasks/dungeon/assets/assets_dungeon_event.py +++ b/tasks/dungeon/assets/assets_dungeon_event.py @@ -37,10 +37,10 @@ OCR_DOUBLE_EVENT_REMAIN = ButtonWrapper( name='OCR_DOUBLE_EVENT_REMAIN', share=Button( file='./assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png', - area=(517, 239, 1081, 261), - search=(497, 219, 1101, 281), - color=(198, 161, 90), - button=(517, 239, 1081, 261), + area=(517, 177, 1087, 199), + search=(497, 157, 1107, 219), + color=(198, 163, 97), + button=(517, 177, 1087, 199), ), ) OCR_DOUBLE_EVENT_REMAIN_AT_COMBAT = ButtonWrapper( diff --git a/tasks/dungeon/assets/assets_dungeon_ui_rogue.py b/tasks/dungeon/assets/assets_dungeon_ui_rogue.py index d2e5e6db9..84e4c8ab5 100644 --- a/tasks/dungeon/assets/assets_dungeon_ui_rogue.py +++ b/tasks/dungeon/assets/assets_dungeon_ui_rogue.py @@ -37,10 +37,10 @@ SIMULATED_UNIVERSE_LOADED_CLASSIC = ButtonWrapper( name='SIMULATED_UNIVERSE_LOADED_CLASSIC', share=Button( file='./assets/share/dungeon/ui_rogue/SIMULATED_UNIVERSE_LOADED_CLASSIC.png', - area=(549, 607, 572, 629), - search=(529, 587, 592, 649), - color=(147, 137, 157), - button=(549, 607, 572, 629), + area=(507, 501, 547, 541), + search=(465, 172, 588, 656), + color=(157, 155, 157), + button=(507, 501, 547, 541), ), ) SURVIVAL_INDEX_OE_LOADED = ButtonWrapper( diff --git a/tasks/dungeon/ui/ui_rogue.py b/tasks/dungeon/ui/ui_rogue.py index a73968cf5..afb3db047 100644 --- a/tasks/dungeon/ui/ui_rogue.py +++ b/tasks/dungeon/ui/ui_rogue.py @@ -1,5 +1,5 @@ from module.base.timer import Timer -from module.base.utils import random_rectangle_vector +from module.base.utils import area_in_area, random_rectangle_vector from module.logger import logger from tasks.base.page import page_guide from tasks.dungeon.assets.assets_dungeon_ui import * @@ -94,17 +94,6 @@ class DungeonRogueUI(DungeonUI): Swipe down to find teleport button of classic rogue Note that this method will change SIMULATED_UNIVERSE_LOADED_CLASSIC.search, original value should have a backup """ - # Already having classic rogue entry insight - SIMULATED_UNIVERSE_LOADED_CLASSIC.load_search(OCR_DUNGEON_LIST.button) - if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC): - buttons = TELEPORT.match_multi_template(self.device.image) - y = SIMULATED_UNIVERSE_LOADED_CLASSIC.button[1] - for button in buttons: - # And having a teleport button below - if button.button[1] > y: - logger.info('Classic rogue teleport already in sight') - return True - logger.info('Dungeon rogue swipe down') interval = Timer(2, count=4) while 1: @@ -114,10 +103,20 @@ class DungeonRogueUI(DungeonUI): self.device.screenshot() # End - if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC): - if self.appear(LAST_TELEPORT): - logger.info('Classic rogue teleport at end') - return True + if self.appear(SIMULATED_UNIVERSE_LOADED_CLASSIC, interval=3): + logger.info('Found rogue icon') + # Search teleport button on the right + _, y1, _, y2 = SIMULATED_UNIVERSE_LOADED_CLASSIC.button + x1, _, x2, _ = TELEPORT.area + search = (x1 - 50, y1 - 120, x2 + 50, y2 + 120) + # Check if button in search area + for button in TELEPORT.match_multi_template(self.device.image): + if area_in_area(button.button, search, threshold=0): + logger.info('Found rogue TELEPORT') + self.device.click(button) + return True + # TELEPORT not found + self.interval_clear(SIMULATED_UNIVERSE_LOADED_CLASSIC) # Swipe if interval.reached():