Quellcode durchsuchen

fix(GeneralBattle): Report failed battle as failure to trigger mark and refresh #1803

neptine vor 2 Monaten
Ursprung
Commit
1bec4e5d85

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

@@ -424,6 +424,7 @@ class BattleWait(BaseTask, GeneralBattleAssets):
         if self.appear(self.I_FALSE, threshold=0.8):
             logger.warning('False battle')
             self.ui_click_until_disappear(self.I_FALSE)
+            bw_ctx.success = False
             bw_ctx.completion = True
             return HookSignal.CONTINUE
         return HookSignal.CONTINUE
@@ -609,7 +610,7 @@ class BattleWait(BaseTask, GeneralBattleAssets):
             for handler in handlers:
                 result = handler(bw_ctx)
                 if handler.__name__.startswith('_bw_completion') and result == HookSignal.DONE:
-                    return True
+                    return bw_ctx.success
                 if result == HookSignal.CONTINUE:
                     continue
 
@@ -644,4 +645,3 @@ if __name__ == '__main__':
 
 
 
-

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

@@ -87,7 +87,7 @@ class GeneralBattle(BattleWait, GeneralBuff):
         # 如果没有锁定队伍那么在点击准备后才退出的,退四的话就直接退出
         if not config.lock_team_enable and not exit_four:
             # 点击准备按钮
-            self.wait_until_appear(self.I_PREPARE_HIGHLIGHT)
+            self.wait_until_appear(self.I_PREPARE_HIGHLIGHT, wait_time=5)
             while 1:
                 self.screenshot()
                 if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):