From a6454d45ed68c303b10db9ac31a10d9b9fafad09 Mon Sep 17 00:00:00 2001 From: jinghaibing Date: Thu, 27 Mar 2025 11:50:25 +0800 Subject: [PATCH] =?UTF-8?q?0327=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/inspectionProfiles/.idea/.gitignore | 3 + .../inspectionProfiles/profiles_settings.xml | 6 + .idea/inspectionProfiles/.idea/misc.xml | 7 + .idea/inspectionProfiles/.idea/modules.xml | 8 + .idea/inspectionProfiles/.idea/vcs.xml | 6 + .idea/inspectionProfiles/.idea/梦幻助手.iml | 8 + .idea/misc.xml | 2 +- .idea/梦幻助手.iml | 2 +- __init__.py | 48 ++-- baotu.py | 18 +- common.py | 122 +++++++++- config.py | 7 + duiwu.py | 2 +- lingqushuangbei.py | 3 + res/img/{ => shanghui}/光芒石.png | Bin res/img/{ => shanghui}/制造书-女衣.png | Bin res/img/{ => shanghui}/制造书-宝珠.png | Bin res/img/{ => shanghui}/制造书-枪.png | Bin res/img/{ => shanghui}/制造书-鞋.png | Bin res/img/{ => shanghui}/玄武石.png | Bin res/img/{ => shanghui}/白虎石.png | Bin res/img/{ => shanghui}/百炼精铁.png | Bin res/img/{ => shanghui}/黑宝石.png | Bin res/img/shimen/按钮-选择.png | Bin 0 -> 2425 bytes res/img/shimen/选择-集物.png | Bin 0 -> 10563 bytes shimen.py | 28 ++- zhixian.py | 4 +- zhuogui.py | 227 ++++++++++-------- 28 files changed, 361 insertions(+), 140 deletions(-) create mode 100644 .idea/inspectionProfiles/.idea/.gitignore create mode 100644 .idea/inspectionProfiles/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/inspectionProfiles/.idea/misc.xml create mode 100644 .idea/inspectionProfiles/.idea/modules.xml create mode 100644 .idea/inspectionProfiles/.idea/vcs.xml create mode 100644 .idea/inspectionProfiles/.idea/梦幻助手.iml create mode 100644 config.py rename res/img/{ => shanghui}/光芒石.png (100%) rename res/img/{ => shanghui}/制造书-女衣.png (100%) rename res/img/{ => shanghui}/制造书-宝珠.png (100%) rename res/img/{ => shanghui}/制造书-枪.png (100%) rename res/img/{ => shanghui}/制造书-鞋.png (100%) rename res/img/{ => shanghui}/玄武石.png (100%) rename res/img/{ => shanghui}/白虎石.png (100%) rename res/img/{ => shanghui}/百炼精铁.png (100%) rename res/img/{ => shanghui}/黑宝石.png (100%) create mode 100644 res/img/shimen/按钮-选择.png create mode 100644 res/img/shimen/选择-集物.png diff --git a/.idea/inspectionProfiles/.idea/.gitignore b/.idea/inspectionProfiles/.idea/.gitignore new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/.idea/inspectionProfiles/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/.idea/misc.xml b/.idea/inspectionProfiles/.idea/misc.xml new file mode 100644 index 0000000..220319d --- /dev/null +++ b/.idea/inspectionProfiles/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/.idea/modules.xml b/.idea/inspectionProfiles/.idea/modules.xml new file mode 100644 index 0000000..9f166f0 --- /dev/null +++ b/.idea/inspectionProfiles/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/.idea/vcs.xml b/.idea/inspectionProfiles/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/inspectionProfiles/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/.idea/梦幻助手.iml b/.idea/inspectionProfiles/.idea/梦幻助手.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/inspectionProfiles/.idea/梦幻助手.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 220319d..c293e44 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/梦幻助手.iml b/.idea/梦幻助手.iml index d0876a7..909438d 100644 --- a/.idea/梦幻助手.iml +++ b/.idea/梦幻助手.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/__init__.py b/__init__.py index 4dfbb36..4c1e0a9 100644 --- a/__init__.py +++ b/__init__.py @@ -10,6 +10,7 @@ from . import baotu from . import mijing from . import yabiao from . import zhixian +from . import config import time import random @@ -73,12 +74,6 @@ print("程序开启,打开游戏") # zhixian.shanghuichushou(shcswp) -renwuliebiao = [] -shanghuichushou_lb = [] -shiyongwupin_lb = [] -diuqiwupin_lb = [] -baitanchushou_lb = [] - def tunnel(k, v): try: # 尝试将 v 解析为字典 @@ -89,15 +84,15 @@ def tunnel(k, v): for key, value_list in v_dict.items(): print(f"任务-{key} 的值:", value_list) if key == "任务列表": - renwuliebiao.extend(remove_suffix(value_list)) + config.renwuliebiao.extend(remove_suffix(value_list)) if key == "商会出售": - shanghuichushou_lb.extend(remove_suffix(value_list)) + config.shanghuichushou_lb.extend(remove_suffix(value_list)) if key == "使用物品": - shiyongwupin_lb.extend(remove_suffix(value_list)) + config.shiyongwupin_lb.extend(remove_suffix(value_list)) if key == "丢弃物品": - diuqiwupin_lb.extend(remove_suffix(value_list)) + config.diuqiwupin_lb.extend(remove_suffix(value_list)) if key == "出售物品": - baitanchushou_lb.extend(remove_suffix(value_list)) + config.baitanchushou_lb.extend(remove_suffix(value_list)) # 执行所有任务 execute_all_tasks() @@ -110,54 +105,63 @@ def remove_suffix(items): def execute_all_tasks(): # 按顺序执行任务 - if "捉鬼任务" in renwuliebiao: + if "捉鬼任务" in config.renwuliebiao: print("执行任务: 捉鬼任务") common.start_alllive_task_timer(70) sleep(3) zhuogui.zhuogui() + config.renwuliebiao.remove("捉鬼任务") # 移除已完成的任务 print("捉鬼完成,调整全局检测线程时间----120") common.start_alllive_task_timer(120) - if "师门任务" in renwuliebiao: + if "师门任务" in config.renwuliebiao: print("执行任务: 师门任务") shimen.shimenrenwu() + config.renwuliebiao.remove("师门任务") # 移除已完成的任务 - if "宝图任务" in renwuliebiao: + if "宝图任务" in config.renwuliebiao: print("执行任务: 宝图任务") baotu.baoturenwu() + common.closeAllbtn() + config.renwuliebiao.remove("宝图任务") # 移除已完成的任务 - if "自动挖宝" in renwuliebiao: + if "自动挖宝" in config.renwuliebiao: print("执行任务: 自动挖宝") baotu.wabaotu() + config.renwuliebiao.remove("自动挖宝") # 移除已完成的任务 - if "秘境降妖" in renwuliebiao: + if "秘境降妖" in config.renwuliebiao: print("执行任务: 秘境降妖") mijing.mijingxiangyao() + config.renwuliebiao.remove("秘境降妖") # 移除已完成的任务 - if "普通押镖" in renwuliebiao: + if "普通押镖" in config.renwuliebiao: print("执行任务: 普通押镖") yabiao.yabiaorenwu() + config.renwuliebiao.remove("普通押镖") # 移除已完成的任务 # 其他任务按顺序执行 print("执行商会出售任务") - zhixian.shanghuichushou(shanghuichushou_lb) + zhixian.shanghuichushou(config.shanghuichushou_lb) print("执行使用物品任务") # 这里可以添加使用物品的具体逻辑 - # 例如:shiyongwupin(shiyongwupin_lb) + # 例如:shiyongwupin(config.shiyongwupin_lb) print("执行丢弃物品任务") # 这里可以添加丢弃物品的具体逻辑 - # 例如:diuqiwupin(diuqiwupin_lb) + # 例如:diuqiwupin(config.diuqiwupin_lb) print("执行出售物品任务") # 这里可以添加出售物品的具体逻辑 - # 例如:baitanchushou(baitanchushou_lb) + # 例如:baitanchushou(config.baitanchushou_lb) -# 构建一个WebWindow 显示‘/res/ui/a.html’ 通信通道为tunnel 函数 +# # 构建一个WebWindow 显示‘/res/ui/a.html’ 通信通道为tunnel 函数 w = WebWindow(R.ui('index.html'), tunnel) w.show() +# common.huodong() + print("程序结束") def sleep(num): time.sleep(num) diff --git a/baotu.py b/baotu.py index a75e5b4..86b26e5 100644 --- a/baotu.py +++ b/baotu.py @@ -16,13 +16,19 @@ def baoturenwu(): print("----------战斗中----------") sleep(60) continue - sleep(5) + sleep(10) + + print("判断状态2") + if common.isfire(): + print("----------战斗中----------") + sleep(60) + continue res_huodong = common.huodong() print("打开活动") if res_huodong: sleep(1) - res_baotu = common.zhaorenwu("宝图任务.png") + res_baotu = common.zhaorenwu("/baotu_zx/宝图任务.png") if res_baotu is not None: print("宝图任务") res_wancheng = common.zhaowancheng_text(res_baotu) @@ -36,9 +42,9 @@ def baoturenwu(): if res_canjia is not None: common.findandclick(res_canjia) print("点击参加,宝图任务") - sleep(1) + sleep(3) - res_ttwf = common.zhaotu("听听无妨.png") + res_ttwf = common.zhaotu("/baotu_zx/听听无妨.png") if res_ttwf is not None: common.findandclick(res_ttwf) sleep(1) @@ -62,7 +68,7 @@ def wabaotu(): if openbeibao(): num =0 while True: - res_baotu = common.zhaotu("宝图任务.png") + res_baotu = common.zhaotu("/baotu_zx/宝图任务.png") if res_baotu is not None: common.findandclick(res_baotu) sleep(1) @@ -142,7 +148,7 @@ def zhenglibb(): sleep(3) def dianjirenwu(): - res_btrw = common.zhaotu("日常-宝图任务.png") + res_btrw = common.zhaotu("/baotu_zx/日常-宝图任务.png") if res_btrw is None: print("没找到-任务列表-宝图任务") return diff --git a/common.py b/common.py index 8a047b5..7eb3a50 100644 --- a/common.py +++ b/common.py @@ -3,6 +3,8 @@ import random import threading from . import duiwu +from . import config +from . import lingqushuangbei # 导入系统资源模块 from ascript.android.system import R @@ -18,6 +20,8 @@ from ascript.android.screen import FindColors # 文字识别 from ascript.android.screen import Ocr +from ascript.android.screen import CompareColors + # 战斗状态 isfire_wfstatus = False @@ -30,6 +34,14 @@ shuangbei = False # 定义一个全局变量来管理定时器 alllive_task_timer = None +# 记录战斗次数 +battle_count = 0 + +# 记录上次战斗状态 +last_battle_status = False + +# 定义一个全局变量来管理战斗状态监控定时器 +battle_monitor_timer = None def huodong(): while True: @@ -39,6 +51,7 @@ def huodong(): sleep(1) res_hd_c = FindImages.find([R.img("活动-c.png"), ], rect=[421, 76, 620, 137], confidence=0.95) if res_hd_c is not None: + lingquhuodongjiangli() return True else: continue @@ -60,6 +73,58 @@ def huodong(): sleep(1) +def lingquhuodongjiangli(): + x1 = 322 + y1 = 539 + x2 = 382 + y2 = 596 + + hypy = 364 + # 373,592 绿色 #56AE08 + # 已领取 #B08559 + res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", + rect=[289, 517, 399, 612]) + res_bsjg = CompareColors.compare("364,625,#56AE08") + if res_bsjg and res_ylq is None: + findandclick({"rect": [x1, y1, x2, y2]}) + + x1 += 130 + x2 += 130 + # 2号奖励 + res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", + rect=[289, 517, 399, 612]) + res_bsjg = CompareColors.compare("494,625,#56AE08") + if res_bsjg and res_ylq is None: + findandclick({"rect": [x1, y1, x2, y2]}) + + x1 += 130 + x2 += 130 + # 3号奖励 + res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", + rect=[289, 517, 399, 612]) + res_bsjg = CompareColors.compare("630,625,#56AE08") + if res_bsjg and res_ylq is None: + findandclick({"rect": [x1, y1, x2, y2]}) + + x1 += 130 + x2 += 130 + # 4号奖励 + res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", + rect=[289, 517, 399, 612]) + res_bsjg = CompareColors.compare("765,625,#56AE08") + if res_bsjg and res_ylq is None: + findandclick({"rect": [x1, y1, x2, y2]}) + + x1 += 130 + x2 += 130 + # 5号奖励 + res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", + rect=[289, 517, 399, 612]) + res_bsjg = CompareColors.compare("895,625,#56AE08") + if res_bsjg and res_ylq is None: + findandclick({"rect": [x1, y1, x2, y2]}) + + def findandclick(res): # 提取矩形范围 rect = res["rect"] # [x1, y1, x2, y2] @@ -69,8 +134,8 @@ def findandclick(res): y = random.randint(rect[1], rect[3]) # 随机 y 坐标 # 执行点击操作 - print(f"点击", rect) action.click(x, y) # 在随机点点击 + print(f"点击", rect) time.sleep(0.5) @@ -121,17 +186,65 @@ def zhaotu(name): def isfire(): - global isfire_wfstatus + global isfire_wfstatus, last_battle_status, battle_count # 战斗中 res_zdqx = zhaotu("战斗-取消.png") if res_zdqx is None: print("未找到目标图片:战斗-取消.png") - isfire_wfstatus = False + current_battle_status = False else: print("战斗中.....") - isfire_wfstatus = True + current_battle_status = True + + # 检测战斗状态变化 + if current_battle_status and not last_battle_status: + print("战斗开始") + elif not current_battle_status and last_battle_status: + print("战斗结束") + battle_count += 1 + print(f"战斗次数: {battle_count}") + + last_battle_status = current_battle_status + isfire_wfstatus = current_battle_status return isfire_wfstatus +def monitor_battle_status(): + global battle_monitor_timer + isfire() + if not zhuoguiisover: + battle_monitor_timer = threading.Timer(2, monitor_battle_status) + battle_monitor_timer.start() + else: + stop_battle_monitor_timer() + + + +def start_battle_monitor_timer(): + global battle_monitor_timer + if battle_monitor_timer is not None: + battle_monitor_timer.cancel() + battle_monitor_timer = threading.Timer(2, monitor_battle_status) + battle_monitor_timer.start() + print("战斗状态监控已启动") + +def stop_battle_monitor_timer(): + global battle_monitor_timer + if battle_monitor_timer is not None: + battle_monitor_timer.cancel() + battle_monitor_timer = None + print("战斗状态监控已停止") + +def check_shuangbei(): + global shuangbeidianshu + print("开始检测双倍点数") + res_guaji1 = zhaotu("挂机1.png") + res_guaji = zhaotu("挂机.png") + res_guaji_last = res_guaji or res_guaji1 + if res_guaji_last is not None: + lingqushuangbei.lingqu(res_guaji_last) + print("双倍领取完成") + else: + print("未找到挂机入口,双倍检测失败") def denglu(): while True: @@ -295,6 +408,7 @@ def shizi(fanwei): def alllive_task(num): print("---------------定时任务-寻找异常弹窗----------------") + print(f"--------------当前剩余任务:{config.renwuliebiao}") # 输出当前剩余任务 # zhaotu("道具领取-弹框.png") ref_daoju = zhaotu("道具领取-弹框.png") if ref_daoju is None: diff --git a/config.py b/config.py new file mode 100644 index 0000000..2c5219e --- /dev/null +++ b/config.py @@ -0,0 +1,7 @@ +# config.py + +renwuliebiao = [] +shanghuichushou_lb = [] +shiyongwupin_lb = [] +diuqiwupin_lb = [] +baitanchushou_lb = [] diff --git a/duiwu.py b/duiwu.py index a4d2a76..2af9137 100644 --- a/duiwu.py +++ b/duiwu.py @@ -43,7 +43,7 @@ def tuichuzudui(): common.closeAllbtn() else: print("-------找到创建队伍,没有在队伍中------") - + common.closeAllbtn() return else: sleep(1) diff --git a/lingqushuangbei.py b/lingqushuangbei.py index df52596..69127f0 100644 --- a/lingqushuangbei.py +++ b/lingqushuangbei.py @@ -74,6 +74,7 @@ def lingqu(zuobiao): for i in range(xunhuancishu): print(f"领取双倍 100 点, 次数 {i + 1}/{xunhuancishu}") common.findandclick(res_lingqu) + ylq_num += 100 sleep(0.5) if res_ylq_text is None: @@ -85,6 +86,8 @@ def lingqu(zuobiao): else: shuangbeidianshu = ylq_num if ylq_num >= 4: + if ylq_num >= 1000: + ylq_num = 1000 print(f"正常领取结束,开始任务", ylq_num) common.shuangbei = True common.closeAllbtn() diff --git a/res/img/光芒石.png b/res/img/shanghui/光芒石.png similarity index 100% rename from res/img/光芒石.png rename to res/img/shanghui/光芒石.png diff --git a/res/img/制造书-女衣.png b/res/img/shanghui/制造书-女衣.png similarity index 100% rename from res/img/制造书-女衣.png rename to res/img/shanghui/制造书-女衣.png diff --git a/res/img/制造书-宝珠.png b/res/img/shanghui/制造书-宝珠.png similarity index 100% rename from res/img/制造书-宝珠.png rename to res/img/shanghui/制造书-宝珠.png diff --git a/res/img/制造书-枪.png b/res/img/shanghui/制造书-枪.png similarity index 100% rename from res/img/制造书-枪.png rename to res/img/shanghui/制造书-枪.png diff --git a/res/img/制造书-鞋.png b/res/img/shanghui/制造书-鞋.png similarity index 100% rename from res/img/制造书-鞋.png rename to res/img/shanghui/制造书-鞋.png diff --git a/res/img/玄武石.png b/res/img/shanghui/玄武石.png similarity index 100% rename from res/img/玄武石.png rename to res/img/shanghui/玄武石.png diff --git a/res/img/白虎石.png b/res/img/shanghui/白虎石.png similarity index 100% rename from res/img/白虎石.png rename to res/img/shanghui/白虎石.png diff --git a/res/img/百炼精铁.png b/res/img/shanghui/百炼精铁.png similarity index 100% rename from res/img/百炼精铁.png rename to res/img/shanghui/百炼精铁.png diff --git a/res/img/黑宝石.png b/res/img/shanghui/黑宝石.png similarity index 100% rename from res/img/黑宝石.png rename to res/img/shanghui/黑宝石.png diff --git a/res/img/shimen/按钮-选择.png b/res/img/shimen/按钮-选择.png new file mode 100644 index 0000000000000000000000000000000000000000..020a04272b31e7d47f67d8e90d7b236e2769addf GIT binary patch literal 2425 zcmV-<35NEGP)001Ef1^@s6ks(&r00001b5ch_0Itp) z=>Px#1am@3R0s$N2z&@+hyVZyBS}O-RA_k{eT9SwL_#o# zkO-v^kVUE$TB~wSk-F5j2a8r}_4KsV7DWp^9$RTzL9u#72uDy9ga8f@mMjnmki?Wk zgcz1=1C!a`uYXJ!G7BM-(bhxx{xk30-|v3s-uv$F{_gzVNTQ`$;Ds)y$y-j37*vuZ2CDnh+%x^D*BqOP0RGM&5$(YZUBYOwxCc2?G5Q+mu zD5$gp(C8AlnM2osaN1BD79_P6IRLe9&Z7T0df&W+y$b+YQUu<$9OWCb>01lmM3B5h zLU3~#1_BveQR^>STbijkP)5PbImlYA$CwZT!=@6l^YV#LOGgMn@o#@k&K(65%$n0D z{uAW~+3?y*9$oq(@oDJ*Sh`HqRaM|{IC|ApsZ^w84<|Y@s^r7f z#nd0E;^F6)qEf5fW6h1H_;7VGrnyFD%wK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wb+4R8 z%2RB>N-h^d0~B_UMg##$24m;20izmg#S=_{8Z!r{2Deb)yI=ew`*-YM#oD#J`;(uf zW6vIb{;h9u%h$ht%K5ddT*-$%`&kD2`uLZRe1upcK|WU;+ejpnC)YTo=B|}f@+$c( zK>FqO#u>G-0-dW=e4dUydpNjrC#hq{ zDde)FyKc^mrOTHAig>bu^De)PryqHga5TzU7jLF@Rr`!GE?vHyhL)B&)uSv*y(d)+ z;Ba#z<3E)?L!r8Uq;}r=Bdq2NiLW>lfS6qX6-<26FYQ2>A|_dm!caGZJMW=uf0}jI zTtP)+Jyy6ld!YeTw6u}lU(%|oQX5;+kiFDX36zp}nSN3odx+IkPk9C!z>-bpvupdk zC%z3N1PY`WPfE%usi@U2&ZLx_k}$mSJjVMK~70w5{R^tuh#I(81}urOY{abHpuH*GIuGGzPu$fQ#Ab*8CX-a_rN zr9_hnq7@0El@;i=HRY@tp}KxB;eD1t@g%sxBRvfD^pfiAVzB!NsqVc~3ODo@?{Xwl zpEx*E+kO_YnhHX(5Rr-mp=g9qEP@#hO(azn*CZHIjOVEJ4kr=_p%IG3sBUg%mARS1 z@Cbo_Vt;DgnC({lC1#_XS)O826f=#^PZoFb(C6$e)Kp={@{uLMbz<~~cufU%$iR+8 z(R2;NG{#9)lg{~`vM0>gWLzi~E2emi!bpa|_lZ?kO}I92#yp3a&qx?+2*%Fynu2)} zd(!Ntlc`MOJ8s-celksiXflSI%U~D+!?uc>%Z|=M=yt5Q3s9gy1xVlF{{sjht3Ad@ RrIP>v002ovPDHLkV1i2sbhH2f literal 0 HcmV?d00001 diff --git a/shimen.py b/shimen.py index 8f122e5..502a337 100644 --- a/shimen.py +++ b/shimen.py @@ -7,7 +7,8 @@ from ascript.android.screen import FindImages from ascript.android.screen import FindColors -pngs = ["/shimen/师门-任务按钮", "使用按钮", "/shimen/师门任务1", "普陀山", "购买按钮", "上交按钮", "/shimen/师门01", "摆摊-购买"] +pngs = ["/shimen/师门-任务按钮", "使用按钮", "/shimen/师门任务1", "/shimen/普陀山", "购买按钮", "上交按钮", + "/shimen/师门01", "摆摊-购买", "/shimen/师门-龙宫", "/shimen/首席请", "跳过动画", "/shimen/不打自招"] def shimenrenwu(): @@ -44,10 +45,15 @@ def shimenrenwu(): common.findandclick(res_canjia) print("点击参加,师门任务") sleep(1) + res_xzjw = common.zhaotu("/shimen/选择-集物.png") + if res_xzjw is not None: + findxuanze(res_xzjw) res_qwc = zhaobtn(["/shimen/师门-去完成", "/shimen/师门-继续任务"]) - if res_qwc is not None: - sleep(1) - common.findandclick(res_qwc) + if res_qwc is not None or res_xzjw is not None: + if res_qwc is not None: + sleep(1) + common.findandclick(res_qwc) + while True: print("判断状态1") if common.isfire(): @@ -60,7 +66,12 @@ def shimenrenwu(): common.findandclick(res_btns) sleep(3) - res_qctb = zhaobtn(["请出题吧", "师傅请"]) + res_btns = zhaobtn(pngs) + if res_btns is not None: + common.findandclick(res_btns) + sleep(3) + + res_qctb = zhaobtn(["/shimen/请出题吧", "/shimen/师傅请"]) if res_qctb is not None: common.findandclick(res_qctb) sleep(1) @@ -94,6 +105,13 @@ def shimenrenwu(): sleep(1) +def findxuanze(fanwei): + res_anxz = common.zhaotu("/shimen/按钮-选择.png") + if res_anxz is not None: + common.findandclick(res_anxz) + sleep(1) + + def dianjirenwu(): res_shimen = common.zhaotu("/shimen/师门.png") if res_shimen is None: diff --git a/zhixian.py b/zhixian.py index 5903b58..1656542 100644 --- a/zhixian.py +++ b/zhixian.py @@ -29,7 +29,7 @@ def shanghuichushou(shcswp): common.findandclick(res_gd) sleep(1) - res_shcs = zhaobtn(["商会出售", "商会出售01"]) + res_shcs = zhaobtn(["/shanghui/商会出售", "/shanghui/商会出售01"]) if res_shcs is not None: common.findandclick(res_shcs) sleep(1) @@ -66,7 +66,7 @@ def xiahua(): def zhaobtn(pngs): # 找各种任务按钮 images = [R.img(png + ".png") for png in pngs] - return FindImages.find(images, confidence=0.9) + return FindImages.find(images, confidence=0.95) def sleep(num): time.sleep(num) diff --git a/zhuogui.py b/zhuogui.py index e6a1014..fbfe483 100644 --- a/zhuogui.py +++ b/zhuogui.py @@ -25,125 +25,156 @@ from ascript.android.screen import FindColors from ascript.android.screen import Ocr -def check_shuangbei(): - lingqushuangbei.lingqushuangbei() # 执行双倍点数检测 - print(f"----------------------------5分钟检测一次双倍点数:", lingqushuangbei.shuangbeidianshu) - timeer = threading.Timer(300, check_shuangbei) - timeer.start() - if common.zhuoguiisover is True: - print("捉鬼完成,检测双倍点数线程关闭") - timeer.cancel() - return - - def zhuogui(): - check_shuangbei() - if common.shuangbei is False or common.zhuoguiisover is True: - print("双倍领取失败,双倍不足,捉鬼完成") - duiwu.tuichuzudui() + global battle_count # 声明全局变量 + + # 开始时检测一次双倍点数 + common.check_shuangbei() + if common.shuangbei is False: + print("双倍点数不足,停止捉鬼任务") return - if common.shuangbei: - print("开始捉鬼") - # 先执行退出队伍 - while True: - if common.zhuoguiisover is True and common.shuangbei is False: - print("-------------------------检查到捉鬼完成,退出队伍,进行下一项") - duiwu.tuichuzudui() - return + print("开始捉鬼") + # 先执行退出队伍 + duiwu.tuichuzudui() - # zhaotu("战斗-取消.png") - res_zdsb = common.zhaotu("战斗失败.png") - if res_zdsb is not None: - print("找到战斗失败") - common.findandclick(res_zdsb) + # 启动战斗状态监控定时任务 + common.start_battle_monitor_timer() + + while True: + if common.zhuoguiisover is True: + print("捉鬼完成,退出捉鬼任务") + common.stop_battle_monitor_timer() + return + + if common.shuangbei is False: + print("双倍点数不足,停止捉鬼任务") + common.stop_battle_monitor_timer() + return + + print(f"战斗次数:", common.battle_count, "双倍点数:", + lingqushuangbei.shuangbeidianshu - (common.battle_count * 4)) + # 检测双倍点数 + if lingqushuangbei.shuangbeidianshu < common.battle_count * 4: + print("双倍点数不足,停止捉鬼任务") + common.zhuoguiisover = True + common.stop_battle_monitor_timer() + return + + # 检查战斗状态 + if common.isfire(): + print("----------战斗中----------") + sleep(60) + continue + + res_zdsb = common.zhaotu("战斗失败.png") + if res_zdsb is not None: + print("找到战斗失败") + common.findandclick(res_zdsb) + sleep(1) + duiwu.tuichuzudui() + continue + + print("判断状态1") + if common.isfire(): + print("----------战斗中----------") + sleep(60) + continue + sleep(10) + print("判断状态2") + if common.isfire(): + print("----------再次判断战斗中----------") + sleep(60) + continue + + res_huodong = common.huodong() + if res_huodong: + sleep(1) + res_gui = common.zhaorenwu("鬼图标2.png") + if res_gui is None: + print("未找到目标图片:鬼图标.png") + # 翻页 + common.closeAllbtn() + continue + else: sleep(1) - duiwu.tuichuzudui() - continue - - print("判断状态1") - if common.isfire(): - print("----------战斗中----------") - sleep(60) - continue - sleep(10) - print("判断状态2") - if common.isfire(): - print("----------再次判断战斗中----------") - sleep(60) - continue - - res_huodong = common.huodong() - if res_huodong: - sleep(1) - res_gui = common.zhaorenwu("鬼图标2.png") - if res_gui is None: - print("未找到目标图片:鬼图标.png") - # 翻页 + res_canjia = common.zhaocanjia_text(res_gui) + res_wancheng = common.zhaowancheng(res_gui) + if res_wancheng is not None: + print("捉鬼任务完成,退出队伍") common.closeAllbtn() - continue + sleep(2) + duiwu.tuichuzudui() + common.zhuoguiisover = True + common.stop_battle_monitor_timer() + return + + if res_canjia is None: + print("未找到目标图片:参加.png") + if common.isfire(): + print("正在战斗,等待战斗完成") + sleep(60) + continue + else: + print("异常情况") + common.closeAllbtn() + continue else: sleep(1) - res_canjia = common.zhaocanjia_text(res_gui) - res_wancheng = common.zhaowancheng(res_gui) - if res_wancheng is not None: - print("捉鬼任务完成,退出队伍") + print("点击参加") + common.findandclick(res_canjia) + sleep(1) + res_zdpp = common.zhaotu("自动匹配.png") + res_qxpp = common.zhaotu("取消匹配.png") + if res_qxpp is not None: + print("正在匹配,等待匹配完成") + sleep(20) common.closeAllbtn() - sleep(2) - duiwu.tuichuzudui() - common.zhuoguiisover = True - return + continue - if res_canjia is None: - print("未找到目标图片:参加.png") + if res_zdpp is None: + print("未找到目标图片:自动匹配.png") + print("判断状态3") + sleep(10) if common.isfire(): - print("正在战斗,等待战斗完成") + print("1战斗中-等待战斗结束") sleep(60) continue else: - print("异常情况") - common.closeAllbtn() - continue - else: - sleep(1) - print("点击参加") - common.findandclick(res_canjia) - sleep(1) - res_zdpp = common.zhaotu("自动匹配.png") - res_qxpp = common.zhaotu("取消匹配.png") - if res_qxpp is not None: - print("正在匹配,等待匹配完成") - sleep(20) - common.closeAllbtn() - continue - - if res_zdpp is None: - print("未找到目标图片:自动匹配.png") - print("判断状态3") + print("判断状态4") sleep(10) if common.isfire(): - print("1战斗中-等待战斗结束") + print("2战斗中-等待战斗结束") sleep(60) continue else: - print("判断状态4") - sleep(10) - if common.isfire(): - print("2战斗中-等待战斗结束") - sleep(60) - continue - else: - print("点了参加,也没自动匹配,也没在战斗中-退出队伍") - duiwu.tuichuzudui() - print("退出组队后,重新捉鬼") + print("点了参加,也没自动匹配,也没在战斗中-退出队伍") + duiwu.tuichuzudui() + print("退出组队后,重新捉鬼") + + else: + common.findandclick(res_zdpp) + print("---------捉鬼开始了---------") + common.closeAllbtn() + sleep(2) + common.closeAllbtn() + sleep(60) + + # 检查战斗状态 + if common.isfire(): + print("----------战斗中----------") + sleep(60) + + # 检测双倍点数 + if lingqushuangbei.shuangbeidianshu < common.battle_count * 4: + print("双倍点数不足,停止捉鬼任务") + common.zhuoguiisover = True + common.stop_battle_monitor_timer() + return else: - common.findandclick(res_zdpp) - print("---------捉鬼开始了---------") - common.closeAllbtn() - sleep(2) - common.closeAllbtn() - sleep(60) + print("未进入战斗,重新开始捉鬼任务") + continue sleep(1)