Skip to content

Commit 9dc75c2

Browse files
committed
2 parents b08f916 + a847c77 commit 9dc75c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+968
-210
lines changed

.github/workflows/install.yml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ jobs:
197197
with:
198198
python-version: '3.12'
199199

200-
201200
- name: Install
202201
shell: bash
203202
run: |
@@ -233,9 +232,53 @@ jobs:
233232
name: MPA-macos-${{ matrix.arch }}-MFW-PyQt
234233
path: "MFW"
235234

235+
mirrorchyan_res:
236+
needs: meta
237+
runs-on: macos-latest
238+
strategy:
239+
fail-fast: false
240+
steps:
241+
- uses: actions/checkout@v4
242+
with:
243+
submodules: true
244+
245+
- name: Download MaaFramework
246+
uses: robinraju/release-downloader@v1
247+
with:
248+
repository: MaaXYZ/MaaFramework
249+
fileName: "MAA-macos-aarch64*"
250+
latest: true
251+
out-file-path: "deps"
252+
extract: true
253+
254+
- name: Set up Python
255+
uses: actions/setup-python@v4
256+
with:
257+
python-version: '3.12'
258+
259+
- name: Install
260+
shell: bash
261+
run: |
262+
pip install pyinstaller
263+
pip install -r requirements.txt
264+
python ./install.py ${{ needs.meta.outputs.tag }}
265+
266+
- name: MirrorChyan Package
267+
id: zip
268+
run: |
269+
rm -rf install/resource/base/model/ocr
270+
271+
mkdir MirrorChyan
272+
zip -r MirrorChyan/${{ github.event.repository.name }}.zip install/resource install/custom install/interface.json
273+
274+
- uses: actions/upload-artifact@v4
275+
with:
276+
name: MirrorChyanRes
277+
path: MirrorChyan
278+
236279
release:
237280
if: ${{ needs.meta.outputs.is_release == 'true' }}
238-
needs: [meta, windows, ubuntu, macos,changelog]
281+
needs: [meta, windows, ubuntu, macos, changelog, mirrorchyan_res]
239282
runs-on: ubuntu-latest
240283
permissions:
241284
contents: write
@@ -244,6 +287,14 @@ jobs:
244287
with:
245288
path: assets
246289

290+
- name: Upload to MirrorChyan
291+
run: |
292+
curl --location --request POST 'https://mirrorc.top/api/resources/${{ github.event.repository.name }}/versions' \
293+
--header 'Authorization:${{ secrets.MirrorChyanUploadToken }}' \
294+
--form 'name="${{ needs.meta.outputs.tag }}"' \
295+
--form 'file=@"assets/MirrorChyanRes/${{ github.event.repository.name }}.zip"'
296+
rm -rf assets/MirrorChyanRes
297+
247298
- run: |
248299
cd assets
249300
for f in *; do
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from maa.context import Context
2+
from maa.custom_action import CustomAction
3+
4+
5+
class CenterCamera(CustomAction):
6+
def run(
7+
self, context: Context, argv: CustomAction.RunArg
8+
) -> CustomAction.RunResult:
9+
image=context.tasker.controller.post_screencap().wait().get()
10+
origin_pos=context.run_recognition("回到boss界面_操作",image)
11+
x, y = (
12+
origin_pos.best_result.box[0],
13+
origin_pos.best_result.box[1],
14+
)
15+
context.tasker.controller.post_swipe(x, y, 1052, 342, 2000).wait()
16+
17+
return CustomAction.RunResult(success=True)

