Sfoglia il codice sorgente

Merge pull request #831 from runhey/dev

Automated PR 2025.04.24
huangrunheng 1 anno fa
parent
commit
006e11e80c

BIN
tasks/ActivityShikigami/as/as_ap.png


BIN
tasks/ActivityShikigami/as/as_ap_activity.png


BIN
tasks/ActivityShikigami/as/as_battle.png


BIN
tasks/ActivityShikigami/as/as_fire.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_switch.png


+ 8 - 8
tasks/ActivityShikigami/as/image.json

@@ -2,7 +2,7 @@
   {
     "itemName": "shi",
     "imageName": "as_shi.png",
-    "roiFront": "520,265,33,34",
+    "roiFront": "186,255,33,34",
     "roiBack": "64,115,1110,427",
     "method": "Template matching",
     "threshold": 0.7,
@@ -20,8 +20,8 @@
   {
     "itemName": "battle",
     "imageName": "as_battle.png",
-    "roiFront": "199,292,35,135",
-    "roiBack": "144,205,153,315",
+    "roiFront": "285,282,35,135",
+    "roiBack": "223,196,153,315",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "进入爬塔"
@@ -57,7 +57,7 @@
     "itemName": "fire",
     "imageName": "as_fire.png",
     "roiFront": "1140,583,84,78",
-    "roiBack": "1099,522,150,174",
+    "roiBack": "1099,536,150,160",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "点击战斗"
@@ -65,7 +65,7 @@
   {
     "itemName": "ap",
     "imageName": "as_ap.png",
-    "roiFront": "1138,668,23,24",
+    "roiFront": "1093,667,23,24",
     "roiBack": "1088,638,103,71",
     "method": "Template matching",
     "threshold": 0.8,
@@ -74,7 +74,7 @@
   {
     "itemName": "ap_activity",
     "imageName": "as_ap_activity.png",
-    "roiFront": "1141,673,21,21",
+    "roiFront": "1147,667,21,27",
     "roiBack": "1095,654,84,54",
     "method": "Template matching",
     "threshold": 0.8,
@@ -83,8 +83,8 @@
   {
     "itemName": "switch",
     "imageName": "as_switch.png",
-    "roiFront": "1220,671,23,23",
-    "roiBack": "1191,653,69,56",
+    "roiFront": "1241,669,23,23",
+    "roiBack": "1207,652,69,56",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "切换按键"

+ 6 - 6
tasks/ActivityShikigami/as/ocr.json

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "remain_ap",
-    "roiFront": "1162,549,97,25",
-    "roiBack": "1162,549,97,25",
+    "roiFront": "131,572,42,25",
+    "roiBack": "131,572,42,25",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",
@@ -10,8 +10,8 @@
   },
   {
     "itemName": "remain_ap_activity",
-    "roiFront": "713,25,95,30",
-    "roiBack": "713,25,95,30",
+    "roiFront": "715,18,95,28",
+    "roiBack": "715,18,95,28",
     "mode": "DigitCounter",
     "method": "Default",
     "keyword": "",
@@ -28,8 +28,8 @@
   },
   {
     "itemName": "remain_ap_activity2",
-    "roiFront": "775,26,35,29",
-    "roiBack": "775,26,35,29",
+    "roiFront": "756,17,52,29",
+    "roiBack": "756,17,52,29",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",

+ 9 - 9
tasks/ActivityShikigami/assets.py

@@ -45,11 +45,11 @@ class ActivityShikigamiAssets:
 
 	# Image Rule Assets
 	# 进入活动 
-	I_SHI = RuleImage(roi_front=(520,265,33,34), roi_back=(64,115,1110,427), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
+	I_SHI = RuleImage(roi_front=(186,255,33,34), roi_back=(64,115,1110,427), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
 	# 左上角返回 
 	I_BACK_GREEN = RuleImage(roi_front=(23,27,44,44), roi_back=(23,27,44,44), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_back_green.png")
 	# 进入爬塔 
-	I_BATTLE = RuleImage(roi_front=(199,292,35,135), roi_back=(144,205,153,315), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
+	I_BATTLE = RuleImage(roi_front=(285,282,35,135), roi_back=(223,196,153,315), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
 	# 归鹿之途 
 	I_DRUM = RuleImage(roi_front=(327,627,145,28), roi_back=(256,462,301,232), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_drum.png")
 	# 上锁图标 
@@ -57,13 +57,13 @@ class ActivityShikigamiAssets:
 	# 还未上锁图片 
 	I_UNLOCK = RuleImage(roi_front=(823,654,28,28), roi_back=(776,610,112,87), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
 	# 点击战斗 
-	I_FIRE = RuleImage(roi_front=(1140,583,84,78), roi_back=(1099,522,150,174), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
+	I_FIRE = RuleImage(roi_front=(1140,583,84,78), roi_back=(1099,536,150,160), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
 	# 体力按钮 
-	I_AP = RuleImage(roi_front=(1138,668,23,24), roi_back=(1088,638,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
+	I_AP = RuleImage(roi_front=(1093,667,23,24), roi_back=(1088,638,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
 	# 活动体力 
-	I_AP_ACTIVITY = RuleImage(roi_front=(1141,673,21,21), roi_back=(1095,654,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
+	I_AP_ACTIVITY = RuleImage(roi_front=(1147,667,21,27), roi_back=(1095,654,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
 	# 切换按键 
-	I_SWITCH = RuleImage(roi_front=(1220,671,23,23), roi_back=(1191,653,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
+	I_SWITCH = RuleImage(roi_front=(1241,669,23,23), roi_back=(1207,652,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
 	# 购买活动的体力 
 	I_BUY_JADE = RuleImage(roi_front=(1004,192,38,42), roi_back=(836,619,38,42), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_buy_jade.png")
 	# 增加到最大 
@@ -74,12 +74,12 @@ class ActivityShikigamiAssets:
 
 	# Ocr Rule Assets
 	# 体力的数量检测 
-	O_REMAIN_AP = RuleOcr(roi=(1162,549,97,25), area=(1162,549,97,25), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
+	O_REMAIN_AP = RuleOcr(roi=(131,572,42,25), area=(131,572,42,25), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
-	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(713,25,95,30), area=(713,25,95,30), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
+	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(715,18,95,28), area=(715,18,95,28), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
 	# 还有多少次购买体力的机会 
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 	# 活动票数(没有百分比) 
-	O_REMAIN_AP_ACTIVITY2 = RuleOcr(roi=(775,26,35,29), area=(775,26,35,29), mode="Digit", method="Default", keyword="", name="remain_ap_activity2")
+	O_REMAIN_AP_ACTIVITY2 = RuleOcr(roi=(756,17,52,29), area=(756,17,52,29), mode="Digit", method="Default", keyword="", name="remain_ap_activity2")
 
 

+ 16 - 8
tasks/ActivityShikigami/script_task.py

@@ -56,6 +56,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
         self.switch(current_ap)
 
         # 设定是否锁定阵容
+
         if config.general_battle.lock_team_enable:
             logger.info("Lock team")
             while 1:
@@ -188,15 +189,22 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
             # return True
 
         elif current_ap == ApMode.AP_GAME:
-            cu, res, total = self.O_REMAIN_AP.ocr(image=self.device.image)
-            if cu == total and cu + res == total:
-                if cu > total:
-                    logger.warning(f'Game ap {cu} more than total {total}')
-                    return True
-                logger.warning(f'Game ap not enough: {cu}')
-                return False
+            cu: int = self.O_REMAIN_AP.ocr_digit(self.device.image)
+            if cu > 0:
+                logger.warning(f'Game ap {cu} more than 0')
+                return True
+            logger.warning(f'Game ap not enough: {cu}')
+            return False
 
-            return True
+            # cu, res, total = self.O_REMAIN_AP.ocr(image=self.device.image)
+            # if cu == total and cu + res == total:
+            #     if cu > total:
+            #         logger.warning(f'Game ap {cu} more than total {total}')
+            #         return True
+            #     logger.warning(f'Game ap not enough: {cu}')
+            #     return False
+            #
+            # return True
 
     def switch(self, current_ap: ApMode) -> None:
         """

+ 32 - 10
tasks/Hyakkiyakou/assets.py

@@ -18,17 +18,29 @@ class HyakkiyakouAssets:
 	# description 
 	C_HSELECT_3 = RuleClick(roi_front=(934,298,115,306), roi_back=(934,298,115,306), name="hselect_3")
 	# description 
-	C_FRIEND_1 = RuleClick(roi_front=(254,223,161,67), roi_back=(254,223,161,67), name="friend_1")
+	C_FRIEND_1 = RuleClick(roi_front=(466,227,161,67), roi_back=(466,227,161,67), name="friend_1")
 	# description 
-	C_FRIEND_2 = RuleClick(roi_front=(532,226,158,64), roi_back=(532,226,158,64), name="friend_2")
+	C_FRIEND_2 = RuleClick(roi_front=(738,229,158,64), roi_back=(738,229,158,64), name="friend_2")
 	# description 
-	C_FRIEND_3 = RuleClick(roi_front=(240,310,183,66), roi_back=(240,310,183,66), name="friend_3")
+	C_FRIEND_3 = RuleClick(roi_front=(445,310,183,66), roi_back=(445,310,183,66), name="friend_3")
 	# description 
-	C_FRIEND_4 = RuleClick(roi_front=(504,311,184,62), roi_back=(504,311,184,62), name="friend_4")
+	C_FRIEND_4 = RuleClick(roi_front=(712,311,184,62), roi_back=(712,311,184,62), name="friend_4")
 	# description 
-	C_FRIEND_5 = RuleClick(roi_front=(241,395,178,61), roi_back=(241,395,178,61), name="friend_5")
+	C_FRIEND_5 = RuleClick(roi_front=(449,394,178,61), roi_back=(449,394,178,61), name="friend_5")
 	# description 
-	C_FRIEND_6 = RuleClick(roi_front=(508,394,182,62), roi_back=(508,394,182,62), name="friend_6")
+	C_FRIEND_6 = RuleClick(roi_front=(714,397,182,62), roi_back=(714,397,182,62), name="friend_6")
+	# 回归活动使用 
+	C_FRIEND_1_RECALL = RuleClick(roi_front=(254,223,161,67), roi_back=(254,223,161,67), name="friend_1_recall")
+	# 回归活动使用 
+	C_FRIEND_2_RECALL = RuleClick(roi_front=(532,226,158,64), roi_back=(532,226,158,64), name="friend_2_recall")
+	# 回归活动使用 
+	C_FRIEND_3_RECALL = RuleClick(roi_front=(240,310,183,66), roi_back=(240,310,183,66), name="friend_3_recall")
+	# 回归活动使用 
+	C_FRIEND_4_RECALL = RuleClick(roi_front=(504,311,184,62), roi_back=(504,311,184,62), name="friend_4_recall")
+	# 回归活动使用 
+	C_FRIEND_5_RECALL = RuleClick(roi_front=(241,395,178,61), roi_back=(241,395,178,61), name="friend_5_recall")
+	# 回归活动使用 
+	C_FRIEND_6_RECALL = RuleClick(roi_front=(508,394,182,62), roi_back=(508,394,182,62), name="friend_6_recall")
 
 
 	# Image Rule Assets
@@ -48,6 +60,8 @@ class HyakkiyakouAssets:
 	I_HTITLE = RuleImage(roi_front=(578,21,134,48), roi_back=(578,21,134,48), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_htitle.png")
 	# description 
 	I_HCLOSE_RED = RuleImage(roi_front=(1056,177,54,54), roi_back=(1056,177,54,54), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_hclose_red.png")
+	# 回归任务 
+	I_ENSURE_RECALL = RuleImage(roi_front=(1060,145,66,62), roi_back=(877,72,307,211), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_ensure_recall.png")
 
 
 	# Image Rule Assets
@@ -135,13 +149,21 @@ class HyakkiyakouAssets:
 
 	# Image Rule Assets
 	# description 
-	I_FRIEND_SAME_1 = RuleImage(roi_front=(167,123,106,62), roi_back=(154,105,132,94), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_1.png")
+	I_FRIEND_SAME_1 = RuleImage(roi_front=(375,122,106,62), roi_back=(375,122,106,62), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_1.png")
 	# description 
-	I_FRIEND_REMOTE_1 = RuleImage(roi_front=(288,123,106,56), roi_back=(269,106,159,91), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_1.png")
+	I_FRIEND_REMOTE_1 = RuleImage(roi_front=(498,125,106,56), roi_back=(498,125,106,56), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_1.png")
 	# description 
-	I_FRIEND_SAME_2 = RuleImage(roi_front=(168,126,100,60), roi_back=(152,112,133,80), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_2.png")
+	I_FRIEND_SAME_2 = RuleImage(roi_front=(377,126,100,60), roi_back=(377,126,100,60), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_2.png")
 	# description 
-	I_FRIEND_REMOTE_2 = RuleImage(roi_front=(296,122,100,56), roi_back=(278,115,131,81), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_2.png")
+	I_FRIEND_REMOTE_2 = RuleImage(roi_front=(504,127,100,56), roi_back=(504,127,100,56), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_2.png")
+	# 回归活动使用 
+	I_FRIEND_SAME_1_RECALL = RuleImage(roi_front=(167,123,106,62), roi_back=(154,105,132,94), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_1.png")
+	# 回归活动使用 
+	I_FRIEND_REMOTE_1_RECALL = RuleImage(roi_front=(288,123,106,56), roi_back=(269,106,159,91), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_1.png")
+	# 回归活动使用 
+	I_FRIEND_SAME_2_RECALL = RuleImage(roi_front=(168,126,100,60), roi_back=(152,112,133,80), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_same_2.png")
+	# 回归活动使用 
+	I_FRIEND_REMOTE_2_RECALL = RuleImage(roi_front=(296,122,100,56), roi_back=(278,115,131,81), threshold=0.8, method="Template matching", file="./tasks/Hyakkiyakou/hya/hya_friend_remote_2.png")
 
 
 	# Ocr Rule Assets

+ 47 - 11
tasks/Hyakkiyakou/hya/click.json

@@ -19,38 +19,74 @@
   },
   {
     "itemName": "friend_1",
-    "roiFront": "254,223,161,67",
-    "roiBack": "254,223,161,67",
+    "roiFront": "466,227,161,67",
+    "roiBack": "466,227,161,67",
     "description": "description"
   },
   {
     "itemName": "friend_2",
-    "roiFront": "532,226,158,64",
-    "roiBack": "532,226,158,64",
+    "roiFront": "738,229,158,64",
+    "roiBack": "738,229,158,64",
     "description": "description"
   },
   {
     "itemName": "friend_3",
-    "roiFront": "240,310,183,66",
-    "roiBack": "240,310,183,66",
+    "roiFront": "445,310,183,66",
+    "roiBack": "445,310,183,66",
     "description": "description"
   },
   {
     "itemName": "friend_4",
-    "roiFront": "504,311,184,62",
-    "roiBack": "504,311,184,62",
+    "roiFront": "712,311,184,62",
+    "roiBack": "712,311,184,62",
     "description": "description"
   },
   {
     "itemName": "friend_5",
-    "roiFront": "241,395,178,61",
-    "roiBack": "241,395,178,61",
+    "roiFront": "449,394,178,61",
+    "roiBack": "449,394,178,61",
     "description": "description"
   },
   {
     "itemName": "friend_6",
+    "roiFront": "714,397,182,62",
+    "roiBack": "714,397,182,62",
+    "description": "description"
+  },
+  {
+    "itemName": "friend_1_recall",
+    "roiFront": "254,223,161,67",
+    "roiBack": "254,223,161,67",
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_2_recall",
+    "roiFront": "532,226,158,64",
+    "roiBack": "532,226,158,64",
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_3_recall",
+    "roiFront": "240,310,183,66",
+    "roiBack": "240,310,183,66",
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_4_recall",
+    "roiFront": "504,311,184,62",
+    "roiBack": "504,311,184,62",
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_5_recall",
+    "roiFront": "241,395,178,61",
+    "roiBack": "241,395,178,61",
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_6_recall",
     "roiFront": "508,394,182,62",
     "roiBack": "508,394,182,62",
-    "description": "description"
+    "description": "回归活动使用"
   }
 ]

+ 9 - 0
tasks/Hyakkiyakou/hya/image1.json

@@ -70,5 +70,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
+  },
+  {
+    "itemName": "ensure_recall",
+    "imageName": "hya_ensure_recall.png",
+    "roiFront": "1060,145,66,62",
+    "roiBack": "877,72,307,211",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "回归任务"
   }
 ]

+ 43 - 7
tasks/Hyakkiyakou/hya/image5.json

@@ -2,8 +2,8 @@
   {
     "itemName": "friend_same_1",
     "imageName": "hya_friend_same_1.png",
-    "roiFront": "167,123,106,62",
-    "roiBack": "154,105,132,94",
+    "roiFront": "375,122,106,62",
+    "roiBack": "375,122,106,62",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -11,8 +11,8 @@
   {
     "itemName": "friend_remote_1",
     "imageName": "hya_friend_remote_1.png",
-    "roiFront": "288,123,106,56",
-    "roiBack": "269,106,159,91",
+    "roiFront": "498,125,106,56",
+    "roiBack": "498,125,106,56",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -20,8 +20,8 @@
   {
     "itemName": "friend_same_2",
     "imageName": "hya_friend_same_2.png",
-    "roiFront": "168,126,100,60",
-    "roiBack": "152,112,133,80",
+    "roiFront": "377,126,100,60",
+    "roiBack": "377,126,100,60",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -29,10 +29,46 @@
   {
     "itemName": "friend_remote_2",
     "imageName": "hya_friend_remote_2.png",
+    "roiFront": "504,127,100,56",
+    "roiBack": "504,127,100,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "friend_same_1_recall",
+    "imageName": "hya_friend_same_1.png",
+    "roiFront": "167,123,106,62",
+    "roiBack": "154,105,132,94",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_remote_1_recall",
+    "imageName": "hya_friend_remote_1.png",
+    "roiFront": "288,123,106,56",
+    "roiBack": "269,106,159,91",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_same_2_recall",
+    "imageName": "hya_friend_same_2.png",
+    "roiFront": "168,126,100,60",
+    "roiBack": "152,112,133,80",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "回归活动使用"
+  },
+  {
+    "itemName": "friend_remote_2_recall",
+    "imageName": "hya_friend_remote_2.png",
     "roiFront": "296,122,100,56",
     "roiBack": "278,115,131,81",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "回归活动使用"
   }
 ]

+ 29 - 10
tasks/Hyakkiyakou/slave/hya_slave.py

@@ -216,30 +216,49 @@ class HyaSlave(HyaDevice, HyaColor, HyakkiyakouAssets):
 
     def invite_friend(self, same: bool = True):
         logger.hr('Invite friend', 2)
+        hya_recall_activity = False
         while 1:
             self.screenshot()
-            if self.appear(self.I_FRIEND_SAME_1) or self.appear(self.I_FRIEND_SAME_2):
-                break
+            # 是否有召回活动(星重聚阴阳师)
+            if self.appear(self.I_ENSURE_RECALL):
+                hya_recall_activity = True
+            if hya_recall_activity:
+                if self.appear(self.I_FRIEND_SAME_1_RECALL) or self.appear(self.I_FRIEND_SAME_2_RECALL):
+                    break
+            else:
+                if self.appear(self.I_FRIEND_SAME_1) or self.appear(self.I_FRIEND_SAME_2):
+                    break
             if self.appear_then_click(self.I_HINVITE, interval=4):
                 continue
-        if not self._invite_friend(True):
-            if not self._invite_friend(False):
+        if not self._invite_friend(same=True, hya_recall_activity=hya_recall_activity):
+            if not self._invite_friend(same=False, hya_recall_activity=hya_recall_activity):
                 raise RequestHumanTakeover('Invite friend failed')
 
-    def _invite_friend(self, same: bool = True) -> bool:
+    def _invite_friend(self, same: bool = True, hya_recall_activity: bool = False) -> bool:
         if not same:
             logger.info('Invite different server friend')
-            self.ui_click(self.I_FRIEND_REMOTE_1, self.I_FRIEND_REMOTE_2)
+            # 是否有召回活动
+            if hya_recall_activity:
+                self.ui_click(self.I_FRIEND_REMOTE_1_RECALL, self.I_FRIEND_REMOTE_2_RECALL)
+            else:
+                self.ui_click(self.I_FRIEND_REMOTE_1, self.I_FRIEND_REMOTE_2)
         invite_timer = Timer(8)
         invite_timer.start()
         while 1:
             self.screenshot()
             if not self.appear(self.I_HINVITE):
                 break
-            if self.click(self.C_FRIEND_1, interval=2):
-                continue
-            if self.click(self.C_FRIEND_2, interval=3):
-                continue
+            # 是否有召回活动
+            if hya_recall_activity:
+                if self.click(self.C_FRIEND_1_RECALL, interval=2):
+                    continue
+                if self.click(self.C_FRIEND_2_RECALL, interval=3):
+                    continue
+            else:
+                if self.click(self.C_FRIEND_1, interval=2):
+                    continue
+                if self.click(self.C_FRIEND_2, interval=3):
+                    continue
             if invite_timer.reached():
                 logger.warning('Invite friend timeout, It may be no friend available')
                 return False

+ 2 - 0
tasks/Secret/assets.py

@@ -49,6 +49,8 @@ class SecretAssets:
 	O_SE_JADE = RuleOcr(roi=(327,230,23,24), area=(327,230,23,24), mode="Digit", method="Default", keyword="", name="se_jade")
 	# 金币 
 	O_SE_GOLD = RuleOcr(roi=(363,226,48,21), area=(363,226,48,21), mode="Digit", method="Default", keyword="", name="se_gold")
+	# 总耗时 
+	O_SE_TOTAL_TIME = RuleOcr(roi=(289,650,149,38), area=(289,650,149,38), mode="Single", method="Default", keyword="", name="se_total_time")
 
 
 	# Swipe Rule Assets

+ 4 - 0
tasks/Secret/script_task.py

@@ -83,6 +83,10 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, SecretAssets):
                 if self.appear(WeeklyTriflesAssets.I_WT_SE_SHARE):
                     logger.warning('You have completed the weekly trifles, skip')
                     break
+                text = self.O_SE_TOTAL_TIME.ocr_single(self.device.image)
+                if '总耗时' in text:
+                    logger.warning('You have completed the weekly trifles, skip')
+                    break
                 continue
             if layer >= 6:
                 first_battle = False

+ 9 - 0
tasks/Secret/se/ocr.json

@@ -70,5 +70,14 @@
     "method": "Default",
     "keyword": "",
     "description": "金币"
+  },
+  {
+    "itemName": "se_total_time",
+    "roiFront": "289,650,149,38",
+    "roiBack": "289,650,149,38",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "总耗时"
   }
 ]