Pārlūkot izejas kodu

!2 attack try max time

pcacc 4 mēneši atpakaļ
vecāks
revīzija
15a7760e35
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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])