Explorar el Código

fix: Click to access the chat channel

runhey hace 3 años
padre
commit
288ef529cf

+ 1 - 1
tasks/GameUi/game_ui.py

@@ -121,7 +121,7 @@ class GameUi(BaseTask, GameUiAssets):
                     return page
             # Try to close unknown page
             for close in self.ui_close:
-                if self.appear_then_click(self.I_FORM_TEAM, interval=1):
+                if self.appear_then_click(close, interval=1):
                     logger.info('Trying to switch to supported page')
                     timeout = Timer(10, count=20).start()
             # Unknown page but able to handle

+ 2 - 0
tasks/Restart/assets.py

@@ -33,6 +33,8 @@ class RestartAssets:
 	I_HARVEST_MAIL_TITLE = RuleImage(roi_front=(520,48,245,41), roi_back=(520,48,245,41), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail_title.png")
 	# description 
 	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")
 
 
 	# Image Rule Assets

BIN
tasks/Restart/harvest/harvest_harvest_chat_close.png


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

@@ -97,5 +97,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
+  },
+  {
+    "itemName": "harvest_chat_close",
+    "imageName": "harvest_harvest_chat_close.png",
+    "roiFront": "639,309,35,100",
+    "roiBack": "639,309,35,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "打开聊天频道会自动关闭"
   }
 ]

+ 5 - 1
tasks/Restart/login.py

@@ -117,7 +117,11 @@ class LoginHandler(BaseTask, RestartAssets):
                 timer_harvest.reset()
                 continue
             # 获得奖励
-            if self.appear_then_click(self.I_UI_AWARD, interval=1):
+            if self.appear_then_click(self.I_UI_AWARD, interval=0.2):
+                timer_harvest.reset()
+                continue
+            # 偶尔会打开到聊天频道
+            if self.appear_then_click(self.I_HARVEST_CHAT_CLOSE, interval=1):
                 timer_harvest.reset()
                 continue