diff --git a/resource/tasks.json b/resource/tasks.json index 05d2e97eca..068705a331 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -2933,6 +2933,7 @@ "StartButton1" ], "exceededNext": [ + "ExpiringMedicineCheck", "CloseStonePage" ], "next": [ @@ -2966,6 +2967,51 @@ "postDelay": 355000, "postDelay_Doc": "大于多少毫秒才碎石,否则等待,单位毫秒" }, + "ExpiringMedicineCheck": { + "action": "DoNothing", + "algorithm": "OcrDetect", + "text": [ + "小时", + "1天" + ], + "ocrReplace": [ + [ + ".+小时", + "小时" + ] + ], + "roi": [ + 675, + 345, + 125, + 30 + ], + "fullMatch": true, + "next": [ + "ExpiringMedicineConfirm" + ] + }, + "ExpiringMedicineConfirm": { + "action": "ClickSelf", + "template": "MedicineConfirm.png", + "roi": [ + 1000, + 500, + 200, + 150 + ], + "reduceOtherTimes": [ + "StartButton1" + ], + "maxTimes": 0, + "exceededNext": [ + "CloseStonePage" + ], + "next": [ + "StartButton1", + "OfflineConfirm" + ] + }, "StoneConfirm": { "template": "MedicineConfirm.png", "action": "ClickSelf", diff --git a/src/MaaCore/Task/Interface/FightTask.cpp b/src/MaaCore/Task/Interface/FightTask.cpp index 4a58e2edad..aefcfa4f8f 100644 --- a/src/MaaCore/Task/Interface/FightTask.cpp +++ b/src/MaaCore/Task/Interface/FightTask.cpp @@ -57,6 +57,7 @@ bool asst::FightTask::set_params(const json::value& params) { const std::string stage = params.get("stage", ""); const int medicine = params.get("medicine", 0); + const int expiring_medicine = params.get("expiring_medicine", 0); const int stone = params.get("stone", 0); const int times = params.get("times", INT_MAX); bool enable_penguid = params.get("report_to_penguin", false); @@ -90,6 +91,7 @@ bool asst::FightTask::set_params(const json::value& params) } m_fight_task_ptr->set_times_limit("MedicineConfirm", medicine) + .set_times_limit("ExpiringMedicineConfirm", expiring_medicine) .set_times_limit("StoneConfirm", stone) .set_times_limit("StartButton1", times) .set_times_limit("StartButton2", times);