0328更改
This commit is contained in:
parent
1e89c897f5
commit
3e885fda29
25
__init__.py
25
__init__.py
@ -38,7 +38,7 @@ from ascript.android.node import Selector
|
||||
from ascript.android.screen import FindColors
|
||||
|
||||
from ascript.android.screen import FindImages
|
||||
|
||||
from ascript.android.screen import CompareColors
|
||||
from ascript.android.screen import Ocr
|
||||
import re
|
||||
|
||||
@ -93,6 +93,9 @@ def tunnel(k, v):
|
||||
config.diuqiwupin_lb.extend(remove_suffix(value_list))
|
||||
if key == "出售物品":
|
||||
config.baitanchushou_lb.extend(remove_suffix(value_list))
|
||||
if key == "捉鬼次数":
|
||||
print(f"捉鬼次数:{value_list}")
|
||||
config.zhuoguicishu = int(value_list);
|
||||
|
||||
# 执行所有任务
|
||||
execute_all_tasks()
|
||||
@ -157,9 +160,25 @@ def execute_all_tasks():
|
||||
# 例如:baitanchushou(config.baitanchushou_lb)
|
||||
|
||||
# # 构建一个WebWindow 显示‘/res/ui/a.html’ 通信通道为tunnel 函数
|
||||
w = WebWindow(R.ui('index.html'), tunnel)
|
||||
w.show()
|
||||
# w = WebWindow(R.ui('index.html'), tunnel)
|
||||
# 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()
|
||||
|
||||
print("程序结束")
|
||||
|
41
common.py
41
common.py
@ -43,6 +43,7 @@ last_battle_status = False
|
||||
# 定义一个全局变量来管理战斗状态监控定时器
|
||||
battle_monitor_timer = None
|
||||
|
||||
|
||||
def huodong():
|
||||
while True:
|
||||
res_last = zhaotu("活动.png")
|
||||
@ -51,7 +52,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()
|
||||
# lingquhuodongjiangli()
|
||||
return True
|
||||
else:
|
||||
continue
|
||||
@ -74,34 +75,41 @@ def huodong():
|
||||
|
||||
|
||||
def lingquhuodongjiangli():
|
||||
x1 = 322
|
||||
y1 = 539
|
||||
x2 = 382
|
||||
y2 = 596
|
||||
x1 = 315
|
||||
y1 = 526
|
||||
x2 = 392
|
||||
y2 = 607
|
||||
|
||||
# FindColors.find("311,524,#F0DCC5|446,524,#F1DEC6|580,524,#F0DDC5")
|
||||
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_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
|
||||
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
|
||||
# 原色标点
|
||||
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号奖励
|
||||
res_ylq = FindColors.find_all("331,541,#AF8458|355,601,#B1875B|388,572,#AA7C52|353,530,#AC8055",
|
||||
rect=[289, 517, 399, 612])
|
||||
res_ylq = FindColors.find(new_color_points, rect=[x1, y1, x2, y2])
|
||||
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_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
|
||||
|
||||
res_bsjg = CompareColors.compare("630,625,#56AE08")
|
||||
if res_bsjg and res_ylq is None:
|
||||
findandclick({"rect": [x1, y1, x2, y2]})
|
||||
@ -109,8 +117,8 @@ def lingquhuodongjiangli():
|
||||
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_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
|
||||
|
||||
res_bsjg = CompareColors.compare("765,625,#56AE08")
|
||||
if res_bsjg and res_ylq is None:
|
||||
findandclick({"rect": [x1, y1, x2, y2]})
|
||||
@ -118,8 +126,7 @@ def lingquhuodongjiangli():
|
||||
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_ylq = FindColors.find("322,559,#B08559|388,565,#AC7E54|353,599,#AF8659", rect=[x1, y1, x2, y2])
|
||||
res_bsjg = CompareColors.compare("895,625,#56AE08")
|
||||
if res_bsjg and res_ylq is None:
|
||||
findandclick({"rect": [x1, y1, x2, y2]})
|
||||
@ -208,6 +215,7 @@ def isfire():
|
||||
isfire_wfstatus = current_battle_status
|
||||
return isfire_wfstatus
|
||||
|
||||
|
||||
def monitor_battle_status():
|
||||
global battle_monitor_timer
|
||||
isfire()
|
||||
@ -218,7 +226,6 @@ def monitor_battle_status():
|
||||
stop_battle_monitor_timer()
|
||||
|
||||
|
||||
|
||||
def start_battle_monitor_timer():
|
||||
global battle_monitor_timer
|
||||
if battle_monitor_timer is not None:
|
||||
@ -227,6 +234,7 @@ def start_battle_monitor_timer():
|
||||
battle_monitor_timer.start()
|
||||
print("战斗状态监控已启动")
|
||||
|
||||
|
||||
def stop_battle_monitor_timer():
|
||||
global battle_monitor_timer
|
||||
if battle_monitor_timer is not None:
|
||||
@ -449,6 +457,7 @@ def alllive_task(num):
|
||||
|
||||
start_alllive_task_timer(num)
|
||||
|
||||
|
||||
def start_alllive_task_timer(num):
|
||||
global alllive_task_timer
|
||||
if alllive_task_timer is not None:
|
||||
|
@ -5,3 +5,4 @@ shanghuichushou_lb = []
|
||||
shiyongwupin_lb = []
|
||||
diuqiwupin_lb = []
|
||||
baitanchushou_lb = []
|
||||
zhuoguicishu = 0
|
||||
|
@ -102,6 +102,40 @@ def lingqu(zuobiao):
|
||||
sleep(1)
|
||||
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):
|
||||
# 使用正则表达式提取数字
|
||||
|
File diff suppressed because one or more lines are too long
14
zhuogui.py
14
zhuogui.py
@ -3,6 +3,7 @@ import random
|
||||
import threading
|
||||
|
||||
from . import common
|
||||
from . import config
|
||||
from . import lingqushuangbei
|
||||
from . import duiwu
|
||||
|
||||
@ -43,9 +44,20 @@ def zhuogui():
|
||||
common.start_battle_monitor_timer()
|
||||
|
||||
while True:
|
||||
if common.zhuoguiisover is True:
|
||||
if common.zhuoguiisover is True or common.battle_count >= config.zhuoguicishu:
|
||||
print("捉鬼完成,退出捉鬼任务")
|
||||
common.stop_battle_monitor_timer()
|
||||
duiwu.tuichuzudui()
|
||||
print("判断状态1")
|
||||
while True:
|
||||
if common.isfire():
|
||||
print("----------战斗中----------")
|
||||
sleep(60)
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
lingqushuangbei.dongjieshuangbei()
|
||||
return
|
||||
|
||||
if common.shuangbei is False:
|
||||
|
Loading…
x
Reference in New Issue
Block a user