From 4961a35b005958d4c09dce1f3b71755ca4bb6ba9 Mon Sep 17 00:00:00 2001 From: ShinaKaria <749944575@qq.com> Date: Fri, 13 Jan 2023 16:40:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=93=E6=AD=A6=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- automator_mixins/_tools.py | 22 +++++++++++++++++++--- img/juese/zhuanwu_isEquip.bmp | Bin 0 -> 222 bytes scenes/root/juese.py | 14 ++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 img/juese/zhuanwu_isEquip.bmp diff --git a/automator_mixins/_tools.py b/automator_mixins/_tools.py index 68c1f342..1cdb01cc 100644 --- a/automator_mixins/_tools.py +++ b/automator_mixins/_tools.py @@ -865,10 +865,12 @@ def output_dict(d): os.makedirs(path) sd = sorted(d) with open(os.path.join(path, self.account + ".txt"), "w", encoding="utf-8") as f: - f.write("\t".join(["名称", "星级", "Rank", "等级", "左上", "右上", "左中", "右中", "左下", "右下", "好感", "更新时间"]) + "\n") + f.write("\t".join(["名称", "星级", "Rank", "等级", "左上", "右上", "左中", "右中", "左下", "右下", "好感", "专武是否已解锁", "专武", + "更新时间"]) + "\n") for k in sd: v = d[k] f.write("\t".join([str(s) for s in [k, v["star"], v["rank"], v["dengji"], *v["zb"], v["haogan"], + v["zhuanwu_isEquip"], v["zhuanwu"], get_time_str(v["last_update"])]]) + "\n") mv.regflag("count", 0) @@ -888,6 +890,18 @@ def output_dict(d): D["dengji"] = S.get_level(sc) D["rank"] = S.get_rank(sc) D["zb"] = S.get_six_clothes(sc) + S = S.goto_zhuanwu() + zhuanwu_isEquip = S.get_zhuanwu_isEquip() + #print(f'zhuanwu_isEquip:{zhuanwu_isEquip}') + + if zhuanwu_isEquip: + sc = self.getscreen() + D["zhuanwu_isEquip"] = True + D["zhuanwu"] = S.get_zhuanwu(sc) + else: + D["zhuanwu_isEquip"] = False + D["zhuanwu"] = 0 + S = S.goto_kaihua() sc = self.getscreen() NAME = S.get_name(sc) @@ -895,6 +909,9 @@ def output_dict(d): break D["star"] = S.get_stars(sc) D["last_update"] = time.time() + # print(f'※{NAME}:\n') + # for i in D: + # print(f'\t{i}:{D[i]}') if NAME not in data: data[NAME] = {} data[NAME].update(D) @@ -1017,7 +1034,7 @@ def check_color(self, fc, bc, xcor, ycor, color_type="gbr", screen=None): else: return False - def clear_and_save_team(self, cnamelst: list, slot: str, replace: bool, prefer=None): + def clear_and_save_team(self, cnamelst: list, slot: str, replace: bool, prefer=None): self.lock_home() cm = self.get_zhuye().goto_juese() ct = cm.goto_wodeduiwu() @@ -1028,4 +1045,3 @@ def clear_and_save_team(self, cnamelst: list, slot: str, replace: bool, prefer= cbz.save_team() self.fclick(1, 1) self.lock_home() - diff --git a/img/juese/zhuanwu_isEquip.bmp b/img/juese/zhuanwu_isEquip.bmp new file mode 100644 index 0000000000000000000000000000000000000000..67d2d99ba0621f86d1edac0e002fa5b5f686daa3 GIT binary patch literal 222 mcmZ?ry~h9nW "CharTeam": self.click_btn(JUESE_BTN["save_team"]) - - class CharBase(SevenBTNMixin): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -338,6 +336,11 @@ def get_haogan(self, screen=None): at = (271, 390, 291, 405) return self.ocr_int(*at, screen) + def get_zhuanwu(self, screen=None): + if screen is None: screen = self.getscreen() + at = (260, 135, 286, 148) + return self.ocr_int(*at, screen) + def next_char(self, screen=None): # at = (483, 119, 760, 141) at = (180, 75, 314, 97) @@ -674,6 +677,13 @@ def get_zhuanwu_status(self, screen=None): else: return 1 + def get_zhuanwu_isEquip(self, screen=None): + if self.is_exists(img="img/juese/zhuanwu_isEquip.bmp", at=(876, 127, 886, 137), screen=screen, method="sq", + threshold=0.95): + return True + else: + return False + def wear_zhuanwu(self): self.click_btn(JUESE_BTN["wear"], until_appear=JUESE_BTN["wear_confirm"]) self.click_btn(JUESE_BTN["wear_confirm"])