diff --git a/resource/tasks.json b/resource/tasks.json index 3841c91447..139ec3d0a1 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -93,7 +93,9 @@ }, "EndOfAction": { "algorithm": "OcrDetect", - "text": [ "行动结束" ], + "text": [ + "行动结束" + ], "preDelay": 3000, "action": "printWindow", "next": [ @@ -254,7 +256,9 @@ }, "VisitNextOcr": { "algorithm": "OcrDetect", - "text": [ "访问下位" ], + "text": [ + "访问下位" + ], "action": "clickSelf", "rearDelay": 3000, "identifyArea": [ @@ -311,7 +315,9 @@ }, "CreditStoreOcr": { "algorithm": "OcrDetect", - "text": [ "信用交易所" ], + "text": [ + "信用交易所" + ], "rearDelay": 1000, "action": "clickSelf", "next": [ @@ -322,13 +328,23 @@ "CollectCredit": { "template": "CollectCredit.png", "action": "clickSelf", + "next": [ + "ColseCollectCredit" + ] + }, + "ColseCollectCredit": { + "algorithm": "justReturn", + "action": "clickRand", "next": [ "Stop" ] }, "VisitLimited": { "algorithm": "OcrDetect", - "text": [ "今日参与", "已达上限" ], + "text": [ + "今日参与", + "已达上限" + ], "action": "doNothing", "identifyArea": [ 900, @@ -362,7 +378,12 @@ "template": "RecruitTimeReduce.png", "templThreshold": 0.89, "action": "clickRect", - "specificArea": [ 391, 279, 129, 44 ], + "specificArea": [ + 391, + 279, + 129, + 44 + ], "next": [ "Stop" ] @@ -530,7 +551,11 @@ }, "InfrastReward": { "algorithm": "OcrDetect", - "text": [ "可收获", "订单交付", "信赖" ], + "text": [ + "可收获", + "订单交付", + "信赖" + ], "rearDelay": 1000, "action": "clickSelf", "identifyArea": [ @@ -609,7 +634,6 @@ "template": "UavAssist-Trade.png", "action": "stop", "cache": false, - "next": [ - ] + "next": [] } } \ No newline at end of file diff --git a/src/MeoAssistance/CreditShoppingTask.cpp b/src/MeoAssistance/CreditShoppingTask.cpp index 5c39937de2..9cca31c063 100644 --- a/src/MeoAssistance/CreditShoppingTask.cpp +++ b/src/MeoAssistance/CreditShoppingTask.cpp @@ -77,6 +77,9 @@ bool asst::CreditShoppingTask::run() } for (const Rect& commodity_rect : need_to_buy) { + if (need_exit()) { + return false; + } m_controller_ptr->click(commodity_rect); sleep(1000); image = m_controller_ptr->get_image(); @@ -91,7 +94,9 @@ bool asst::CreditShoppingTask::run() } buy_it_rect = buy_it_res.rect; } - + if (need_exit()) { + return false; + } m_controller_ptr->click(buy_it_rect); sleep(1000); // 识别是否信用不足无法购买 diff --git a/src/MeoAssistance/ProcessTask.cpp b/src/MeoAssistance/ProcessTask.cpp index 5f1d910382..fb4b23292f 100644 --- a/src/MeoAssistance/ProcessTask.cpp +++ b/src/MeoAssistance/ProcessTask.cpp @@ -73,6 +73,12 @@ bool ProcessTask::run() case ProcessTaskAction::ClickSelf: exec_click_task(rect); break; + case ProcessTaskAction::ClickRand: + { + static const Rect full_rect(0, 0, Configer::WindowWidthDefault - 1, Configer::WindowHeightDefault - 1); + exec_click_task(full_rect); + + } break; case ProcessTaskAction::SwipeToTheLeft: case ProcessTaskAction::SwipeToTheRight: exec_swipe_task(task_info_ptr->action);