From 3419080c36584b0eb7b5fbe09141b821b5f6da37 Mon Sep 17 00:00:00 2001 From: Windsland <86581225+Windsland52@users.noreply.github.com> Date: Tue, 18 Feb 2025 18:03:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=8D=92=E5=8E=9F=E6=94=B6?= =?UTF-8?q?=E8=8F=9C=E6=94=B9=E4=B8=BA=E8=BF=9B=E5=85=A5=E5=8F=A4=E5=8E=85?= =?UTF-8?q?=E5=90=8E=E8=BF=9B=E8=A1=8C=20(#341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/MaaXYZ/M9A/issues/273 --- assets/resource/base/pipeline/startup.json | 17 +- assets/resource/base/pipeline/wilderness.json | 149 +++++++++++------- 2 files changed, 111 insertions(+), 55 deletions(-) diff --git a/assets/resource/base/pipeline/startup.json b/assets/resource/base/pipeline/startup.json index e0964d8..2ebce74 100644 --- a/assets/resource/base/pipeline/startup.json +++ b/assets/resource/base/pipeline/startup.json @@ -255,6 +255,21 @@ ], "action": "Click" }, + "BackButtonWithDelay": { + "recognition": "TemplateMatch", + "template": [ + "StartUp/BackButton.png", + "StartUp/BackButton_White.png" + ], + "roi": [ + 0, + 0, + 134, + 138 + ], + "action": "Click", + "post_delay": 3000 + }, "Sub_BackButton": { "is_sub": true, "recognition": "TemplateMatch", @@ -404,4 +419,4 @@ "HomeFlag" ] } -} +} \ No newline at end of file diff --git a/assets/resource/base/pipeline/wilderness.json b/assets/resource/base/pipeline/wilderness.json index ef84d17..f90b09c 100644 --- a/assets/resource/base/pipeline/wilderness.json +++ b/assets/resource/base/pipeline/wilderness.json @@ -3,8 +3,7 @@ "next": [ "EnterWilderness", "EnterProduct", - "CollectEXP", - "CollectMoney", + "EnterAncientHall", "CollectAwards", "CollectTrust", "TrustDialogueNext", @@ -27,8 +26,7 @@ "next": [ "EnterWilderness", "EnterProduct", - "CollectEXP", - "CollectMoney", + "EnterAncientHall", "CollectAwards", "CollectTrust", "TrustDialogueNext", @@ -38,58 +36,51 @@ "HomeLoading" ] }, - "CollectEXP": { + "EnterAncientHall": { "recognition": "OCR", - "expected": [ - "微尘", - "钟楼" - ], + "expected": "古厅定位", "roi": [ - 422, - 65, - 218, - 236 - ], - "target_offset": [ - 0, - -30, - 0, - 0 + 1168, + 148, + 86, + 24 ], + "only_rec": true, "action": "Click", - "post_wait_freezes": 1, "next": [ - "CollectMoney", - "CollectAwards", - "CollectTrust", - "TrustDialogueNext", - "TrustDialogueInteraction", - "HomeFlag" + "AncientHallFlag" ], "interrupt": [ - "HomeButton" + "ClickAncientHall" ] }, - "CollectMoney": { + "AncientHallFlag": { "recognition": "OCR", - "expected": [ - "利齿", - "市集" - ], + "expected": "古厅", "roi": [ - 638, - 6, - 221, - 232 + 843, + 75, + 55, + 30 ], - "target_offset": [ - 0, - -30, - 0, - 0 + "only_rec": true, + "next": [ + "NoExpMoney" ], - "action": "Click", - "post_wait_freezes": 1, + "interrupt": [ + "CollectExpMoney" + ] + }, + "NoExpMoney": { + "recognition": "OCR", + "expected": "^(100|[1-9]\\d?)%$", + "roi": [ + 1015, + 162, + 65, + 312 + ], + "inverse": true, "next": [ "CollectAwards", "CollectTrust", @@ -98,9 +89,49 @@ "HomeFlag" ], "interrupt": [ - "HomeButton" + "BackButtonWithDelay" ] }, + "CollectExpMoney": { + "recognition": "OCR", + "expected": "收取", + "roi": [ + 1106, + 180, + 110, + 258 + ], + "action": "Click", + "post_wait_freezes": { + "time": 500, + "target": [ + 843, + 0, + 242, + 719 + ] + } + }, + "ClickAncientHall": { + "recognition": "OCR", + "expected": "荒原古厅", + "roi": [ + 596, + 93, + 237, + 172 + ], + "action": "Click", + "post_wait_freezes": { + "time": 300, + "target": [ + 843, + 0, + 242, + 719 + ] + } + }, "CollectAwards": { "recognition": "TemplateMatch", "template": "Wilderness/CollectAwards.png", @@ -119,6 +150,7 @@ ], "interrupt": [ "ObtainedAwards", + "BackButtonWithDelay", "HomeButton" ] }, @@ -141,6 +173,7 @@ ], "interrupt": [ "TestCritterTraining", + "BackButtonWithDelay", "HomeButton" ] }, @@ -177,6 +210,7 @@ "HomeFlag" ], "interrupt": [ + "BackButtonWithDelay", "HomeButton" ] }, @@ -196,6 +230,7 @@ "HomeFlag" ], "interrupt": [ + "BackButtonWithDelay", "HomeButton" ] }, @@ -215,6 +250,7 @@ "HomeFlag" ], "interrupt": [ + "BackButtonWithDelay", "HomeButton" ] }, @@ -237,7 +273,15 @@ 0 ], "action": "Click", - "post_wait_freezes": 100, + "post_wait_freezes": { + "time": 300, + "target": [ + 0, + 508, + 622, + 212 + ] + }, "next": [ "CollectProduct", "AutoAssignCritters", @@ -327,15 +371,14 @@ "next": [ "AutoAssignCritters", "AutoSelectComfirm", - "CollectEXP", - "CollectMoney", + "EnterAncientHall", "CollectAwards", "CollectTrust", "TrustDialogueNext", "TrustDialogueInteraction" ], "interrupt": [ - "BackButton" + "BackButtonWithDelay" ] }, "AutoAssignCritters": { @@ -379,15 +422,14 @@ 8 ], "next": [ - "CollectEXP", - "CollectMoney", + "EnterAncientHall", "CollectAwards", "CollectTrust", "TrustDialogueNext", "TrustDialogueInteraction" ], "interrupt": [ - "BackButton" + "BackButtonWithDelay" ] }, "SummonlngSuccess": { @@ -422,15 +464,14 @@ ], "action": "Click", "next": [ - "CollectEXP", - "CollectMoney", + "EnterAncientHall", "CollectAwards", "CollectTrust", "TrustDialogueNext", "TrustDialogueInteraction" ], "interrupt": [ - "BackButton" + "BackButtonWithDelay" ] }, "interrupt_SummonlngSuccessBack": {