fix:tag选择失败和信赖筛选反复点击

This commit is contained in:
EightyDollars 2024-11-13 00:38:04 +08:00
parent b28b9cfe8a
commit c153f10c23
5 changed files with 8 additions and 16 deletions

Binary file not shown.

View file

@ -10,7 +10,7 @@ from mower.utils.scene import Scene
class BattleFilterSolver(SceneGraphSolver):
def __init__(self) -> None:
def run(self, tag: str, ascending: bool = True) -> None:
self.labels = [
"获取时间",
"信赖值",
@ -29,7 +29,6 @@ class BattleFilterSolver(SceneGraphSolver):
"自定义",
]
def run(self, tag: str, ascending: bool = True) -> None:
if tag not in self.labels and tag not in self.orders:
raise KeyError
@ -42,7 +41,7 @@ class BattleFilterSolver(SceneGraphSolver):
self.tag_choose_done = True
self.in_label = False
self.label = self.tag
self.interval = config.screenshot_avg / 5000
super().run()
return True
@ -98,7 +97,7 @@ class BattleFilterSolver(SceneGraphSolver):
def choose_tag(self):
if self.tag_choose_done:
if self.find("choose_agent/battle_filter_close"):
self.tap((1750, 60), interval=0.1)
self.ctap((1750, 60), interval=self.interval)
return
n, s = self.detect_arrange_order()
if n != self.label or s != self.ascending:

View file

@ -29,11 +29,7 @@ class BattleTagChoose(SceneGraphSolver):
return "ALL"
if arrow := self.find("choose_agent/profession/choose_arrow"):
for i in self.professions:
str = "choose_agent/profession/" + i
pos = self.find(str)
if pos[0][1] > arrow[0][1] and pos[1][1] < arrow[1][1]:
return i
return self.professions[int((arrow[0][1] - 120) / 120)]
return False

View file

@ -27,11 +27,7 @@ class RIICTagChoose(SceneGraphSolver):
return "ALL"
if arrow := self.find("choose_agent/profession/choose_arrow"):
for i in self.professions:
str = "choose_agent/profession/" + i
pos = self.find(str)
if pos[0][1] > arrow[0][1] and pos[1][1] < arrow[1][1]:
return i
return self.professions[int((arrow[0][1] - 120) / 120)]
return False

View file

@ -300,6 +300,7 @@ template_matching = {
template_matching_score = {
"connecting": 0.7,
"choose_agent/battle_filter_close": 0.75,
"navigation/episode": 0.7,
"navigation/ope_hard": 0.7,
"navigation/ope_hard_small": 0.7,