This commit is contained in:
parent
54ca6d7275
commit
665f331640
2 changed files with 14 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue