0328更改

This commit is contained in:
jinghaibing 2025-03-28 17:41:27 +08:00
parent 1e89c897f5
commit 3e885fda29
6 changed files with 98 additions and 23 deletions

View File

@ -38,7 +38,7 @@ from ascript.android.node import Selector
from ascript.android.screen import FindColors from ascript.android.screen import FindColors
from ascript.android.screen import FindImages from ascript.android.screen import FindImages
from ascript.android.screen import CompareColors
from ascript.android.screen import Ocr from ascript.android.screen import Ocr
import re import re
@ -93,6 +93,9 @@ def tunnel(k, v):
config.diuqiwupin_lb.extend(remove_suffix(value_list)) config.diuqiwupin_lb.extend(remove_suffix(value_list))
if key == "出售物品": if key == "出售物品":
config.baitanchushou_lb.extend(remove_suffix(value_list)) config.baitanchushou_lb.extend(remove_suffix(value_list))
if key == "捉鬼次数":
print(f"捉鬼次数:{value_list}")
config.zhuoguicishu = int(value_list);
# 执行所有任务 # 执行所有任务
execute_all_tasks() execute_all_tasks()
@ -157,9 +160,25 @@ def execute_all_tasks():
# 例如baitanchushou(config.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 = WebWindow(R.ui('index.html'), tunnel)
w.show() # w.show()
x1 = 322
y1 = 539
x2 = 382
y2 = 596
# 原色标点
color_points = "322,559,#B08559|388,565,#AC7E54|353,599,#AF8659"
# 将色标点的 Y 坐标偏移 130
new_color_points = "|".join(
f"{x},{int(y) + 130},{color}"
for x, y, color in (point.split(",") for point in color_points.split("|"))
)
print(new_color_points)
# common.huodong() # common.huodong()
print("程序结束") print("程序结束")

View File

@ -43,6 +43,7 @@ last_battle_status = False
# 定义一个全局变量来管理战斗状态监控定时器 # 定义一个全局变量来管理战斗状态监控定时器
battle_monitor_timer = None battle_monitor_timer = None
def huodong(): def huodong():
while True: while True:
res_last = zhaotu("活动.png") res_last = zhaotu("活动.png")
@ -51,7 +52,7 @@ def huodong():
sleep(1) sleep(1)
res_hd_c = FindImages.find([R.img("活动-c.png"), ], rect=[421, 76, 620, 137], confidence=0.95) res_hd_c = FindImages.find([R.img("活动-c.png"), ], rect=[421, 76, 620, 137], confidence=0.95)
if res_hd_c is not None: if res_hd_c is not None:
lingquhuodongjiangli() # lingquhuodongjiangli()
return True return True
else: else:
continue continue
@ -74,34 +75,41 @@ def huodong():
def lingquhuodongjiangli(): def lingquhuodongjiangli():
x1 = 322 x1 = 315
y1 = 539 y1 = 526
x2 = 382 x2 = 392
y2 = 596 y2 = 607
# FindColors.find("311,524,#F0DCC5|446,524,#F1DEC6|580,524,#F0DDC5")
hypy = 364 hypy = 364
# 373,592 绿色 #56AE08 # 373,592 绿色 #56AE08
# 已领取 #B08559 # 已领取 #B08559
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", res_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
rect=[289, 517, 399, 612])
res_bsjg = CompareColors.compare("364,625,#56AE08") res_bsjg = CompareColors.compare("364,625,#56AE08")
if res_bsjg and res_ylq is None: if res_bsjg and res_ylq is None:
findandclick({"rect": [x1, y1, x2, y2]}) findandclick({"rect": [x1, y1, x2, y2]})
x1 += 130 x1 += 130
x2 += 130 x2 += 130
# 原色标点
color_points = "322,559,#B08559|388,565,#AC7E54|353,599,#AF8659"
# 将色标点的 Y 坐标偏移 130
new_color_points = "|".join(
f"{x},{int(y) + 130},{color}"
for x, y, color in (point.split(",") for point in color_points.split("|"))
)
# 2号奖励 # 2号奖励
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", res_ylq = FindColors.find(new_color_points, rect=[x1, y1, x2, y2])
rect=[289, 517, 399, 612])
res_bsjg = CompareColors.compare("494,625,#56AE08") res_bsjg = CompareColors.compare("494,625,#56AE08")
if res_bsjg and res_ylq is None: if res_bsjg and res_ylq is None:
findandclick({"rect": [x1, y1, x2, y2]}) findandclick({"rect": [x1, y1, x2, y2]})
x1 += 130 x1 += 130
x2 += 130 x2 += 130
# 3号奖励 # 3号奖励
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", res_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
rect=[289, 517, 399, 612])
res_bsjg = CompareColors.compare("630,625,#56AE08") res_bsjg = CompareColors.compare("630,625,#56AE08")
if res_bsjg and res_ylq is None: if res_bsjg and res_ylq is None:
findandclick({"rect": [x1, y1, x2, y2]}) findandclick({"rect": [x1, y1, x2, y2]})
@ -109,8 +117,8 @@ def lingquhuodongjiangli():
x1 += 130 x1 += 130
x2 += 130 x2 += 130
# 4号奖励 # 4号奖励
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", res_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
rect=[289, 517, 399, 612])
res_bsjg = CompareColors.compare("765,625,#56AE08") res_bsjg = CompareColors.compare("765,625,#56AE08")
if res_bsjg and res_ylq is None: if res_bsjg and res_ylq is None:
findandclick({"rect": [x1, y1, x2, y2]}) findandclick({"rect": [x1, y1, x2, y2]})
@ -118,8 +126,7 @@ def lingquhuodongjiangli():
x1 += 130 x1 += 130
x2 += 130 x2 += 130
# 5号奖励 # 5号奖励
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055", res_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
rect=[289, 517, 399, 612])
res_bsjg = CompareColors.compare("895,625,#56AE08") res_bsjg = CompareColors.compare("895,625,#56AE08")
if res_bsjg and res_ylq is None: if res_bsjg and res_ylq is None:
findandclick({"rect": [x1, y1, x2, y2]}) findandclick({"rect": [x1, y1, x2, y2]})
@ -208,6 +215,7 @@ def isfire():
isfire_wfstatus = current_battle_status isfire_wfstatus = current_battle_status
return isfire_wfstatus return isfire_wfstatus
def monitor_battle_status(): def monitor_battle_status():
global battle_monitor_timer global battle_monitor_timer
isfire() isfire()
@ -218,7 +226,6 @@ def monitor_battle_status():
stop_battle_monitor_timer() stop_battle_monitor_timer()
def start_battle_monitor_timer(): def start_battle_monitor_timer():
global battle_monitor_timer global battle_monitor_timer
if battle_monitor_timer is not None: if battle_monitor_timer is not None:
@ -227,6 +234,7 @@ def start_battle_monitor_timer():
battle_monitor_timer.start() battle_monitor_timer.start()
print("战斗状态监控已启动") print("战斗状态监控已启动")
def stop_battle_monitor_timer(): def stop_battle_monitor_timer():
global battle_monitor_timer global battle_monitor_timer
if battle_monitor_timer is not None: if battle_monitor_timer is not None:
@ -449,6 +457,7 @@ def alllive_task(num):
start_alllive_task_timer(num) start_alllive_task_timer(num)
def start_alllive_task_timer(num): def start_alllive_task_timer(num):
global alllive_task_timer global alllive_task_timer
if alllive_task_timer is not None: if alllive_task_timer is not None:

