This commit is contained in:
parent
9a325a6f0e
commit
ca5001a376
7 changed files with 44 additions and 18 deletions
BIN
mower/resources/operation/+.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/operation/+.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/operation/x3.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/operation/x3.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/operation/x4.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/operation/x4.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/x1.png
(Stored with Git LFS)
BIN
mower/resources/x1.png
(Stored with Git LFS)
Binary file not shown.
|
@ -59,13 +59,9 @@ class OperationSolver(BaseSolver):
|
|||
|
||||
self.drop_list: list[dict[str, int]] = [] # 掉落列表
|
||||
self.drop_recog_complete = False # 本轮作战识别是否完成
|
||||
return super().run()
|
||||
|
||||
def number(self, scope: tp.Scope, height: Optional[int] = None):
|
||||
rect_limits = [{"w": 5, "h": 5, "char": ""}]
|
||||
return config.recog.num.number_int(
|
||||
"secret_front", scope, height, rect_limits=rect_limits
|
||||
)
|
||||
self.auto_repeat = False # 更改连战次数
|
||||
return super().run()
|
||||
|
||||
def drop_recog(self):
|
||||
result = []
|
||||
|
@ -134,22 +130,42 @@ class OperationSolver(BaseSolver):
|
|||
def ope_start(self):
|
||||
self.operation_start_time = datetime.now()
|
||||
self.drop_recog_complete = False
|
||||
self.auto_repeat = True
|
||||
self.ctap("ope_start", 3)
|
||||
|
||||
def repeat_scope(self) -> tuple[int, tp.Location]:
|
||||
"""选择不用吃药的最高连战次数
|
||||
|
||||
Returns:
|
||||
tuple[int, tp.Location]: 连战次数和点击区域/坐标
|
||||
"""
|
||||
y = 291
|
||||
for i in range(6, 0, -1):
|
||||
scope = (1445, y), (1555, y + 90)
|
||||
y += 93
|
||||
if self.find("operation/+", scope=scope):
|
||||
continue
|
||||
return i, scope
|
||||
return 1, (1501, 802)
|
||||
|
||||
def transition(self):
|
||||
if (scene := self.scene()) == Scene.OPERATOR_BEFORE:
|
||||
if self.check_timeout():
|
||||
return True
|
||||
if self.animation():
|
||||
return
|
||||
if config.recog.gray[907][1600] < 127: # 代理指挥
|
||||
self.ctap((1776, 908), 3)
|
||||
if config.recog.gray[907][1600] < 127:
|
||||
if self.ctap((1776, 908), 3):
|
||||
logger.info("启用代理指挥")
|
||||
return
|
||||
if self.number(((1520, 890), (1545, 930)), 28) > 1:
|
||||
if pos := self.find("x1"):
|
||||
self.ctap(pos, 3)
|
||||
else:
|
||||
self.ctap((1500, 910), 3)
|
||||
if self.find("operation/x3") or self.find("operation/x4"):
|
||||
repeat_times, pos = self.repeat_scope()
|
||||
if self.ctap(pos, 3):
|
||||
logger.info(f"选择连战次数:{repeat_times}次")
|
||||
self.auto_repeat = False
|
||||
return
|
||||
if self.auto_repeat:
|
||||
self.ctap((1501, 891), 3)
|
||||
return
|
||||
self.ope_start()
|
||||
elif scene == Scene.OPERATOR_SELECT:
|
||||
|
|
|
@ -107,6 +107,8 @@ color = {
|
|||
"ope_recover_originite_on": (1514, 124),
|
||||
"ope_recover_potion_on": (1046, 127),
|
||||
"open_recruitment": (192, 143),
|
||||
"operation/x3": (1477, 601),
|
||||
"operation/x4": (1478, 509),
|
||||
"operator/filter_hide": (1831, 48),
|
||||
"operator/filter_show": (1823, 46),
|
||||
"operator/trust": (38, 600),
|
||||
|
@ -245,10 +247,10 @@ color = {
|
|||
"sss/switch_to_ex": (1255, 942),
|
||||
"sss/switch_to_normal": (1255, 934),
|
||||
"start_story": (1392, 623),
|
||||
"x1": (1477, 784),
|
||||
}
|
||||
|
||||
template_matching = {
|
||||
"operation/+": None,
|
||||
"activity": None,
|
||||
"announcement_close": ((960, 0), (1920, 540)),
|
||||
"arrange_check_in": ((30, 300), (175, 700)),
|
||||
|
|
|
@ -323,6 +323,9 @@ Res = Literal[
|
|||
"ope_select_start_empty",
|
||||
"ope_start",
|
||||
"open_recruitment",
|
||||
"operation/+",
|
||||
"operation/x3",
|
||||
"operation/x4",
|
||||
"operator/CASTER",
|
||||
"operator/MEDIC",
|
||||
"operator/PIONEER",
|
||||
|
@ -729,5 +732,4 @@ Res = Literal[
|
|||
"user",
|
||||
"user_on",
|
||||
"visit_limit",
|
||||
"x1",
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue