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

fix(component): Need to slide up when opening buff because of negative game update

runhey 3 лет назад
Родитель
Сommit
4244b3cda4

+ 1 - 1
module/config/scheduler.py

@@ -26,7 +26,7 @@ class TaskScheduler:
         :param pending:
         :return:
         """
-        if isinstance(rule, ScheduleRule) is False:
+        if rule != ScheduleRule.FILTER and rule != ScheduleRule.FIFO and rule != ScheduleRule.PRIORITY:
             logger.error(f"Invalid rule: {rule}")
             return pending
         if isinstance(pending, list) is False:

+ 5 - 0
tasks/Component/GeneralBuff/assets.py

@@ -44,3 +44,8 @@ class GeneralBuffAssets:
 	O_EXP_100 = RuleOcr(roi=(421,127,342,388), area=(0,0,100,100), mode="Full", method="Default", keyword="战斗胜利获得的经验增加100%", name="exp_100")
 
 
+	# Swipe Rule Assets
+	# description 
+	S_BUFF_UP = RuleSwipe(roi_front=(397,124,456,35), roi_back=(447,457,386,37), mode="default", name="buff_up")
+
+

+ 9 - 0
tasks/Component/GeneralBuff/gb/swipe.json

@@ -0,0 +1,9 @@
+[
+  {
+    "itemName": "buff_up",
+    "roiFront": "397,124,456,35",
+    "roiBack": "447,457,386,37",
+    "mode": "default",
+    "description": "description"
+  }
+]

+ 12 - 4
tasks/Component/GeneralBuff/general_buff.py

@@ -28,6 +28,14 @@ class GeneralBuff(BaseTask, GeneralBuffAssets):
             if self.appear_then_click(self.I_BUFF_1, interval=2):
                 continue
 
+        check_image = self.I_AWAKE
+        while 1:
+            self.screenshot()
+            if self.appear(check_image):
+                break
+
+            self.swipe(self.S_BUFF_UP, interval=2)
+
     def close_buff(self):
         """
         关闭buff的总界面, 但是要确保buff界面已经打开了
@@ -281,10 +289,10 @@ if __name__ == '__main__':
     t = GeneralBuff(c, d)
 
     t.open_buff()
-    t.screenshot()
-
-    t.awake(is_open=True)
-    t.soul(is_open=True)
+    # t.screenshot()
+    #
+    # t.awake(is_open=True)
+    # t.soul(is_open=True)
     # t.gold_50(is_open=False)
     # t.gold_100(is_open=False)
     # t.exp_50(is_open=False)

+ 4 - 4
tasks/Orochi/script_task.py

@@ -53,7 +53,7 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         else:
             self.set_next_run('Orochi', finish=False, success=False)
 
-        raise TaskEnd
+        # raise TaskEnd
 
 
 
@@ -264,6 +264,9 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         while 1:
             self.screenshot()
 
+            if not is_in_orochi():
+                continue
+
             if self.current_count >= self.limit_count:
                 logger.info('Orochi count limit out')
                 break
@@ -271,9 +274,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
                 logger.info('Orochi time limit out')
                 break
 
-            if not is_in_orochi():
-                continue
-
             # 点击挑战
             while 1:
                 self.screenshot()