diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index d290fadc9..6d42aeb42 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -94,8 +94,8 @@ class OcrDungeonList(Ocr): result = re.sub(r'蛀星的旧.*?历战', '蛀星的旧靥•历战', result) # 9支援仓段 - result = result.removeprefix('9') - result = result.removeprefix('Q') + for word in 'Q9α': + result = result.removeprefix(word) return result @@ -165,6 +165,11 @@ class DraggableDungeonList(DraggableList): indexes = [self.keyword2index(row.matched_keyword) for row in self.cur_buttons] indexes = [index for index in indexes if index] + + if not indexes: + logger.warning(f'No valid rows loaded into {self}') + return + self.cur_min = min(indexes) self.cur_max = max(indexes) logger.attr(self.name, f'{self.cur_min} - {self.cur_max}') diff --git a/tasks/dungeon/weekly.py b/tasks/dungeon/weekly.py index a5d549065..359b9ba59 100644 --- a/tasks/dungeon/weekly.py +++ b/tasks/dungeon/weekly.py @@ -54,6 +54,7 @@ class WeeklyDungeon(Dungeon): # Equivalent to self.dungeon_goto(dungeon), but check limit remains DUNGEON_LIST.search_button = OCR_DUNGEON_LIST self._dungeon_nav_goto(KEYWORDS_DUNGEON_NAV.Echo_of_War) + self._dungeon_wait_until_dungeon_list_loaded() # Check limit remain = self.get_weekly_remain()