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

fix(KekkaiAction): Swipe to the end but no card is found

huangrunheng 2 лет назад
Родитель
Сommit
00a36f9841

BIN
tasks/KekkaiActivation/a/a_aa_swipe_block.png


+ 11 - 0
tasks/KekkaiActivation/a/image2.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "aa_swipe_block",
+    "imageName": "a_aa_swipe_block.png",
+    "roiFront": "124,622,35,32",
+    "roiBack": "117,612,50,51",
+    "method": "Template matching",
+    "threshold": 0.9,
+    "description": "用于判断是否滑到底了"
+  }
+]

+ 5 - 0
tasks/KekkaiActivation/assets.py

@@ -78,6 +78,11 @@ class KekkaiActivationAssets:
 	I_A_HARVEST_FISH_3 = RuleImage(roi_front=(891,165,57,39), roi_back=(854,128,132,124), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_3.png")
 
 
+	# Image Rule Assets
+	# 用于判断是否滑到底了 
+	I_AA_SWIPE_BLOCK = RuleImage(roi_front=(124,622,35,32), roi_back=(117,612,50,51), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/a/a_aa_swipe_block.png")
+
+
 	# Image Rule Assets
 	# description 
 	I_CARDS_KAIKO_6 = RuleImage(roi_front=(193,204,89,73), roi_back=(169,148,130,501), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_6.png")

+ 5 - 1
tasks/KekkaiActivation/script_task.py

@@ -277,8 +277,12 @@ class ScriptTask(KU, KekkaiActivationAssets):
             elif current_best == self.order_cards[1]:
                 break
 
+            # 滑到底就退出
+            if self.appear(self.I_AA_SWIPE_BLOCK):
+                logger.warning('Swipe to the end but no card is found')
+                break
             # 超过十次就退出
-            if swipe_count > 20:
+            if swipe_count > 15:
                 logger.warning('Swipe count is more than 10')
                 break
             # 一直向下滑动