pcacc 4 месяцев назад
Родитель
Сommit
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])