diff --git a/assets/resource/image/Combat/UniversalMirage/UniversalMirageCostingTimeSwirlPasses.png b/assets/resource/image/Combat/UniversalMirage/UniversalMirageCostingTimeSwirlPasses.png new file mode 100644 index 0000000..89abb31 Binary files /dev/null and b/assets/resource/image/Combat/UniversalMirage/UniversalMirageCostingTimeSwirlPasses.png differ diff --git a/assets/resource/pipeline/combat/universal_mirage.json b/assets/resource/pipeline/combat/universal_mirage.json index 68bf581..e000d94 100644 --- a/assets/resource/pipeline/combat/universal_mirage.json +++ b/assets/resource/pipeline/combat/universal_mirage.json @@ -69,21 +69,36 @@ "is_sub": true, "action": "Swipe", "begin": [ - 305, 87, 200, 45 + 400, + 100, + 80, + 50 + ], "end": [ - 305, 613, 200, 45 - ] + 400, + 600, + 80, + 50 + ], + "duration": 500 }, "Sub_UniversalMirageStageSwipeBottom": { "is_sub": true, "action": "Swipe", "begin": [ - 305, 613, 200, 45 + 400, + 600, + 80, + 50 ], "end": [ - 305, 87, 200, 45 - ] + 400, + 100, + 80, + 50 + ], + "duration": 500 }, "SelectUniversalMirageStageF2": { "recognition": "OCR", @@ -125,8 +140,9 @@ 139 ], "next": [ + "UniversalMirageNoneInviteOfMirage", "UniversalMirageStageNoneValkyrja", - "Sub_UniversalMirageStageStart", + "UniversalMirageStageF2Start", "Sub_UniversalMirageStagePrepare", "Sub_UniversalMirageStageFightAlone" ] @@ -141,8 +157,9 @@ 139 ], "next": [ + "UniversalMirageNoneInviteOfMirage", "UniversalMirageStageNoneValkyrja", - "Sub_UniversalMirageStageStart", + "UniversalMirageStageF5Start", "Sub_UniversalMirageStagePrepare", "Sub_UniversalMirageStageFightAlone" ] @@ -171,8 +188,7 @@ ], "action": "Click" }, - "Sub_UniversalMirageStageStart": { - "is_sub": true, + "UniversalMirageStageF2Start": { "recognition": "TemplateMatch", "template": "Combat/UniversalMirage/UniversalMirageStageStart.png", "roi": [ @@ -181,7 +197,33 @@ 190, 131 ], - "action": "Click" + "next": [ + "UniversalMirageCombatGeneric" + ] + }, + "UniversalMirageStageF5Start": { + "recognition": "TemplateMatch", + "template": "Combat/UniversalMirage/UniversalMirageStageStart.png", + "roi": [ + 1025, + 589, + 190, + 131 + ], + "next": [ + "Stop" + ] + }, + "UniversalMirageNoneInviteOfMirage": { + "recognition": "OCR", + "text": "虚境挑战书不足", + "roi": [ + 362, + 287, + 557, + 140 + ], + "next": "Stop" }, "UniversalMirageStageNoneValkyrja": { "recognition": "TemplateMatch", @@ -193,5 +235,37 @@ 132 ], "next": "Stop" + }, + "UniversalMirageCombatFinish": { + "recognition": "OCR", + "text": "战斗耗时", + "roi": [ + 738, + 360, + 220, + 140 + ], + "action": "Click", + "post_delay": 1000, + "next": [ + "UniversalMirageCostingTimeSwirlPasses", + "UniversalMirageCombatFinish" + ] + }, + "UniversalMirageCostingTimeSwirlPasses": { + "recognition": "TemplateMatch", + "template": "Combat/UniversalMirage/UniversalMirageCostingTimeSwirlPasses.png", + "roi": [ + 714, + 552, + 147, + 141 + ], + "action": "Click", + "next": [ + "UniversalMirageCostingTimeSwirlPasses", + "Sub_CloseDialogBox", + "Stop" + ] } } \ No newline at end of file diff --git a/assets/resource/pipeline/combat/universal_mirage_combat_generic.json b/assets/resource/pipeline/combat/universal_mirage_combat_generic.json new file mode 100644 index 0000000..c5eed88 --- /dev/null +++ b/assets/resource/pipeline/combat/universal_mirage_combat_generic.json @@ -0,0 +1,732 @@ +{ + "$schema": "../../pipeline.schema.json", + "UniversalMirageCombatGeneric": { + "recognition": "TemplateMatch", + "template": "Combat/UniversalMirage/UniversalMirageStageStart.png", + "roi": [ + 1025, + 589, + 190, + 131 + ], + "next": [ + "UniversalMirageCombatGenericStart" + ] + }, + "UniversalMirageCombatGenericStart": { + "recognition": "TemplateMatch", + "template": "Combat/UniversalMirage/UniversalMirageStageStart.png", + "roi": [ + 1025, + 589, + 190, + 131 + ], + "action": "Click", + "next": [ + "UniversalMirageCombatGenericPreheat" + ] + }, + "UniversalMirageCombatGenericPreheat": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 500, + "post_delay": 1500, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_001" + ] + }, + "UniversalMirageCombatGeneric_001": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Backward", + "pre_delay": 0, + "post_delay": 50, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_002" + ] + }, + "UniversalMirageCombatGeneric_002": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Forward", + "pre_delay": 0, + "post_delay": 50, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_003" + ] + }, + "UniversalMirageCombatGeneric_003": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Left", + "pre_delay": 0, + "post_delay": 50, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_004" + ] + }, + "UniversalMirageCombatGeneric_004": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Right", + "pre_delay": 0, + "post_delay": 50, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_005" + ] + }, + "UniversalMirageCombatGeneric_005": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Evade", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_006" + ] + }, + "UniversalMirageCombatGeneric_006": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_007" + ] + }, + "UniversalMirageCombatGeneric_007": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_008" + ] + }, + "UniversalMirageCombatGeneric_008": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_009" + ] + }, + "UniversalMirageCombatGeneric_009": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_010" + ] + }, + "UniversalMirageCombatGeneric_010": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_011" + ] + }, + "UniversalMirageCombatGeneric_011": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATKCharge", + "pre_delay": 0, + "post_delay": 100, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_012" + ] + }, + "UniversalMirageCombatGeneric_012": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Evade", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_013" + ] + }, + "UniversalMirageCombatGeneric_013": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_014" + ] + }, + "UniversalMirageCombatGeneric_014": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "WeaponSkill", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_015" + ] + }, + "UniversalMirageCombatGeneric_015": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_016" + ] + }, + "UniversalMirageCombatGeneric_016": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_017" + ] + }, + "UniversalMirageCombatGeneric_017": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_018" + ] + }, + "UniversalMirageCombatGeneric_018": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_019" + ] + }, + "UniversalMirageCombatGeneric_019": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_020" + ] + }, + "UniversalMirageCombatGeneric_020": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATKCharge", + "pre_delay": 0, + "post_delay": 100, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_021" + ] + }, + "UniversalMirageCombatGeneric_021": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_022" + ] + }, + "UniversalMirageCombatGeneric_022": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Ultimate", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_023" + ] + }, + "UniversalMirageCombatGeneric_023": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_024" + ] + }, + "UniversalMirageCombatGeneric_024": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "ExtraSkill", + "pre_delay": 0, + "post_delay": 100, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_025" + ] + }, + "UniversalMirageCombatGeneric_025": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_026" + ] + }, + "UniversalMirageCombatGeneric_026": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Evade", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_027" + ] + }, + "UniversalMirageCombatGeneric_027": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_028" + ] + }, + "UniversalMirageCombatGeneric_028": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "ELFSkill", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_029" + ] + }, + "UniversalMirageCombatGeneric_029": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_030" + ] + }, + "UniversalMirageCombatGeneric_030": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "UltimateCharge", + "pre_delay": 0, + "post_delay": 100, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_031" + ] + }, + "UniversalMirageCombatGeneric_031": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_032" + ] + }, + "UniversalMirageCombatGeneric_032": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_033" + ] + }, + "UniversalMirageCombatGeneric_033": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_034" + ] + }, + "UniversalMirageCombatGeneric_034": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_035" + ] + }, + "UniversalMirageCombatGeneric_035": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_036" + ] + }, + "UniversalMirageCombatGeneric_036": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATKCharge", + "pre_delay": 0, + "post_delay": 100, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_037" + ] + }, + "UniversalMirageCombatGeneric_037": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "Evade", + "pre_delay": 0, + "post_delay": 150, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_038" + ] + }, + "UniversalMirageCombatGeneric_038": { + "recognition": "TemplateMatch", + "template": "Combat/StopCombat.png", + "roi": [ + 0, + 0, + 136, + 140 + ], + "action": "Custom", + "custom_action": "BasicATK", + "pre_delay": 0, + "post_delay": 200, + "next": [ + "UniversalMirageCombatFinish", + "UniversalMirageCombatGeneric_003" + ] + } +} \ No newline at end of file diff --git a/source/cli/main.cpp b/source/cli/main.cpp index 18fc207..08932f7 100644 --- a/source/cli/main.cpp +++ b/source/cli/main.cpp @@ -229,6 +229,35 @@ MaaSize get_device_index(const MaaSize& device_size) } json::value dorm_param() +{ + json::value param; + auto& diff = param["diff_task"]; + auto& glacial_fences_doc = diff["Sub_EnterGlacialFencesPage"]["doc"]; + auto& glacial_fences_enabled = diff["Sub_EnterGlacialFencesPage"]["enabled"]; + auto& illuminated_land_doc = diff["Sub_EnterIlluminatedLandPage"]["doc"]; + auto& illuminated_land_enabled = diff["Sub_EnterIlluminatedLandPage"]["enabled"]; + auto& roaring_palace_doc = diff["Sub_EnterRoaringPalacePage"]["doc"]; + auto& roaring_palace_enabled = diff["Sub_EnterRoaringPalacePage"]["enabled"]; + auto& blade_grave_doc = diff["Sub_EnterBladeGravePage"]["doc"]; + auto& blade_grave_enabled = diff["Sub_EnterBladeGravePage"]["enabled"]; + auto& stage_f2_doc = diff["UniversalMirageStageF2"]["doc"]; + auto& stage_f2_enabled = diff["UniversalMirageStageF2"]["enabled"]; + + glacial_fences_doc = "幽寒之槛"; + glacial_fences_enabled = true; + illuminated_land_doc = "煌然之地"; + illuminated_land_enabled = false; + roaring_palace_doc = "轰鸣之殿"; + roaring_palace_enabled = false; + blade_grave_doc = "千刃之冢"; + blade_grave_enabled = false; + stage_f2_doc = "第二层"; + stage_f2_enabled = true; + + return param; +} + +json::value universal_mirage_param() { json::value param; auto& diff = param["diff_task"]; @@ -327,6 +356,7 @@ bool proc_argv(int argc, char** argv, bool& debug, std::string& adb, std::string " 3. Armada\n" " 4. Shop\n" " 5. Awards\n" + " 6. UniversalMirage" << std::endl << "Please enter the task numbers to be executed: " << std::endl; @@ -361,6 +391,10 @@ bool proc_argv(int argc, char** argv, bool& debug, std::string& adb, std::string case 5: task_obj.type = "Awards"; break; + case 6: + task_obj.type = "UniversalMirage"; + task_obj.param = universal_mirage_param(); + break; default: std::cout << "Unknown task: " << id << std::endl; @@ -419,7 +453,7 @@ void save_config(const std::string& adb, const std::string& adb_address, const i } config["tasks"] = std::move(tasks_array); - config["tasks_Doc"] = "要执行的任务 Homeland, MaterialEvent, Armada, Shop, Awards"; + config["tasks_Doc"] = "要执行的任务 Homeland, MaterialEvent, Armada, Shop, Awards, UniversalMirage"; json::value after_task; after_task["enabled"] = false; diff --git a/source/cli/main.h b/source/cli/main.h index 7bf0a22..2586236 100644 --- a/source/cli/main.h +++ b/source/cli/main.h @@ -36,6 +36,8 @@ MaaSize scanning_devices(); json::value dorm_param(); +json::value universal_mirage_param(); + json::value end_to_do_param(); bool proc_argv(int argc, char** argv, bool& debug, std::string& adb, std::string& adb_address, int& client_type,