Fix: Leave OE before running

This commit is contained in:
LmeSzinc 2024-08-11 02:39:55 +08:00
parent 216a1bac2f
commit 47a07b0c52
5 changed files with 28 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -23,3 +23,13 @@ ROGUE_LEAVE_FOR_NOW = ButtonWrapper(
button=(729, 475, 765, 519), button=(729, 475, 765, 519),
), ),
) )
ROGUE_LEAVE_FOR_NOW_OE = ButtonWrapper(
name='ROGUE_LEAVE_FOR_NOW_OE',
share=Button(
file='./assets/share/base/main_page/ROGUE_LEAVE_FOR_NOW_OE.png',
area=(730, 551, 760, 587),
search=(710, 531, 780, 607),
color=(63, 52, 40),
button=(730, 551, 760, 587),
),
)

View File

@ -297,6 +297,16 @@ MAP_EXIT = ButtonWrapper(
), ),
], ],
) )
MAP_EXIT_OE = ButtonWrapper(
name='MAP_EXIT_OE',
share=Button(
file='./assets/share/base/page/MAP_EXIT_OE.png',
area=(51, 55, 68, 84),
search=(31, 35, 88, 104),
color=(141, 140, 141),
button=(51, 55, 68, 84),
),
)
MAP_GOTO_WORLD = ButtonWrapper( MAP_GOTO_WORLD = ButtonWrapper(
name='MAP_GOTO_WORLD', name='MAP_GOTO_WORLD',
share=Button( share=Button(

View File

@ -4,8 +4,8 @@ from module.base.timer import Timer
from module.exception import GameNotRunningError, GamePageUnknownError from module.exception import GameNotRunningError, GamePageUnknownError
from module.logger import logger from module.logger import logger
from module.ocr.ocr import Ocr from module.ocr.ocr import Ocr
from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW from tasks.base.assets.assets_base_main_page import ROGUE_LEAVE_FOR_NOW, ROGUE_LEAVE_FOR_NOW_OE
from tasks.base.assets.assets_base_page import CLOSE, MAIN_GOTO_CHARACTER, MAP_EXIT from tasks.base.assets.assets_base_page import CLOSE, MAIN_GOTO_CHARACTER, MAP_EXIT, MAP_EXIT_OE
from tasks.base.main_page import MainPage from tasks.base.main_page import MainPage
from tasks.base.page import Page, page_gacha, page_main from tasks.base.page import Page, page_gacha, page_main
from tasks.combat.assets.assets_combat_finish import COMBAT_EXIT from tasks.combat.assets.assets_combat_finish import COMBAT_EXIT
@ -344,7 +344,6 @@ class UI(MainPage):
return appear return appear
def is_in_map_exit(self, interval=0): def is_in_map_exit(self, interval=0):
self.device.stuck_record_add(MAP_EXIT) self.device.stuck_record_add(MAP_EXIT)
@ -355,6 +354,9 @@ class UI(MainPage):
if MAP_EXIT.match_template_luma(self.device.image): if MAP_EXIT.match_template_luma(self.device.image):
if self.image_color_count(MAP_EXIT, color=(235, 235, 235), threshold=221, count=50): if self.image_color_count(MAP_EXIT, color=(235, 235, 235), threshold=221, count=50):
appear = True appear = True
if MAP_EXIT_OE.match_template_luma(self.device.image):
if self.image_color_count(MAP_EXIT_OE, color=(235, 235, 235), threshold=221, count=50):
appear = True
if appear and interval: if appear and interval:
self.interval_reset(MAP_EXIT, interval=interval) self.interval_reset(MAP_EXIT, interval=interval)
@ -482,3 +484,6 @@ class UI(MainPage):
if self.appear_then_click(ROGUE_LEAVE_FOR_NOW, interval=2): if self.appear_then_click(ROGUE_LEAVE_FOR_NOW, interval=2):
clicked = True clicked = True
continue continue
if self.appear_then_click(ROGUE_LEAVE_FOR_NOW_OE, interval=2):
clicked = True
continue