فهرست منبع

!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])