Просмотр исходного кода

Merge pull request #1406 from xxz7528/dev

修复探索任务结束时触发宝箱/妖气导致卡死的问题
huangrunheng 9 месяцев назад
Родитель
Сommit
ac1db8a958
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      tasks/Exploration/base.py

+ 10 - 2
tasks/Exploration/base.py

@@ -376,12 +376,18 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
         logger.info('Quit explore')
         boss_timer = Timer(15)
         boss_timer.start()
+        click_yellow_button = 0 #用于保证只点一次左上返回按钮,不要直接触发连点回到主界面
         
         while 1:
             self.screenshot()
             
+            #探索章节标题界面
             if self.appear(self.I_UI_BACK_RED) and self.appear(self.I_E_EXPLORATION_CLICK):
                 break
+            
+            #探索大世界界面
+            if self.appear(self.I_CHECK_EXPLORATION) and not self.appear(self.I_E_SETTINGS_BUTTON):
+                break
   
             # 防止BOSS打完箱子刚落地,脚本就手快点退出了
             if self.appear_then_click(self.I_BATTLE_REWARD, interval=1.5):
@@ -398,8 +404,10 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             if self.appear_then_click(self.I_E_EXIT_CONFIRM, interval=0.8):
                 continue
             
-            if self.appear_then_click(self.I_BACK_YOLLOW, interval=3.5):
-                continue
+            if click_yellow_button == 0:
+                if self.appear_then_click(self.I_BACK_YOLLOW, interval=3.5):
+                    click_yellow_button = 1
+                    continue
             
             if self.appear(self.I_EXPLORATION_TITLE) or self.appear(self.I_CHECK_EXPLORATION):
                 continue