diff --git a/resource/tasks.json b/resource/tasks.json index a4acd451e1..4c3258e427 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -2663,7 +2663,6 @@ "rearDelay": 5000 }, "EndOfClueExchange": { - "template": "EndOfClueExchange.png", "cache": false, "roi": [ 0, @@ -2671,6 +2670,216 @@ 400, 200 ], + "next": [ + "EndOfClueExchangeClose" + ] + }, + "EndOfClueExchangeClose": { + "template": "Return.png", + "action": "clickSelf", + "roi": [ + 0, + 0, + 180, + 80 + ], "rearDelay": 3000 + }, + "SendClues": { + "action": "clickSelf", + "roi": [ + 1157, + 346, + 84, + 81 + ], + "maskRange": [ + 1, + 255 + ], + "rearDelay": 1000, + "next": [ + "SelectClue", + "CloseSendClue" + ] + }, + "SelectClue": { + "action": "clickSelf", + "roi": [ + 2, + 133, + 418, + 196 + ], + "maskRange": [ + 1, + 255 + ], + "maxTimes": 3, + "exceededNext": [ + "CloseSendClue" + ], + "next": [ + "ClueGiveTo1st", + "ClueGiveTo2nd", + "ClueGiveTo3rd", + "ClueGiveTo4th", + "ClueGiveToNextPage", + "ClueGiveTo1stConfirm" + ] + }, + "ClueGiveTo1st": { + "template": "ClusCanBeSent.png", + "action": "doNothing", + "maskRange": [ + 1, + 255 + ], + "roi": [ + 830, + 70, + 320, + 100 + ], + "next": [ + "ClueGiveTo1stConfirm" + ] + }, + "ClueGiveTo1stConfirm": { + "template": "SendClueConfirm.png", + "action": "clickSelf", + "roi": [ + 1150, + 50, + 100, + 160 + ], + "next": [ + "SelectClue", + "CloseSendClue" + ] + }, + "ClueGiveTo2nd": { + "template": "ClusCanBeSent.png", + "action": "doNothing", + "maskRange": [ + 1, + 255 + ], + "roi": [ + 830, + 220, + 320, + 100 + ], + "next": [ + "ClueGiveTo2ndConfirm" + ] + }, + "ClueGiveTo2ndConfirm": { + "template": "SendClueConfirm.png", + "action": "clickSelf", + "roi": [ + 1150, + 200, + 100, + 160 + ], + "next": [ + "SelectClue", + "CloseSendClue" + ] + }, + "ClueGiveTo3rd": { + "template": "ClusCanBeSent.png", + "action": "doNothing", + "maskRange": [ + 1, + 255 + ], + "roi": [ + 830, + 370, + 320, + 100 + ], + "next": [ + "ClueGiveTo3rdConfirm" + ] + }, + "ClueGiveTo3rdConfirm": { + "template": "SendClueConfirm.png", + "action": "clickSelf", + "roi": [ + 1150, + 350, + 100, + 160 + ], + "next": [ + "SelectClue", + "CloseSendClue" + ] + }, + "ClueGiveTo4th": { + "template": "ClusCanBeSent.png", + "action": "doNothing", + "maskRange": [ + 1, + 255 + ], + "roi": [ + 830, + 520, + 320, + 100 + ], + "next": [ + "ClueGiveTo4thConfirm" + ] + }, + "ClueGiveTo4thConfirm": { + "template": "SendClueConfirm.png", + "action": "clickSelf", + "roi": [ + 1150, + 500, + 100, + 160 + ], + "next": [ + "SelectClue", + "CloseSendClue" + ] + }, + "CloseSendClue": { + "action": "clickSelf", + "roi": [ + 1225, + 16, + 41, + 41 + ] + }, + "ClueGiveToNextPage": { + "action": "clickSelf", + "roi": [ + 1184, + 655, + 50, + 48 + ], + "maskRange": [ + 1, + 255 + ], + "next": [ + "ClueGiveTo1st", + "ClueGiveTo2nd", + "ClueGiveTo3rd", + "ClueGiveTo4th", + "ClueGiveToNextPage", + "ClueGiveTo1stConfirm" + ] } } diff --git a/resource/template/CloseSendClue.png b/resource/template/CloseSendClue.png new file mode 100644 index 0000000000..5d5ace2f0d Binary files /dev/null and b/resource/template/CloseSendClue.png differ diff --git a/resource/template/ClueGiveToNextPage.png b/resource/template/ClueGiveToNextPage.png new file mode 100644 index 0000000000..cb0dd46a4b Binary files /dev/null and b/resource/template/ClueGiveToNextPage.png differ diff --git a/resource/template/ClusCanBeSent.png b/resource/template/ClusCanBeSent.png new file mode 100644 index 0000000000..f3f8014916 Binary files /dev/null and b/resource/template/ClusCanBeSent.png differ diff --git a/resource/template/SelectClue.png b/resource/template/SelectClue.png new file mode 100644 index 0000000000..4c0c9d1be7 Binary files /dev/null and b/resource/template/SelectClue.png differ diff --git a/resource/template/SendClueConfirm.png b/resource/template/SendClueConfirm.png new file mode 100644 index 0000000000..c1a4e5e65e Binary files /dev/null and b/resource/template/SendClueConfirm.png differ diff --git a/resource/template/SendClues.png b/resource/template/SendClues.png new file mode 100644 index 0000000000..b40a159103 Binary files /dev/null and b/resource/template/SendClues.png differ diff --git a/src/MeoAssistant/InfrastReceptionTask.cpp b/src/MeoAssistant/InfrastReceptionTask.cpp index 90237513f1..844bf4d59a 100644 --- a/src/MeoAssistant/InfrastReceptionTask.cpp +++ b/src/MeoAssistant/InfrastReceptionTask.cpp @@ -46,16 +46,11 @@ bool asst::InfrastReceptionTask::_run() bool asst::InfrastReceptionTask::close_end_prompt() { - const auto end_task_ptr = std::dynamic_pointer_cast( - Task.get("EndOfClueExchange")); - MatchImageAnalyzer analyzer(Ctrler.get_image()); - analyzer.set_task_info(*end_task_ptr); - if (!analyzer.analyze()) { - return true; - } - click_return_button(); - sleep(end_task_ptr->rear_delay); - return true; + LogTraceFunction; + + ProcessTask task_temp(*this, { "EndOfClueExchange" }); + task_temp.set_retry_times(5); + return task_temp.run(); } bool asst::InfrastReceptionTask::harvest_clue() @@ -152,6 +147,12 @@ bool asst::InfrastReceptionTask::proc_vacancy() return true; } +bool asst::InfrastReceptionTask::send_clue() +{ + ProcessTask task(*this, { "SendClues" }); + return task.run(); +} + bool asst::InfrastReceptionTask::shift() { LogTraceFunction; diff --git a/src/MeoAssistant/InfrastReceptionTask.h b/src/MeoAssistant/InfrastReceptionTask.h index 520bacb30b..c129cf1bc8 100644 --- a/src/MeoAssistant/InfrastReceptionTask.h +++ b/src/MeoAssistant/InfrastReceptionTask.h @@ -19,6 +19,7 @@ namespace asst bool harvest_clue(); bool proc_clue(); bool proc_vacancy(); + bool send_clue(); bool shift(); bool swipe_to_the_bottom_of_clue_list_on_the_right(); };