diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 0f28e32..f89636e 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -26,6 +26,7 @@ - 修改软件图标的加载方式 - 调整素材导入方式 - `assets.json`文件支持(0,0,0,0)格式,表示整个游戏窗口 +- 调整`斗技自动上阵`单局结束后同时触发周奖励和段位上升时的顺序 ### 修复 diff --git a/src/package/douji.py b/src/package/douji.py index 1b579ed..628e928 100644 --- a/src/package/douji.py +++ b/src/package/douji.py @@ -1,3 +1,4 @@ +from src.utils.image import RuleImage from ..utils.adapter import Mouse from ..utils.event import event_thread from ..utils.exception import GUIStopException @@ -45,6 +46,12 @@ def fighting_once(self): result = ocr_match_once(self.current_asset_list) if result is None: + ruleimage = RuleImage(self.global_assets.IMAGE_FAIL) + if ruleimage.match(): + logger.ui_warn("失败") + Mouse.click(ruleimage.center_point()) + self.done() + return continue logger.info(f"current result name: {result.name}") @@ -71,6 +78,7 @@ def fighting_once(self): case self.OCR_INTENTIONAL.name: logger.ui("手动技能") Mouse.click(result.match_result.center) + sleep(4) # 万一对面直接退了呢 case self.global_assets.OCR_CLICK_AND_CONTINUE.name: @@ -97,6 +105,7 @@ def fighting_once(self): msg_title = False def run(self): + weekly_rewards: int = 0 while self.n < self.max: if bool(event_thread): raise GUIStopException @@ -104,11 +113,13 @@ def run(self): self.fighting_once() sleep(4) + # 周奖励 + if weekly_rewards < 3 and self.check_click(self.global_assets.IMAGE_FINISH, timeout=5): + logger.ui("周奖励") + weekly_rewards += 1 + _ocr = RuleOcr(self.OCR_LEVEL_UP) if result := _ocr.match(): logger.ui("段位上升") point = RelativePoint(result.center.x, result.center.y + 200) Mouse.click(point) - - # 每周3胜/5胜奖励 - self.check_click(self.global_assets.IMAGE_FINISH, timeout=5) diff --git a/tests/package/test_rilun.py b/tests/package/test_rilun.py index d33e15d..0a25fe6 100644 --- a/tests/package/test_rilun.py +++ b/tests/package/test_rilun.py @@ -4,7 +4,6 @@ class RiLun(Package): resource_path = "rilun" resource_list = [ - "fighting", ]