Răsfoiți Sursa

fix(Exploration): Prevent exploration clicks from getting stuck #1814

neptine 2 luni în urmă
părinte
comite
31b48aae46

+ 1 - 1
.github/workflows/auto-create-pr.yaml

@@ -3,7 +3,7 @@ name: Auto Create PR from dev to master
 on:
 on:
   schedule:
   schedule:
     # 每周四北京时间21点触发(UTC时间13点)
     # 每周四北京时间21点触发(UTC时间13点)
-    - cron: '0 13 * * 4'
+    - cron: '7 13 * * 4'
   workflow_dispatch:
   workflow_dispatch:
 
 
 jobs:
 jobs:

+ 1 - 1
tasks/Component/GeneralBattle/battle_wait.py

@@ -440,7 +440,7 @@ class BattleWait(BaseTask, GeneralBattleAssets):
             return HookSignal.CONTINUE
             return HookSignal.CONTINUE
         if not self.is_in_battle(is_screenshot=False):
         if not self.is_in_battle(is_screenshot=False):
             return HookSignal.CONTINUE
             return HookSignal.CONTINUE
-        if random.random() < 0.01 :  # 低概率
+        if random.random() < 0.005 :  # 低概率
             rand_type = random.randint(0, 2)
             rand_type = random.randint(0, 2)
             match rand_type:
             match rand_type:
                 case 0:
                 case 0:

+ 3 - 0
tasks/Exploration/base.py

@@ -198,6 +198,9 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             if self.is_in_battle():
             if self.is_in_battle():
                 logger.warning('Opening settings failed due to now in battle')
                 logger.warning('Opening settings failed due to now in battle')
                 return
                 return
+            if (self.appear_then_click(self.I_UI_CONFIRM, interval=1)
+                    or self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1)):
+                continue
             if self.click(self.C_CLICK_SETTINGS, interval=2):
             if self.click(self.C_CLICK_SETTINGS, interval=2):
                 continue
                 continue
 
 

+ 4 - 1
tasks/Exploration/solo.py

@@ -87,11 +87,14 @@ class SoloExploration(BaseExploration):
                 if not self.explore_init:
                 if not self.explore_init:
                     if self._config.exploration_config.auto_rotate == AutoRotate.yes:
                     if self._config.exploration_config.auto_rotate == AutoRotate.yes:
                         self.enter_settings_and_do_operations()
                         self.enter_settings_and_do_operations()
-                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON)
+                    self.ui_click(self.I_E_AUTO_ROTATE_OFF, stop=self.I_E_AUTO_ROTATE_ON, timeout=5)
                     self.explore_init = True
                     self.explore_init = True
                     continue
                     continue
                 if self._handle_treasure_box():
                 if self._handle_treasure_box():
                     continue
                     continue
+                if (self.appear_then_click(self.I_UI_CONFIRM, interval=1)
+                        or self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1)):
+                    continue
                 # 小纸人
                 # 小纸人
                 if self.appear(self.I_BATTLE_REWARD):
                 if self.appear(self.I_BATTLE_REWARD):
                     if self.ui_get_reward(self.I_BATTLE_REWARD):
                     if self.ui_get_reward(self.I_BATTLE_REWARD):