From 38bb2854fc550ead6741abb476e06d1cdfa2d482 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 20 Dec 2021 23:23:41 +0800 Subject: [PATCH] =?UTF-8?q?opt.=E6=9B=B4=E6=96=B0python=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/RecruitTask.cpp | 4 ++-- src/Python/interface.py | 12 +++++++----- src/Python/message.py | 7 ++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/MeoAssistant/RecruitTask.cpp b/src/MeoAssistant/RecruitTask.cpp index 223c0bff01..04b2261d6f 100644 --- a/src/MeoAssistant/RecruitTask.cpp +++ b/src/MeoAssistant/RecruitTask.cpp @@ -54,8 +54,8 @@ bool RecruitTask::_run() /* 过滤tags数量不足的情况(可能是识别漏了) */ if (all_tags.size() != RecruitConfiger::CorrectNumberOfTags) { - all_tags_json["type"] = "OpenRecruit"; - m_callback(AsstMsg::OcrResultError, all_tags_json, m_callback_arg); + //all_tags_json["type"] = "OpenRecruit"; + //m_callback(AsstMsg::OcrResultError, all_tags_json, m_callback_arg); return false; } diff --git a/src/Python/interface.py b/src/Python/interface.py index e1c8132cff..7d10eb4b94 100644 --- a/src/Python/interface.py +++ b/src/Python/interface.py @@ -63,18 +63,20 @@ class Asst: ctypes.c_void_p, ctypes.c_char_p,) return self.__dll.AsstCatchCustom(self.__ptr, address.encode('utf-8')) - def append_fight(self, max_medicine: int, max_stone: int, max_times: int) -> bool: + def append_fight(self, stage: str, max_medicine: int, max_stone: int, max_times: int) -> bool: """ 添加刷理智任务 :params: + ``stage``: 关卡名,为空则不进行选关(需要当前在蓝色开始按钮界面),否则跳转到对应关卡 + 支持:''、'LastBattle'、'Annihilation'、'CE-5'、'AP-5'、'LS-5'、'CA-5' ``max_medicine``: 最多吃多少理智药 ``max_stone``: 最多吃多少源石 ``max_times``: 最多刷多少 """ self.__dll.AsstAppendFight.argtypes = ( - ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int,) - return self.__dll.AsstAppendFight(self.__ptr, max_medicine, max_stone, max_times) + ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int, ctypes.c_int, ctypes.c_int,) + return self.__dll.AsstAppendFight(self.__ptr, stage.encode('utf-8'), max_medicine, max_stone, max_times) def append_award(self) -> bool: """ @@ -222,8 +224,8 @@ if __name__ == "__main__": print('连接失败') os.system.exit() - # asst.append_fight(0, 0, 1) - asst.append_infrast(1, [ "Mfg", "Trade", "Control", "Power", "Reception", "Office", "Dorm"], "Money", 0.3) + asst.append_fight("CE-5", 0, 0, 1) + # asst.append_infrast(1, [ "Mfg", "Trade", "Control", "Power", "Reception", "Office", "Dorm"], "Money", 0.3) # asst.append_award() asst.start() diff --git a/src/Python/message.py b/src/Python/message.py index 6a119e2867..d4d05a50ec 100644 --- a/src/Python/message.py +++ b/src/Python/message.py @@ -37,7 +37,7 @@ class Message(Enum): OcrResultError = auto() """ - Ocr识别结果错误。公招如果识别的Tags数量不足5个,会报这个错 + Ocr识别结果错误 """ TaskStart = 1000 @@ -222,6 +222,11 @@ class Message(Enum): {"tags":["术师干员","减速"]} """ + RecruitError = auto() + """ + 公招识别错误。 + """ + InfrastSkillsDetected = 4000 """ 识别到了基建技能(当前页面)