From 665f331640220a7ac6bb6ab46dad799421645c9f Mon Sep 17 00:00:00 2001 From: EightyDollars Date: Thu, 7 Nov 2024 13:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E9=80=89=E4=BA=BA=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E9=80=89=E4=B8=AD=E7=9A=84=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fight/battle_choose/battle_agent_choose.py | 18 +++++++++++++----- .../fight/battle_choose/choose_skill.py | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mower/solvers/fight/battle_choose/battle_agent_choose.py b/mower/solvers/fight/battle_choose/battle_agent_choose.py index 2468f4c..09b5caf 100644 --- a/mower/solvers/fight/battle_choose/battle_agent_choose.py +++ b/mower/solvers/fight/battle_choose/battle_agent_choose.py @@ -75,7 +75,7 @@ class BattleAgentChooseSolver(SceneGraphSolver): self.agent = None return logger.info(f"干员选择:{self.agent}") - self.ctap(agents[agent_name], 5, config.screenshot_avg / 1000) + self.ctap(agents[agent_name], 1, config.screenshot_avg / 1000) return if list(agents.keys())[-1] == self.tmp_data or list(agents.keys())[-1] is None: logger.error(f"选择干员: {self.agent}失败 滑动次数过多") @@ -83,7 +83,9 @@ class BattleAgentChooseSolver(SceneGraphSolver): self.agent = None return - self.swipe_noinertia((1000, 540), (-1900, 0)) + self.swipe_noinertia( + (1000, 540), (-1900, 0), duration=config.screenshot_avg / 100 + ) self.tmp_data = list(agents.keys())[-1] @@ -92,12 +94,18 @@ class BattleAgentChooseSolver(SceneGraphSolver): cropimg( config.recog.img, [ - [scope[0][0] + 0, scope[0][1] - 86], - [scope[0][0] + 1, scope[0][1] - 85], + [scope[0][0] + 0, scope[0][1] - 113], + [scope[0][0] + 1, scope[0][1] - 112], ], )[0][0][0] < 50 - ): + ) and cropimg( + config.recog.img, + [ + [scope[0][0] + 0, scope[1][1] + 216], + [scope[0][0] + 1, scope[1][1] + 217], + ], + )[0][0][0] < 50: return True return False diff --git a/mower/solvers/fight/battle_choose/choose_skill.py b/mower/solvers/fight/battle_choose/choose_skill.py index 7131e4e..46cac4b 100644 --- a/mower/solvers/fight/battle_choose/choose_skill.py +++ b/mower/solvers/fight/battle_choose/choose_skill.py @@ -24,7 +24,7 @@ class ChooseSkillSolver(SceneGraphSolver): threshold = 0.7 res = loadres("fight/light") result = cv2.matchTemplate(img, res, cv2.TM_CCOEFF_NORMED).T[0] - print(result) + # print(result) pos_list = [] for i in argrelmax(result, order=50)[0]: if result[i] > threshold: