浏览代码

!2 attack try max time

pcacc 4 月之前
父节点
当前提交
15a7760e35
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      dongri_task.py

+ 3 - 1
dongri_task.py

@@ -1116,7 +1116,9 @@ class task_fight_enemy(dongri_task):
         myTimeSleep_big()
         firstPos = get_yys_random_point(special_activity_img.first_enemy_region)
         pcacc_mouse.click(firstPos[0], firstPos[1])
-        while waitFindImg_withBool(attackArr, 2, 1) == False:
+        maxTryTimes = 5
+        while waitFindImg_withBool(attackArr, 2, 1) == False and maxTryTimes > 0:
+            maxTryTimes -= 1
             myTimeSleep_big()
             mid_enemy_pos = get_yys_random_point(special_activity_img.mid_enemy_region)
             pcacc_mouse.click(mid_enemy_pos[0], mid_enemy_pos[1])