mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Opt: Wait rogue buttons loaded before clicking to prevent retries
This commit is contained in:
parent
3679f00c13
commit
4d086d1753
BIN
assets/share/rogue/path/PATH_LOADED_CHECK.png
Normal file
BIN
assets/share/rogue/path/PATH_LOADED_CHECK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -238,3 +238,13 @@ PAGE_ROGUE_PATH = ButtonWrapper(
|
||||
button=(606, 89, 656, 108),
|
||||
),
|
||||
)
|
||||
PATH_LOADED_CHECK = ButtonWrapper(
|
||||
name='PATH_LOADED_CHECK',
|
||||
share=Button(
|
||||
file='./assets/share/rogue/path/PATH_LOADED_CHECK.png',
|
||||
area=(989, 18, 1175, 59),
|
||||
search=(969, 0, 1195, 79),
|
||||
color=(45, 45, 47),
|
||||
button=(989, 18, 1175, 59),
|
||||
),
|
||||
)
|
||||
|
@ -4,8 +4,8 @@ from module.base.utils import area_offset
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Digit, Ocr, OcrResultButton
|
||||
from tasks.base.ui import UI
|
||||
from tasks.rogue.assets.assets_rogue_weekly import REWARD_ENTER
|
||||
from tasks.rogue.assets.assets_rogue_ui import *
|
||||
from tasks.rogue.assets.assets_rogue_weekly import REWARD_ENTER
|
||||
from tasks.rogue.keywords import RoguePath
|
||||
|
||||
|
||||
|
@ -250,6 +250,9 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI):
|
||||
self.interval_reset(REWARD_ENTER, interval=2)
|
||||
continue
|
||||
if self.match_template_color(LEVEL_CONFIRM, interval=2):
|
||||
if not self.image_color_count(LEVEL_CONFIRM, color=(223, 223, 225), threshold=240, count=50):
|
||||
self.interval_clear(LEVEL_CONFIRM)
|
||||
continue
|
||||
self.dungeon_update_stamina()
|
||||
self.check_stop_condition()
|
||||
self.device.click(LEVEL_CONFIRM)
|
||||
|
@ -206,6 +206,9 @@ class RoguePathHandler(RogueUI):
|
||||
break
|
||||
|
||||
if self.match_template_color(ROGUE_LAUNCH, interval=2):
|
||||
if not self.image_color_count(ROGUE_LAUNCH, color=(223, 223, 225), threshold=240, count=50):
|
||||
self.interval_clear(ROGUE_LAUNCH)
|
||||
continue
|
||||
if not self._is_team_prepared():
|
||||
raise RogueTeamNotPrepared
|
||||
self.device.click(ROGUE_LAUNCH)
|
||||
@ -216,11 +219,19 @@ class RoguePathHandler(RogueUI):
|
||||
continue
|
||||
# Select path
|
||||
if self.interval_is_reached(entry, interval=2) and self._is_page_rogue_path():
|
||||
if self.appear_then_click(entry, interval=2):
|
||||
if not self.image_color_count(PATH_LOADED_CHECK, color=(246, 246, 246), threshold=240, count=50):
|
||||
self.interval_clear(entry)
|
||||
continue
|
||||
if self.appear(entry):
|
||||
self.device.click(entry)
|
||||
self.interval_reset(entry, interval=2)
|
||||
continue
|
||||
# Confirm path
|
||||
if self.appear(CONFIRM_PATH, interval=2):
|
||||
if not self.image_color_count(CONFIRM_PATH, color=(223, 223, 225), threshold=240, count=50):
|
||||
self.interval_clear(CONFIRM_PATH)
|
||||
continue
|
||||
if self._change_confirm_path(path):
|
||||
self.device.click(CONFIRM_PATH)
|
||||
self.interval_reset(CONFIRM_PATH)
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user