Explorar o código

fix(task): update daily task

runhey %!s(int64=3) %!d(string=hai) anos
pai
achega
89bcbb6e3c

+ 2 - 0
tasks/Component/Summon/assets.py

@@ -19,6 +19,8 @@ class SummonAssets:
 	I_ONE_TICKET = RuleImage(roi_front=(396,599,76,76), roi_back=(396,599,76,76), threshold=0.8, method="Template matching", file="./tasks/Component/Summon/sm/sm_one_ticket.png")
 	# description 
 	I_SM_CONFIRM = RuleImage(roi_front=(419,617,174,61), roi_back=(419,617,174,61), threshold=0.8, method="Template matching", file="./tasks/Component/Summon/sm/sm_sm_confirm.png")
+	# 抽到的时候出现的 
+	I_SM_CONFIRM_2 = RuleImage(roi_front=(377,630,206,62), roi_back=(377,630,206,62), threshold=0.8, method="Template matching", file="./tasks/Component/Summon/sm/sm_sm_confirm_2.png")
 
 
 	# Ocr Rule Assets

+ 9 - 0
tasks/Component/Summon/sm/image.json

@@ -34,5 +34,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
+  },
+  {
+    "itemName": "sm_confirm_2",
+    "imageName": "sm_sm_confirm_2.png",
+    "roiFront": "377,630,206,62",
+    "roiBack": "377,630,206,62",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "抽到的时候出现的"
   }
 ]

BIN=BIN
tasks/Component/Summon/sm/sm_sm_confirm_2.png


+ 5 - 8
tasks/Component/Summon/summon.py

@@ -60,18 +60,15 @@ class Summon(BaseTask, SummonAssets):
         while 1:
             self.screenshot()
             if self.appear(self.I_SM_CONFIRM):
-                logger.info('Summon one success')
+                self.ui_click_until_disappear(self.I_SM_CONFIRM)
+                break
+            if self.appear(self.I_SM_CONFIRM_2):
+                self.ui_click_until_disappear(self.I_SM_CONFIRM_2)
                 break
             if self.appear(self.I_ONE_TICKET, interval=1):
                 self.summon()
                 continue
-
-        while 1:
-            self.screenshot()
-            if not self.appear(self.I_SM_CONFIRM):
-                break
-            if self.appear_then_click(self.I_SM_CONFIRM):
-                continue
+        logger.info('Summon one success')
 
 
     def back_summon_main(self):

+ 4 - 0
tasks/Restart/assets.py

@@ -35,6 +35,10 @@ class RestartAssets:
 	I_HARVEST_AP = RuleImage(roi_front=(721,486,31,38), roi_back=(206,462,999,81), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_ap.png")
 	# 打开聊天频道会自动关闭 
 	I_HARVEST_CHAT_CLOSE = RuleImage(roi_front=(639,309,35,100), roi_back=(639,309,35,100), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_chat_close.png")
+	# 签到 
+	I_HARVEST_SIGN_3 = RuleImage(roi_front=(291,495,33,36), roi_back=(100,473,1014,70), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_3.png")
+	# description 
+	I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
 
 
 	# Image Rule Assets

BIN=BIN
tasks/Restart/harvest/harvest_harvest_sign_3.png


BIN=BIN
tasks/Restart/harvest/harvest_harvest_sign_4.png


+ 18 - 0
tasks/Restart/harvest/image.json

@@ -106,5 +106,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "打开聊天频道会自动关闭"
+  },
+  {
+    "itemName": "harvest_sign_3",
+    "imageName": "harvest_harvest_sign_3.png",
+    "roiFront": "291,495,33,36",
+    "roiBack": "100,473,1014,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "签到"
+  },
+  {
+    "itemName": "harvest_sign_4",
+    "imageName": "harvest_harvest_sign_4.png",
+    "roiFront": "587,151,100,228",
+    "roiBack": "547,123,185,281",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
 ]

+ 7 - 1
tasks/Restart/login.py

@@ -138,6 +138,12 @@ class LoginHandler(BaseTask, RestartAssets):
             if self.appear_then_click(self.I_HARVEST_SIGN, interval=1):
                 timer_harvest.reset()
                 continue
+            # 某些活动的特殊签到,有空看到就删掉
+            if self.appear_then_click(self.I_HARVEST_SIGN_3, interval=0.7):
+                continue
+            if self.appear_then_click(self.I_HARVEST_SIGN_4, interval=1):
+                timer_harvest.reset()
+                continue
             if self.appear_then_click(self.I_HARVEST_SIGN_2, interval=1):
                 timer_harvest.reset()
                 continue
@@ -170,7 +176,7 @@ class LoginHandler(BaseTask, RestartAssets):
                         timer_harvest.reset()
                         continue
             # 体力
-            if self.appear_then_click(self.I_HARVEST_AP, interval=1):
+            if self.appear_then_click(self.I_HARVEST_AP, interval=1, threshold=0.7):
                 timer_harvest.reset()
                 continue
             # 御魂觉醒加成