Explorar el Código

fix(Nian): Safe click during waiting match

ryland hace 2 años
padre
commit
92adca64eb
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      tasks/Nian/script_task.py

+ 2 - 1
tasks/Nian/script_task.py

@@ -90,11 +90,12 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, NianAssets):
                 else:
                 else:
                     break
                     break
             # 如果时间到了
             # 如果时间到了
-            if click_timer.reached():
+            if click_timer and click_timer.reached():
                 logger.warning('It has waited for 240s , but the battle has not started.')
                 logger.warning('It has waited for 240s , but the battle has not started.')
                 logger.warning('It will be waited for 240s and try again.')
                 logger.warning('It will be waited for 240s and try again.')
                 self.screenshot()
                 self.screenshot()
                 self.click(self.C_CLIC_SAFE)
                 self.click(self.C_CLIC_SAFE)
+                del click_timer
                 continue
                 continue
 
 
             if check_timer.reached():
             if check_timer.reached():