Ver Fonte

fix(DailyTrifles): Improve friend love page detection and navigation

neptine há 2 meses atrás
pai
commit
550b8edb59

+ 2 - 0
tasks/DailyTrifles/assets.py

@@ -25,6 +25,8 @@ class DailyTriflesAssets:
 	I_LUCK_TITLE = RuleImage(roi_front=(600,52,131,67), roi_back=(600,52,131,67), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/love/Screenshots_luck_title.png")
 	# 好友羁绊提升弹窗 
 	I_FRIENDSHIP_UP = RuleImage(roi_front=(1147,80,27,28), roi_back=(1147,80,27,28), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/love/friendship_up.png")
+	#  
+	I_FRIEND_TAB = RuleImage(roi_front=(143,95,97,49), roi_back=(119,82,151,70), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/love/love_friend_tab.png")
 
 
 	# Image Rule Assets

+ 10 - 1
tasks/DailyTrifles/love/image.json

@@ -61,5 +61,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "好友羁绊提升弹窗"
+  },
+  {
+    "itemName": "friend_tab",
+    "imageName": "love_friend_tab.png",
+    "roiFront": "143,95,97,49",
+    "roiBack": "119,82,151,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
   }
-]
+]

BIN
tasks/DailyTrifles/love/love_friend_tab.png


+ 3 - 1
tasks/DailyTrifles/script_task.py

@@ -194,6 +194,8 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
                 continue
             if self.appear_then_click(self.I_L_FRIENDS, interval=1):
                 continue
+            if self.appear_then_click(self.I_FRIEND_TAB, interval=3):
+                continue
         logger.info('Start friend love')
         check_timer = Timer(2)
         check_timer.start()
@@ -307,4 +309,4 @@ if __name__ == '__main__':
     d = Device(c)
     t = ScriptTask(c, d)
 
-    t.check_time()
+    t.run_friend_love()

+ 1 - 1
tasks/GameUi/assets.py

@@ -167,7 +167,7 @@ class GameUiAssets:
 	# description 
 	I_CHECK_ONMYODO = RuleImage(roi_front=(1166,117,84,547), roi_back=(1166,117,84,547), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_onmyodo.png")
 	# description 
-	I_CHECK_FRIENDS = RuleImage(roi_front=(74,628,58,66), roi_back=(74,628,58,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_friends.png")
+	I_CHECK_FRIENDS = RuleImage(roi_front=(27,251,29,47), roi_back=(5,216,86,106), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_friends.png")
 	# description 
 	I_CHECK_DAILY = RuleImage(roi_front=(28,515,58,62), roi_back=(1,487,154,145), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_daily.png")
 	# description 

BIN
tasks/GameUi/page/page_check_friends.png


+ 3 - 3
tasks/GameUi/page/page_img_3.json

@@ -92,10 +92,10 @@
   {
     "itemName": "check_friends",
     "imageName": "page_check_friends.png",
-    "roiFront": "74,628,58,66",
-    "roiBack": "74,628,58,66",
+    "roiFront": "27,251,29,47",
+    "roiBack": "5,216,86,106",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "description"
   },
   {