Skip to content

Commit

Permalink
尝试计算坐标, 减少活动图片刷新导致的识别失败
Browse files Browse the repository at this point in the history
  • Loading branch information
cndaqiang committed Sep 25, 2024
1 parent 2efdda9 commit dc33ebe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
airtest_mobileauto >=1.3.16
airtest_mobileauto >=1.3.19.1
11 changes: 4 additions & 7 deletions wzry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,9 +1448,8 @@ def 商城免费礼包(self, times=0):
找到商城入口 = False
找到商城入口, 商城入口 = self.Tool.存在任一张图(商城入口, f"{fun_name(1)}商城入口", savepos=True)
if not 找到商城入口:
TimeECHO(f"无法找到商城入口")
TimeECHO(f"按照960x540的分辨率强制设定坐标")
self.Tool.var_dict[f"{fun_name(1)}商城入口"] = (925, 114)
TimeECHO(f"无法找到商城入口, 尝试计算坐标")
self.Tool.cal_record_pos(商城入口[0].record_pos, self.移动端.resolution, f"{fun_name(1)}商城入口", savepos=True)
self.Tool.existsTHENtouch(商城入口[0], f"{fun_name(1)}商城入口", savepos=True)
sleep(30)
进入商城界面 = False
Expand Down Expand Up @@ -1510,10 +1509,8 @@ def 玉镖夺魁(self, times=0):
# savepos 如果找到会自动替换上一次的字典
存在大厅祈愿, self.图片.大厅祈愿 = self.Tool.存在任一张图(self.图片.大厅祈愿, "大厅祈愿", savepos=True)
if not 存在大厅祈愿:
TimeECHO(f"玉镖夺魁: 找不到祈愿入口")
TimeECHO(f"按照960x540的分辨率强制设定坐标")
# 这里是绝对坐标,不适用于其他分辨率的情况
self.Tool.var_dict["大厅祈愿"] = (905, 168)
TimeECHO(f"玉镖夺魁: 找不到祈愿入口, 尝试计算坐标")
self.Tool.cal_record_pos(self.图片.大厅祈愿[0].record_pos, self.移动端.resolution, "大厅祈愿", savepos=True)
if not self.Tool.existsTHENtouch(self.图片.大厅祈愿[0], "大厅祈愿", savepos=True):
return self.玉镖夺魁(times)
sleep(10)
Expand Down

0 comments on commit dc33ebe

Please sign in to comment.