Skip to content

Commit e86e23e

Browse files
authored
feat(WitchDivination): 魔女之家初版 (#268)
* feat(WitchDivination): 魔女之家初版 * fix(WitchDivination): 不用占卜的时候直接退出 * fix: 修复一些等待逻辑 * feat: 优化点击占卜逻辑,优化流程,日志调整 * feat(WitchDivination): 部分调整,延时相关,补充注释 * feat(WitchDivination): 修复占卜不会结束的问题 * feat(WitchDivination): 调整点击前往魔女之家按钮鬼畜问题 * feat(WitchDivination): 调整点击延迟
1 parent fecd04d commit e86e23e

12 files changed

Lines changed: 746 additions & 0 deletions

File tree

assets/interface.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
// group:others
120120
"resource/tasks/FountainCheckin.json",
121121
"resource/tasks/AutoPiano.json",
122+
"resource/tasks/WitchDivination.json",
122123
// group:DatasetCollection
123124
"resource/tasks/AutonomousDrivingDataset.json",
124125
// group:others
529 Bytes
Loading
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
// 自动魔女之家占卜 - 小碎步
3+
// 用于从传送点直走到魔女之家
4+
"ShuffleStepCheck": {
5+
"desc": "检测「黑羽」文本,存在则结束小碎步",
6+
"recognition": {
7+
"type": "OCR",
8+
"param": {
9+
"roi": [
10+
672,
11+
235,
12+
410,
13+
259
14+
],
15+
"expected": [
16+
"黑羽"
17+
]
18+
}
19+
},
20+
"action": {
21+
"type": "ClickKey",
22+
"param": {
23+
"key": 70 // 'F' 键与魔女交互
24+
}
25+
},
26+
"next": [
27+
"ShuffleStepTalkToWitch"
28+
],
29+
"on_error": [
30+
"ShuffleStepWalk"
31+
]
32+
},
33+
"ShuffleStepWalk": {
34+
"desc": "按住W键向前走0.4秒",
35+
"action": {
36+
"type": "KeyDown",
37+
"param": {
38+
"key": 87
39+
}
40+
},
41+
"post_delay": 400,
42+
"next": [
43+
"ShuffleStepPause"
44+
]
45+
},
46+
"ShuffleStepPause": {
47+
"desc": "松开W键停顿1.4秒",
48+
"action": {
49+
"type": "KeyUp",
50+
"param": {
51+
"key": 87
52+
}
53+
},
54+
"post_delay": 1500,
55+
"next": [
56+
"ShuffleStepCheck",
57+
"ShuffleStepCheck2",
58+
"ShuffleStepWalk"
59+
]
60+
},
61+
"ShuffleStepCheck2": {
62+
"desc": "检测「轻叩」文本,存在则结束任务",
63+
"recognition": {
64+
"type": "OCR",
65+
"param": {
66+
"roi": [
67+
672,
68+
235,
69+
410,
70+
259
71+
],
72+
"expected": [
73+
"轻叩"
74+
]
75+
}
76+
},
77+
"action": {
78+
"type": "ClickKey",
79+
"param": {
80+
"key": 70 // 'F' 键与门交互
81+
}
82+
},
83+
"next": []
84+
}
85+
}
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
{
2+
// 自动魔女之家占卜
3+
// WitchDivination
4+
// 1. 回到大世界, 点击地图
5+
// 2. 点击地图中左下角任务图标,在右侧新弹出的窗口找到魔女之家提示 (找不到则代表已经占卜 结束任务)
6+
// 3. 点击后定位到魔女之家, 点击传送
7+
// 4. 从传送点开始,使用小碎步走进魔女之家
8+
// 5. 和黑羽对话选择 [卜运]
9+
// 6. 依次选择每一个占卜,直至全部没有使用次数后结束任务
10+
"WitchDivinationEntrance": {
11+
"desc": "魔女之家占卜入口",
12+
"action": "DoNothing",
13+
"next": [
14+
"WitchDivinationStart",
15+
"[JumpBack]SceneAnyEnterWorld"
16+
]
17+
},
18+
"WitchDivinationStart": {
19+
"desc": "女巫占卜主流程 — 在大世界按下M进入地图",
20+
"max_hit": 5, // 超过这个数就算失败了
21+
"recognition": "And",
22+
"all_of": [
23+
"InWorld"
24+
],
25+
"action": {
26+
"type": "ClickKey", // 'M' 键打开地图
27+
"param": {
28+
"key": [
29+
77
30+
]
31+
}
32+
},
33+
"post_wait_freezes": 500, // 全屏等待地图界面稳定
34+
"next": [
35+
"WitchDivinationFindMapTask"
36+
]
37+
},
38+
"WitchDivinationFindMapTask": {
39+
"desc": "在地图页面模板匹配任务图标并点击",
40+
"recognition": {
41+
"type": "TemplateMatch",
42+
"param": {
43+
"template": "WitchDivination/MapTask.png",
44+
"roi": [
45+
140,
46+
637,
47+
56,
48+
54
49+
]
50+
}
51+
},
52+
"action": {
53+
"type": "Click"
54+
},
55+
"post_wait_freezes": { // 等待右侧面板稳定
56+
"time": 500,
57+
"target": [
58+
884,
59+
46,
60+
390,
61+
623
62+
]
63+
},
64+
"next": [
65+
"WitchDivinationCheckTodayGuide",
66+
"WitchDivinationFindMapTask",
67+
"WitchDivinationActionEnd"
68+
],
69+
"on_error": [
70+
"WitchDivinationEntrance"
71+
]
72+
},
73+
"WitchDivinationCheckTodayGuide": {
74+
"desc": "检测是否存在「今日指引」字样",
75+
"recognition": {
76+
"type": "OCR",
77+
"param": {
78+
"roi": [
79+
915,
80+
78,
81+
105,
82+
35
83+
],
84+
"expected": [
85+
"今日指引"
86+
]
87+
}
88+
},
89+
"action": "DoNothing",
90+
"next": [
91+
"WitchDivinationMoveToWitchHouse",
92+
"WitchDivinationPressEscTwice"
93+
],
94+
"on_error": [
95+
"WitchDivinationEntrance"
96+
]
97+
},
98+
"WitchDivinationMoveToWitchHouse": {
99+
"desc": "鼠标移动到 OCR 匹配到的「魔女之家」坐标位置",
100+
"recognition": {
101+
"type": "OCR",
102+
"param": {
103+
"roi": [
104+
893,
105+
120,
106+
367,
107+
533
108+
],
109+
"expected": [
110+
"魔女之家"
111+
]
112+
}
113+
},
114+
"action": {
115+
"type": "TouchMove",
116+
"param": {
117+
"target": true // 先移动鼠标到匹配位置,避免直接点击触发滑动
118+
}
119+
},
120+
"post_delay": 500,
121+
"next": [
122+
"WitchDivinationClickWitchHouse"
123+
],
124+
"on_error": [
125+
"WitchDivinationActionEnd"
126+
]
127+
},
128+
"WitchDivinationClickWitchHouse": {
129+
"desc": "在「魔女之家」位置执行点击",
130+
"action": {
131+
"type": "TouchDown",
132+
"param": {
133+
"target": "WitchDivinationMoveToWitchHouse" // 鼠标已在目标位置,直接点击
134+
}
135+
},
136+
"post_wait_freezes": 50, // 点击后等待全屏稳定
137+
"next": [
138+
"WitchDivinationClickWitchHouse2",
139+
"WitchDivinationCheckTodayGuide"
140+
]
141+
},
142+
"WitchDivinationClickWitchHouse2": {
143+
"desc": "在「魔女之家」位置执行点击",
144+
"action": {
145+
"type": "TouchUp",
146+
"param": {
147+
"target": "WitchDivinationMoveToWitchHouse" // 鼠标已在目标位置,直接点击
148+
}
149+
},
150+
"post_wait_freezes": 50, // 点击后等待全屏稳定
151+
"next": [
152+
"WitchDivinationVerifyWitchHouse",
153+
"WitchDivinationEntrance"
154+
]
155+
},
156+
"WitchDivinationVerifyWitchHouse": {
157+
"desc": "验证是否出现「魔女之家」标题文本",
158+
"recognition": {
159+
"type": "OCR",
160+
"param": {
161+
"roi": [
162+
925,
163+
36,
164+
254,
165+
106
166+
],
167+
"expected": [
168+
"魔女之家"
169+
]
170+
}
171+
},
172+
"action": "DoNothing",
173+
"next": [
174+
"WitchDivinationTeleportToWitchHouse"
175+
],
176+
"on_error": [
177+
"WitchDivinationEntrance"
178+
]
179+
},
180+
"WitchDivinationTeleportToWitchHouse": {
181+
"desc": "匹配「传送」文本并点击执行传送",
182+
"recognition": {
183+
"type": "OCR",
184+
"param": {
185+
"roi": [
186+
917,
187+
614,
188+
363,
189+
52
190+
],
191+
"expected": [
192+
"传送"
193+
]
194+
}
195+
},
196+
"action": {
197+
"type": "Click",
198+
"param": {
199+
"target": true
200+
}
201+
},
202+
"timeout": 1000,
203+
"next": [
204+
"[JumpBack]SceneLoadingType1",
205+
"ShuffleStepWalk"
206+
],
207+
"on_error": [
208+
"WitchDivinationEntrance"
209+
]
210+
},
211+
"WitchDivinationPressEscTwice": {
212+
"desc": "按两次 ESC 后结束任务",
213+
"action": {
214+
"type": "ClickKey",
215+
"param": {
216+
"key": [
217+
27
218+
]
219+
}
220+
},
221+
"post_delay": 500,
222+
"next": [
223+
"WitchDivinationActionEnd"
224+
]
225+
},
226+
"WitchDivinationActionEnd": {
227+
"desc": "占卜流程结束 — 等待画面静止后按ESC退出",
228+
"pre_wait_freezes": 2000,
229+
"action": {
230+
"type": "ClickKey",
231+
"param": {
232+
"key": [
233+
27
234+
]
235+
}
236+
}
237+
}
238+
}

0 commit comments

Comments
 (0)