assets/custom/action/CrimsonWeave/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ def run(
2525

2626
else:
2727
if context.run_recognition("检查u2_囚影", image): # 检查是否有u2
28-
while context.run_recognition("检查u2_囚影", image):
29-
image = context.tasker.controller.post_screencap().wait().get() # 宿命的囚笼由我斩断
28+
start_time = time.time()
29+
while time.time() - start_time < 2:
3030
print("u2")
31-
context.tasker.controller.post_click(910, 631).wait()
31+
time.sleep(0.1)
32+
context.tasker.controller.post_click(910, 631).wait() # 宿命的囚笼由我斩断
3233
elif context.run_recognition("检查无光值_囚影", image): # 检查无光值大于474
3334
print("无光值大于474")
3435
context.tasker.controller.post_swipe(1055, 629, 1055, 629, 2000).wait() # 生死只在一瞬

assets/custom/action/Identify/main.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
from maa.context import Context
2+
from maa.custom_action import CustomAction
3+
4+
5+
class Identify(CustomAction):
6+
def run(
7+
self, context: Context, argv: CustomAction.RunArg
8+
) -> CustomAction.RunResult:
9+
image = context.tasker.controller.post_screencap().wait().get()
10+
if context.run_recognition("检查终焉", image):
11+
context.override_pipeline(
12+
{
13+
"识别人物": {"enabled": False},
14+
"战斗中": {"action": "Custom", "custom_action": "Oblivion"},
15+
}
16+
)
17+
print("终焉战斗")
18+
elif context.run_recognition("检查深痕", image):
19+
context.override_pipeline(
20+
{
21+
"识别人物": {"enabled": False},
22+
"战斗中": {"action": "Custom", "custom_action": "Stigmata"},
23+
}
24+
)
25+
print("深痕战斗")
26+
elif context.run_recognition("检查深谣", image):
27+
context.override_pipeline(
28+
{
29+
"识别人物": {"enabled": False},
30+
"战斗中": {"action": "Custom", "custom_action": "LostLullaby"},
31+
}
32+
)
33+
print("深谣战斗")
34+
elif context.run_recognition("检查深红囚影", image):
35+
context.override_pipeline(
36+
{
37+
"识别人物": {"enabled": False},
38+
"战斗中": {"action": "Custom", "custom_action": "CrimsonWeave"},
39+
}
40+
)
41+
print("深红囚影")
42+
elif context.run_recognition("检查誓焰", image):
43+
context.override_pipeline(
44+
{
45+
"识别人物": {"enabled": False},
46+
"战斗中": {"action": "Custom", "custom_action": "Pyroath"},
47+
}
48+
)
49+
print("誓焰战斗")
50+
51+
return CustomAction.RunResult(success=True)

assets/custom/action/Oblivion/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def run(
1414
context.tasker.controller.post_click(915, 626).wait() # 技能
1515
context.tasker.controller.post_click(1216, 504).wait() # 消
1616
start_time = time.time()
17-
while time.time() - start_time < 2:
17+
while time.time() - start_time < 1:
1818
time.sleep(0.1)
1919
context.tasker.controller.post_click(
2020
1197, 636

assets/custom/action/Pyroath/main.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ def run(
1515
context.tasker.controller.post_swipe(
1616
917, 631, 917, 631, 1250
1717
).wait() # 汇聚,阳炎之光
18-
image = context.tasker.controller.post_screencap().wait().get()
19-
while not context.run_recognition("战斗中", image): # 大招动画
20-
time.sleep(0.5)
21-
image = context.tasker.controller.post_screencap().wait().get()
2218

2319
context.tasker.controller.post_swipe(
2420
1197, 636, 1197, 636, 1000
@@ -44,6 +40,8 @@ def run(
4440

4541
elif context.run_recognition("检查u2_誓焰", image):
4642
print("誓焰u2")
43+
context.tasker.controller.post_click(1108, 518).wait() # 黄球
44+
context.tasker.controller.post_click(1197, 636).wait() # 攻击
4745
context.tasker.controller.post_click(914, 626).wait() # 进入u3阶段
4846
if context.run_recognition("检查p1动能条_誓焰", image):
4947
print("p2动能条max")
@@ -60,27 +58,29 @@ def run(
6058
start_time = time.time()
6159
while time.time() - start_time < 1:
6260
time.sleep(0.1)
63-
context.tasker.controller.post_click(
64-
914, 626
65-
).wait()
66-
context.tasker.controller.post_click(1197, 636).wait()
67-
# 进入u3阶段
61+
context.tasker.controller.post_click(1108, 518).wait() # 黄球
62+
context.tasker.controller.post_click(1197, 636).wait() # 攻击
63+
context.tasker.controller.post_click(914, 626).wait() # 进入u3阶段
6864

6965
else:
7066
if context.run_recognition("检查u2max_誓焰", image):
67+
print("p2动能条max")
7168
start_time = time.time()
7269
while time.time() - start_time < 1:
7370
time.sleep(0.1)
71+
context.tasker.controller.post_click(1108, 518).wait() # 黄球
72+
context.tasker.controller.post_click(1197, 636).wait() # 攻击
7473
context.tasker.controller.post_click(
7574
916, 628
7675
).wait() # 进入u3阶段
77-
context.tasker.controller.post_click(1197, 636).wait()
76+
7877
return CustomAction.RunResult(success=True)
7978
print("p2动能条非max")
8079
context.tasker.controller.post_click(1103, 514).wait()
8180
start_time = time.time()
8281
while time.time() - start_time < 2:
8382
time.sleep(0.1)
83+
context.tasker.controller.post_click(1108, 518).wait() # 黄球
8484
context.tasker.controller.post_click(1197, 636).wait()
8585

8686

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from maa.context import Context
2+
from maa.custom_action import CustomAction
3+
4+
5+
class ResetIdentify(CustomAction):
6+
def run(
7+
self, context: Context, argv: CustomAction.RunArg
8+
) -> CustomAction.RunResult:
9+
context.override_pipeline({"识别人物": {"enabled": True}})
10+
return CustomAction.RunResult(success=True)

assets/custom/action/Stigmata/main.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ def run(
2525
time.sleep(0.1)
2626

2727
image = context.tasker.controller.post_screencap().wait().get()
28-
29-
while context.run_recognition("检查u1_深痕", image):
30-
31-
print("u1")
32-
33-
context.tasker.controller.post_swipe(
34-
915, 629, 915, 629, 1250
35-
).wait() # 此刻,见证终焉之光
36-
image = context.tasker.controller.post_screencap().wait().get()
28+
if context.run_recognition("检查u1_深痕", image):
29+
start_time = time.time()
30+
while time.time() - start_time < 1:
31+
print("u1")
32+
context.tasker.controller.post_swipe(
33+
915, 629, 915, 629, 1250
34+
).wait() # 此刻,见证终焉之光
35+
image = context.tasker.controller.post_screencap().wait().get()
3736

3837
else:
3938
print("剑形态")
@@ -45,11 +44,13 @@ def run(
4544
if context.run_recognition("检查u2数值_深痕", image):
4645
print("残光值大于90")
4746
image = context.tasker.controller.post_screencap().wait().get()
48-
while context.run_recognition("检查u2_深痕", image):
49-
print("u2")
50-
context.tasker.controller.post_swipe(
51-
915, 629, 915, 629, 1500
52-
).wait() # 以此宣告,噩梦的崩解
53-
image = context.tasker.controller.post_screencap().wait().get()
47+
if context.run_recognition("检查u2_深痕", image):
48+
start_time = time.time()
49+
while time.time() - start_time < 1:
50+
print("u2")
51+
context.tasker.controller.post_swipe(
52+
915, 629, 915, 629, 1500
53+
).wait() # 以此宣告,噩梦的崩解
54+
image = context.tasker.controller.post_screencap().wait().get()
5455

5556
return CustomAction.RunResult(success=True)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from maa.context import Context
2+
from maa.custom_recognition import CustomRecognition
3+
4+
5+
class IDFMembers(CustomRecognition):
6+
7+
def analyze(
8+
self,
9+
context,
10+
argv: CustomRecognition.AnalyzeArg,
11+
) -> CustomRecognition.AnalyzeResult:
12+
image = context.tasker.controller.post_screencap().wait().get()
13+
# 检查目标数量
14+
target_score = context.run_recognition("检查目标数量", image)
15+
# 检查当前数量
16+
current_score = context.run_recognition("检查当前数量", image)
17+
if current_score is None or target_score is None:
18+
return
19+
if current_score.best_result.text.isdigit() and target_score.best_result.text.isdigit():
20+
21+
if int(current_score.best_result.text) == int(target_score.best_result.text):
22+
return CustomRecognition.AnalyzeResult(
23+
box=(0, 0, 100, 100), detail="success"
24+
)
25+
else:
26+
return
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from maa.context import Context
2+
from maa.custom_recognition import CustomRecognition
3+
4+
5+
class IDFscore(CustomRecognition):
6+
7+
def analyze(
8+
self,
9+
context,
10+
argv: CustomRecognition.AnalyzeArg,
11+
) -> CustomRecognition.AnalyzeResult:
12+
image = context.tasker.controller.post_screencap().wait().get()
13+
# 检查目标分数
14+
target_score = context.run_recognition("检查目标分数", image)
15+
# 检查当前分数
16+
current_score = context.run_recognition("检查当前分数", image)
17+
if current_score is None or target_score is None:
18+
return
19+
if current_score.best_result.text.isdigit() and target_score.best_result.text.isdigit():
20+
21+
if int(current_score.best_result.text) >= int(target_score.best_result.text):
22+
return CustomRecognition.AnalyzeResult(
23+
box=(0, 0, 100, 100), detail="success"
24+
)
25+
else:
26+
return

assets/interface.json

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "MPA",
3+
"mirrorchyan_rid": "MAA_Punish",
34
"url": "https://github.com/overflow65537/MAA_Punish",
45
"custom_title": "MFAWPF_MPA",
56
"default_controller": "adb",
@@ -91,37 +92,11 @@
9192
},
9293
{
9394
"name": "寒境曙光",
94-
"entry": "肉鸽",
95+
"entry": "寒境曙光",
9596
"option": [
9697
"选择温度",
9798
"选择效果"
98-
],
99-
"pipeline_override": {
100-
"点击宣叙妄响": {
101-
"enabled": false
102-
},
103-
"点击矩阵循生": {
104-
"enabled": false
105-
},
106-
"点击厄愿潮声": {
107-
"enabled": false
108-
},
109-
"宣叙妄响": {
110-
"enabled": false
111-
},
112-
"点击寒境曙光": {
113-
"enabled": true
114-
},
115-
"战斗中": {
116-
"next": [
117-
"检查深痕",
118-
"检查誓焰",
119-
"检查终焉",
120-
"检查深红囚影",
121-
"检查深谣"
122-
]
123-
}
124-
}
99+
]
125100
}
126101
],
127102
"option": {
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)