战斗选人判定选中的位置调整
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful

This commit is contained in:
EightyDollars 2024-11-07 13:18:20 +08:00
parent 54ca6d7275
commit 665f331640
2 changed files with 14 additions and 6 deletions

View file

@ -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

View file

@ -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: