diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..e9f43992 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,36 @@ +name: check + +on: + push: + branches: + - "**" + paths: + - ".github/workflows/check.yml" + - "assets/**" + - "**.py" + pull_request: + branches: + - "**" + paths: + - ".github/workflows/check.yml" + - "assets/**" + - "**.py" + workflow_dispatch: + +jobs: + resource: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # pip install maafw + - name: Install maafw + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade maafw --pre + + - name: Check Resource + run: | + python ./check_resource.py ./assets/resource/base/ ./assets/resource/bilibili/ ./assets/resource/global_en/ diff --git a/README.md b/README.md index c588a028..683a5631 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,9 @@ ## 其他说明 +- 提示“应用程序错误”,一般是缺少运行库,请安装一下 [vc_redist](https://aka.ms/vs/17/release/vc_redist.x64.exe) - 添加 `-d` 参数可跳过交互直接运行任务,如 `./MaaPiCli.exe -d` +- 2.0 版本已支持 mumu 后台保活,会在 run task 时获取 mumu 最前台的 tab,并始终使用这个 tab(即使之后被切到后台了) - 反馈问题请附上日志文件 `debug/maa.log`,谢谢! ## 图形化界面 @@ -76,7 +78,11 @@ ## 开发相关 -- [MaaFramework 快速开始](https://github.com/MaaXYZ/MaaFramework/blob/main/docs/zh_cn/1.1-%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B.md) +- [MaaFW 开发思路](https://github.com/MaaXYZ/MaaFramework/blob/main/docs/zh_cn/0.1-%E5%BC%80%E5%8F%91%E6%80%9D%E8%B7%AF.md) + M9A 目前使用其中第一种方式(纯 Pipeline 低代码),后续可能会迁移到第二种方式(Pipeline + 自定义任务) +- [Pipeline 流水线协议](https://github.com/MaaXYZ/MaaFramework/blob/main/docs/zh_cn/3.1-%E4%BB%BB%E5%8A%A1%E6%B5%81%E6%B0%B4%E7%BA%BF%E5%8D%8F%E8%AE%AE.md) + +更多文档请前往 [MaaFramework](https://github.com/MaaXYZ/MaaFramework) 主仓库查看 ## 鸣谢 diff --git a/assets/interface.json b/assets/interface.json index 3d9f6110..d169f8b6 100644 --- a/assets/interface.json +++ b/assets/interface.json @@ -54,6 +54,16 @@ "吃全部临期糖" ] }, + { + "name": "活动刷取", + "entry": "ActivityEntry", + "option": [ + "活动选择", + "复现次数", + "刷完全部体力", + "吃全部临期糖" + ] + }, { "name": "领取奖励", "entry": "Awards" @@ -63,27 +73,7 @@ "entry": "Close1999" }, { - "name": "活动:77号往事 18 艰难", - "entry": "Route77", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "Route77" - }, - "TargetStageName": { - "expected": "18" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "(测试中)当期活动推图", + "name": "(不可用)当期活动推图", "entry": "Route77_StagePromotion", "option": [ "模式选择", @@ -91,7 +81,7 @@ ] }, { - "name": "(测试中)推图模式(请先手动在游戏的页面中打开需要推图的页面,如当期活动、佚事等,然后再运行此任务)", + "name": "(测试中)推图模式(主线不可用,请先手动打开需要推图的页面,如当期活动、佚事等,然后再运行此任务)", "entry": "StagePromotion_SwipeRightAndFindStage", "option": [ "体力不够自动吃糖" @@ -106,163 +96,6 @@ } } }, - { - "name": "活动:绿湖噩梦 17 艰难(已结束)", - "entry": "ANightmareAtGreenLake", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "ANightmareAtGreenLake" - }, - "TargetStageName": { - "expected": "17" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:行至摩卢旁卡 16 艰难(已结束)", - "entry": "JourneytoMorPankh", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "JourneytoMorPankh" - }, - "TargetStageName": { - "expected": "16" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:洞穴的囚徒 证明启示 05(已结束)", - "entry": "ThePrisonerintheCave", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "dummyThePrisonerintheCave" - }, - "TargetStageName": { - "expected": "dummy证明启示V" - }, - "StageDifficulty": { - "next": "dummyStageDifficulty_None" - } - } - }, - { - "name": "活动:复兴乌卢鲁运动会 13 艰难(已结束)", - "entry": "RevivalTheUluruGames", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "RevivalTheUluruGames" - }, - "TargetStageName": { - "expected": "13" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:朔日手记 19 艰难 (已结束)", - "entry": "NotesOnShuoRi", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "NotesOnShuoRi" - }, - "TargetStageName": { - "expected": "19" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:再见,来亚什基 16 艰难(已结束)", - "entry": "GoodbyeRaya", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "GoodbyeRaya" - }, - "TargetStageName": { - "expected": "16" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:飞驰,明日之城 18 艰难(已结束)", - "entry": "FloorItToTheGoldenCity", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "EnterTheShow": { - "next": "FloorItToTheGoldenCity" - }, - "TargetStageName": { - "expected": "18" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, - { - "name": "活动:复兴乌卢鲁运动会 13 艰难(复刻)", - "entry": "RevivalTheUluruGames_Reproduction", - "option": [ - "复现次数", - "刷完全部体力", - "吃全部临期糖" - ], - "pipeline_override": { - "TargetStageName": { - "expected": "13" - }, - "StageDifficulty": { - "next": "ActivityStageDifficulty" - } - } - }, { "name": "肉鸽:山麓的回音(已结束)", "entry": "EchoesinInTheMountain" @@ -290,6 +123,23 @@ } } }, + { + "name": "啮咬盒:8-7 厄险 (可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "07", + "无端指控" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "啮咬盒:5-19 厄险 (可刷可合成)", "pipeline_override": { @@ -307,6 +157,23 @@ } } }, + { + "name": "盐封曼德拉:8-17 厄险(可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "17", + "离群的黑羊" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "盐封曼德拉:3-13 厄险(可刷可合成)", "pipeline_override": { @@ -324,6 +191,23 @@ } } }, + { + "name": "双头形骨架:8-20 厄险(可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "20", + "亲爱的你" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "双头形骨架:7-7 厄险(可刷可合成)", "pipeline_override": { @@ -393,15 +277,32 @@ } }, { - "name": "百灵百验鸟:2-6 厄险(可刷可合成)", + "name": "祝圣秘银:8-10 厄险", "pipeline_override": { "EnterTheShow": { - "next": "MainChapter_2" + "next": "MainChapter_8" }, "TargetStageName": { "expected": [ - "06", - "不朽的尽头" + "10", + "白色航船" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, + { + "name": "百灵百验鸟:8-3 厄险(可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "03", + "牛头人身怪" ] }, "StageDifficulty": { @@ -426,6 +327,23 @@ } } }, + { + "name": "翼造门匙:8-15 厄险", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "15", + "北地骏鹰" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "翼造门匙:7-10 厄险", "pipeline_override": { @@ -443,6 +361,23 @@ } } }, + { + "name": "弯曲鹅颈:8-21 厄险(可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "21", + "原爆点" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "弯曲鹅颈:5-4 厄险(可刷可合成)", "pipeline_override": { @@ -460,6 +395,23 @@ } } }, + { + "name": "金草焚香:8-18 厄险(可刷可合成)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "18", + "台风眼" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "金草焚香:4-4 故事(可刷可合成)", "pipeline_override": { @@ -494,6 +446,23 @@ } } }, + { + "name": "砂金甲虫:8-11 厄险(优先合成,合不了就刷。可开箱)", + "pipeline_override": { + "EnterTheShow": { + "next": "MainChapter_8" + }, + "TargetStageName": { + "expected": [ + "11", + "圣保罗舞曲" + ] + }, + "StageDifficulty": { + "next": "StageDifficulty_Hard" + } + } + }, { "name": "砂金甲虫:6-21 厄险(优先合成,合不了就刷。可开箱)", "pipeline_override": { @@ -931,6 +900,136 @@ } } ] + }, + "活动选择": { + "cases": [ + { + "name": "活动:绿湖噩梦 17 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "ANightmareAtGreenLake" + }, + "TargetStageName": { + "expected": "17" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:行至摩卢旁卡 16 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "JourneytoMorPankh" + }, + "TargetStageName": { + "expected": "16" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:洞穴的囚徒 证明启示 05(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "dummyThePrisonerintheCave" + }, + "TargetStageName": { + "expected": "dummy证明启示V" + }, + "StageDifficulty": { + "next": "dummyStageDifficulty_None" + } + } + }, + { + "name": "活动:复兴乌卢鲁运动会 13 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "RevivalTheUluruGames" + }, + "TargetStageName": { + "expected": "13" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:朔日手记 19 艰难 (已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "NotesOnShuoRi" + }, + "TargetStageName": { + "expected": "19" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:再见,来亚什基 16 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "GoodbyeRaya" + }, + "TargetStageName": { + "expected": "16" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:飞驰,明日之城 18 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "FloorItToTheGoldenCity" + }, + "TargetStageName": { + "expected": "18" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:77号往事 18 艰难(已结束)", + "pipeline_override": { + "ActivityEntry": { + "next": "Route77" + }, + "TargetStageName": { + "expected": "18" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + }, + { + "name": "活动:复兴乌卢鲁运动会 13 艰难(复刻)", + "pipeline_override": { + "ActivityEntry": { + "next": "RevivalTheUluruGames_Reproduction" + }, + "TargetStageName": { + "expected": "13" + }, + "StageDifficulty": { + "next": "ActivityStageDifficulty" + } + } + } + ] } } } \ No newline at end of file diff --git a/assets/resource/base/image/Combat/MainChapter_8Enter.png b/assets/resource/base/image/Combat/MainChapter_8Enter.png new file mode 100644 index 00000000..e3717506 Binary files /dev/null and b/assets/resource/base/image/Combat/MainChapter_8Enter.png differ diff --git a/assets/resource/base/pipeline/activity/outsidededuction.json b/assets/resource/base/pipeline/activity/outsidededuction.json index 81d18916..a6e0160a 100644 --- a/assets/resource/base/pipeline/activity/outsidededuction.json +++ b/assets/resource/base/pipeline/activity/outsidededuction.json @@ -2084,7 +2084,6 @@ "SOD_ArcanistSellct", "SOD_ArcanistAdd_Single4", "SOD_CombatStart", - "SOD_Main", "SOD_EndEvent" ] }, @@ -2149,8 +2148,7 @@ "SOD_ItemLose_1", "SOD_Acquire", "SOD_NewArcanist", - "SOD_Nothinghappen", - "SOD_Levelup" + "SOD_Nothinghappen" ] }, "SOD_Main": { @@ -2347,8 +2345,7 @@ "SOD_ArcanistSellct", "SOD_ArcanistAdd_Single4", "SOD_CombatStart", - "SOD_EndEvent_OK", - "SOD_EndingSelecct" + "SOD_EndEvent_OK" ] } } \ No newline at end of file diff --git a/assets/resource/base/pipeline/combat.json b/assets/resource/base/pipeline/combat.json index ae398c9f..c8917df0 100644 --- a/assets/resource/base/pipeline/combat.json +++ b/assets/resource/base/pipeline/combat.json @@ -159,6 +159,25 @@ "action": "Click", "next": "SwipeLeftAndFindStage" }, + "MainChapter_8": { + "doc": "主线第八章 忧郁的热带", + "next": [ + "MainChapter_8Enter", + "Sub_SwipeLeftForChapter" + ] + }, + "MainChapter_8Enter": { + "recognition": "TemplateMatch", + "template": "Combat/MainChapter_8Enter.png", + "roi": [ + 0, + 90, + 1280, + 460 + ], + "action": "Click", + "next": "SwipeLeftAndFindStage" + }, "Sub_ResourceChapterLabel": { "is_sub": true, "recognition": "TemplateMatch", diff --git a/assets/resource/base/pipeline/combat_activity.json b/assets/resource/base/pipeline/combat_activity.json index d13d6bd4..2ed95f7d 100644 --- a/assets/resource/base/pipeline/combat_activity.json +++ b/assets/resource/base/pipeline/combat_activity.json @@ -5,6 +5,9 @@ "ActivityStageDifficultyToRight" ] }, + "ActivityEntry": { + "next": [] + }, "ActivityStageDifficulty_Hard": { "recognition": "OCR", "expected": [ diff --git a/assets/resource/global_en/shutdown.json b/assets/resource/global_en/pipeline/shutdown.json similarity index 100% rename from assets/resource/global_en/shutdown.json rename to assets/resource/global_en/pipeline/shutdown.json diff --git a/assets/resource/global_en/startup.json b/assets/resource/global_en/pipeline/startup.json similarity index 100% rename from assets/resource/global_en/startup.json rename to assets/resource/global_en/pipeline/startup.json diff --git a/check_resource.py b/check_resource.py new file mode 100644 index 00000000..229daef0 --- /dev/null +++ b/check_resource.py @@ -0,0 +1,39 @@ +import sys + +from typing import List +from pathlib import Path + +from maa.resource import Resource +from maa.tasker import Tasker, LoggingLevelEnum + + +def check(dirs: List[Path]) -> bool: + resource = Resource() + + print(f"Checking {len(dirs)} directories...") + + for dir in dirs: + print(f"Checking {dir}...") + status = resource.post_path(dir).wait().status() + if not status.succeeded(): + print(f"Failed to check {dir}.") + return False + + print("All directories checked.") + return True + + +def main(): + if len(sys.argv) < 2: + print("Usage: python configure.py ") + sys.exit(1) + + Tasker.set_stdout_level(LoggingLevelEnum.All) + + dirs = [Path(arg) for arg in sys.argv[1:]] + if not check(dirs): + sys.exit(1) + + +if __name__ == "__main__": + main()