View File

@ -5,3 +5,4 @@ shanghuichushou_lb = []
shiyongwupin_lb = [] shiyongwupin_lb = []
diuqiwupin_lb = [] diuqiwupin_lb = []
baitanchushou_lb = [] baitanchushou_lb = []
zhuoguicishu = 0

View File

@ -102,6 +102,40 @@ def lingqu(zuobiao):
sleep(1) sleep(1)
return return
def dongjieshuangbei():
print("开始领取双倍")
a = 0
while True:
if a > 10:
print("找不到挂机入口,程序停止")
return
res_guaji1 = common.zhaotu("挂机1.png")
res_guaji = common.zhaotu("挂机.png")
res_guaji_last = res_guaji or res_guaji1
if res_guaji_last is not None:
common.findandclick(res_guaji_last)
sleep(1)
res_dj=common.zhaotu("冻结.png")
if res_dj is not None:
common.findandclick(res_dj)
sleep(1)
print("---------冻结双倍点数完成")
common.closeAllbtn()
return
else:
if common.isfire():
# 战斗中,打开展示所有图标
res_suoyoutubiao = common.zhaotu("所有图标.png")
if res_suoyoutubiao is None:
print("未找到目标图片:所有图标.png")
a += 1
common.closeAllbtn()
continue
else:
common.findandclick(res_suoyoutubiao)
sleep(1)
continue
def qushuzi(text): def qushuzi(text):
# 使用正则表达式提取数字 # 使用正则表达式提取数字

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import random
import threading import threading
from . import common from . import common
from . import config
from . import lingqushuangbei from . import lingqushuangbei
from . import duiwu from . import duiwu
@ -43,9 +44,20 @@ def zhuogui():
common.start_battle_monitor_timer() common.start_battle_monitor_timer()
while True: while True:
if common.zhuoguiisover is True: if common.zhuoguiisover is True or common.battle_count >= config.zhuoguicishu:
print("捉鬼完成,退出捉鬼任务") print("捉鬼完成,退出捉鬼任务")
common.stop_battle_monitor_timer() common.stop_battle_monitor_timer()
duiwu.tuichuzudui()
print("判断状态1")
while True:
if common.isfire():
print("----------战斗中----------")
sleep(60)
continue
else:
break
lingqushuangbei.dongjieshuangbei()
return return
if common.shuangbei is False: if common.shuangbei is False: