卫戍协议操作与识别改进、适配原型协议
This commit is contained in:
parent
6df5160a9f
commit
c77a72ebd3
14 changed files with 57 additions and 30 deletions
|
@ -739,6 +739,10 @@
|
||||||
"label": "SP_ANIMATION",
|
"label": "SP_ANIMATION",
|
||||||
"comment": "卫戍协议动画"
|
"comment": "卫戍协议动画"
|
||||||
},
|
},
|
||||||
|
"1809": {
|
||||||
|
"label": "SP_WASTE_CONFIRM",
|
||||||
|
"comment": "卫戍协议浪费金币确认"
|
||||||
|
},
|
||||||
"9998": {
|
"9998": {
|
||||||
"label": "LOADING",
|
"label": "LOADING",
|
||||||
"comment": "场景跳转时的等待界面"
|
"comment": "场景跳转时的等待界面"
|
||||||
|
|
BIN
mower/resources/double_confirm/stronghold_protocol_waste.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/double_confirm/stronghold_protocol_waste.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/stronghold_protocol/money0.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/stronghold_protocol/money0.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/stronghold_protocol/money2.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/stronghold_protocol/money2.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
mower/resources/stronghold_protocol/round1.png
(Stored with Git LFS)
Normal file
BIN
mower/resources/stronghold_protocol/round1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -11,14 +11,22 @@ from mower.utils.vector import va
|
||||||
class StrongholdProtocol(SceneGraphSolver, FightMixin):
|
class StrongholdProtocol(SceneGraphSolver, FightMixin):
|
||||||
solver_name = "卫戍协议"
|
solver_name = "卫戍协议"
|
||||||
|
|
||||||
def run(self):
|
def read_money(self) -> bool:
|
||||||
return super().run()
|
if self.find("stronghold_protocol/money3"):
|
||||||
|
money = 3
|
||||||
|
elif self.find("stronghold_protocol/money5"):
|
||||||
|
money = 5
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
self.sleep()
|
||||||
|
return self.find(f"stronghold_protocol/money{money}") == money
|
||||||
|
|
||||||
def transition(self):
|
def transition(self):
|
||||||
if (scene := self.scene()) == Scene.TERMINAL_MAIN:
|
if (scene := self.scene()) == Scene.TERMINAL_MAIN:
|
||||||
self.terminal_entry("stronghold_protocol/entry.jpg")
|
self.terminal_entry("stronghold_protocol/entry.jpg")
|
||||||
elif scene == Scene.SP_MAIN:
|
elif scene == Scene.SP_MAIN:
|
||||||
if pos := self.find("stronghold_protocol/stop"):
|
if pos := self.find("stronghold_protocol/stop"):
|
||||||
|
if not self.find("stronghold_protocol/round1"):
|
||||||
self.tap(pos)
|
self.tap(pos)
|
||||||
return
|
return
|
||||||
self.tap((1664, 911))
|
self.tap((1664, 911))
|
||||||
|
@ -51,19 +59,22 @@ class StrongholdProtocol(SceneGraphSolver, FightMixin):
|
||||||
if pos := self.find("stronghold_protocol/buy3"):
|
if pos := self.find("stronghold_protocol/buy3"):
|
||||||
self.tap(pos)
|
self.tap(pos)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.find("stronghold_protocol/empty"):
|
if self.find("stronghold_protocol/empty"):
|
||||||
self.tap((407, 540))
|
if self.find("stronghold_protocol/money0") or self.find(
|
||||||
|
"stronghold_protocol/money2"
|
||||||
|
):
|
||||||
|
self.tap((1827, 93)) # 开始作战
|
||||||
|
return
|
||||||
|
self.tap((407, 540)) # 购买干员
|
||||||
return
|
return
|
||||||
|
|
||||||
# 放置干员
|
# 放置干员
|
||||||
pos = (1058, 746) if self.find("stronghold_protocol/block") else (1475, 524)
|
pos = (1058, 746) if self.find("stronghold_protocol/block") else (1475, 524)
|
||||||
while True:
|
for _ in range(3):
|
||||||
self.swipe_ext([(1602, 989), pos], [500], 100, 0.3)
|
self.swipe_ext([(1602, 989), pos], [500], 100, 0.3)
|
||||||
if self.drag_success():
|
if self.drag_success():
|
||||||
|
self.swipe_ext([pos, va(pos, (300, 0))], [200], 100)
|
||||||
break
|
break
|
||||||
self.swipe_ext([pos, va(pos, (300, 0))], [200], 100, 0.1)
|
|
||||||
|
|
||||||
# 开始作战
|
|
||||||
self.tap((1827, 93))
|
|
||||||
else:
|
else:
|
||||||
self.scene_graph_step(Scene.TERMINAL_MAIN)
|
self.scene_graph_step(Scene.TERMINAL_MAIN)
|
||||||
|
|
|
@ -16,6 +16,7 @@ def sp_back(solver: BaseSolver):
|
||||||
|
|
||||||
@edge(Scene.SP_GIVEUP_CONFIRM, Scene.SP_MAIN)
|
@edge(Scene.SP_GIVEUP_CONFIRM, Scene.SP_MAIN)
|
||||||
@edge(Scene.SP_BACK_CONFIRM, Scene.SP_MAIN)
|
@edge(Scene.SP_BACK_CONFIRM, Scene.SP_MAIN)
|
||||||
|
@edge(Scene.SP_WASTE_CONFIRM, Scene.SP_AUTO)
|
||||||
def dialog_confirm(solver: BaseSolver):
|
def dialog_confirm(solver: BaseSolver):
|
||||||
solver.tap("double_confirm/main", x_rate=1)
|
solver.tap("double_confirm/main", x_rate=1)
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,8 @@ class Recognizer:
|
||||||
self.scene = Scene.SP_BACK_CONFIRM
|
self.scene = Scene.SP_BACK_CONFIRM
|
||||||
elif self.find("double_confirm/stronghold_protocol_giveup"):
|
elif self.find("double_confirm/stronghold_protocol_giveup"):
|
||||||
self.scene = Scene.SP_GIVEUP_CONFIRM
|
self.scene = Scene.SP_GIVEUP_CONFIRM
|
||||||
|
elif self.find("double_confirm/stronghold_protocol_waste"):
|
||||||
|
self.scene = Scene.SP_WASTE_CONFIRM
|
||||||
else:
|
else:
|
||||||
self.scene = Scene.DOUBLE_CONFIRM
|
self.scene = Scene.DOUBLE_CONFIRM
|
||||||
elif self.find("mission_trainee_on"):
|
elif self.find("mission_trainee_on"):
|
||||||
|
|
|
@ -39,6 +39,7 @@ color = {
|
||||||
"double_confirm/sss_abandon_drop": (901, 463),
|
"double_confirm/sss_abandon_drop": (901, 463),
|
||||||
"double_confirm/stronghold_protocol_back": (1056, 437),
|
"double_confirm/stronghold_protocol_back": (1056, 437),
|
||||||
"double_confirm/stronghold_protocol_giveup": (921, 434),
|
"double_confirm/stronghold_protocol_giveup": (921, 434),
|
||||||
|
"double_confirm/stronghold_protocol_waste": (706, 398),
|
||||||
"double_confirm/voice": (745, 435),
|
"double_confirm/voice": (745, 435),
|
||||||
"drone": (274, 437),
|
"drone": (274, 437),
|
||||||
"factory_collect": (1542, 886),
|
"factory_collect": (1542, 886),
|
||||||
|
@ -172,6 +173,9 @@ color = {
|
||||||
"stronghold_protocol/defence": (29, 14),
|
"stronghold_protocol/defence": (29, 14),
|
||||||
"stronghold_protocol/empty": (1533, 934),
|
"stronghold_protocol/empty": (1533, 934),
|
||||||
"stronghold_protocol/main": (1456, 472),
|
"stronghold_protocol/main": (1456, 472),
|
||||||
|
"stronghold_protocol/money0": (326, 255),
|
||||||
|
"stronghold_protocol/money2": (327, 255),
|
||||||
|
"stronghold_protocol/round1": (1701, 856),
|
||||||
"stronghold_protocol/start": (1709, 879),
|
"stronghold_protocol/start": (1709, 879),
|
||||||
"stronghold_protocol/stop": (1272, 801),
|
"stronghold_protocol/stop": (1272, 801),
|
||||||
"terminal_main": (1658, 734),
|
"terminal_main": (1658, 734),
|
||||||
|
|
|
@ -369,6 +369,8 @@ class Scene:
|
||||||
"卫戍协议回到主页确认"
|
"卫戍协议回到主页确认"
|
||||||
SP_ANIMATION = 1808
|
SP_ANIMATION = 1808
|
||||||
"卫戍协议动画"
|
"卫戍协议动画"
|
||||||
|
SP_WASTE_CONFIRM = 1809
|
||||||
|
"卫戍协议浪费金币确认"
|
||||||
LOADING = 9998
|
LOADING = 9998
|
||||||
"场景跳转时的等待界面"
|
"场景跳转时的等待界面"
|
||||||
CONFIRM = 9999
|
CONFIRM = 9999
|
||||||
|
@ -561,6 +563,7 @@ SceneComment = {
|
||||||
1806: "卫戍协议结算",
|
1806: "卫戍协议结算",
|
||||||
1807: "卫戍协议回到主页确认",
|
1807: "卫戍协议回到主页确认",
|
||||||
1808: "卫戍协议动画",
|
1808: "卫戍协议动画",
|
||||||
|
1809: "卫戍协议浪费金币确认",
|
||||||
9998: "场景跳转时的等待界面",
|
9998: "场景跳转时的等待界面",
|
||||||
9999: "确认对话框",
|
9999: "确认对话框",
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ Res = Literal[
|
||||||
"double_confirm/sss_abandon_drop",
|
"double_confirm/sss_abandon_drop",
|
||||||
"double_confirm/stronghold_protocol_back",
|
"double_confirm/stronghold_protocol_back",
|
||||||
"double_confirm/stronghold_protocol_giveup",
|
"double_confirm/stronghold_protocol_giveup",
|
||||||
|
"double_confirm/stronghold_protocol_waste",
|
||||||
"double_confirm/voice",
|
"double_confirm/voice",
|
||||||
"drone",
|
"drone",
|
||||||
"episode",
|
"episode",
|
||||||
|
@ -520,6 +521,9 @@ Res = Literal[
|
||||||
"stronghold_protocol/entry.jpg",
|
"stronghold_protocol/entry.jpg",
|
||||||
"stronghold_protocol/main",
|
"stronghold_protocol/main",
|
||||||
"stronghold_protocol/medic",
|
"stronghold_protocol/medic",
|
||||||
|
"stronghold_protocol/money0",
|
||||||
|
"stronghold_protocol/money2",
|
||||||
|
"stronghold_protocol/round1",
|
||||||
"stronghold_protocol/start",
|
"stronghold_protocol/start",
|
||||||
"stronghold_protocol/stop",
|
"stronghold_protocol/stop",
|
||||||
"switch_order/check",
|
"switch_order/check",
|
||||||
|
|
16
sp.py
16
sp.py
|
@ -1,16 +0,0 @@
|
||||||
if __name__ == "__main__":
|
|
||||||
from mower.utils import path
|
|
||||||
|
|
||||||
path.global_space = "/home/zhao/Documents/profile"
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from mower.utils.log import dhlr
|
|
||||||
|
|
||||||
dhlr.setLevel(logging.INFO)
|
|
||||||
|
|
||||||
from mower.solvers.stronghold_protocol import StrongholdProtocol
|
|
||||||
|
|
||||||
solver = StrongholdProtocol()
|
|
||||||
solver.solver_update_before_transition = True
|
|
||||||
solver.run()
|
|
4
ui/dist/assets/Settings.js
vendored
4
ui/dist/assets/Settings.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>使用说明:选择核心协议并结束之前的对局</div>
|
<div>
|
||||||
<div>刷分原理:第一回合成功击杀所有敌人得10分,每次一分钟出头,大半天就能刷满</div>
|
使用说明:开始前需手动选择<b>核心协议(推荐)</b>或原型协议(刷分效率减半)、放弃已有的模拟
|
||||||
|
</div>
|
||||||
|
<div>刷分原理:第一回合击杀所有敌人得10分,每轮一分钟出头,大半天就能刷满</div>
|
||||||
<div>卫戍协议动画时间较长,建议“Mower设置-等待时间-未知-超时时长”不低于10秒</div>
|
<div>卫戍协议动画时间较长,建议“Mower设置-等待时间-未知-超时时长”不低于10秒</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue