Kaynağa Gözat

fix(WeeklyTrifles):更新图像识别资源坐标和命名

-调整 WeeklyTrifles 任务中多个RuleImage 的roi_front 和 roi_back 坐标- 重命名图像资源变量以更准确反映其用途(如 I_WT_SCROLL →I_WT_SHARE)
-删除过期的模板图片文件(collect_wt_scroll_1.png, collect_wt_scroll_2.png等)
-更新 GameUi模块中的 I_CHECK_COLLECTION坐标配置
-优化图像识别阈值和方法参数

变更动机:适配游戏界面更新,提高图像识别准确性和稳定性
yuyuyuyuyu 6 ay önce
ebeveyn
işleme
f6b3aed19a

+ 1 - 1
tasks/GameUi/assets.py

@@ -172,7 +172,7 @@ class GameUiAssets:
 	# description 
 	I_CHECK_TEAM = RuleImage(roi_front=(32,585,82,90), roi_back=(32,585,82,90), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_team.png")
 	# description 
-	I_CHECK_COLLECTION = RuleImage(roi_front=(380,620,100,100), roi_back=(380,620,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.png")
+	I_CHECK_COLLECTION = RuleImage(roi_front=(579,639,63,65), roi_back=(118,626,1162,94), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.png")
 	# description 
 	I_BACK_Y = RuleImage(roi_front=(15,4,57,52), roi_back=(1,2,100,91), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_y.png")
 	# description 

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

@@ -137,8 +137,8 @@
   {
     "itemName": "check_collection",
     "imageName": "page_check_collection.png",
-    "roiFront": "380,620,100,100",
-    "roiBack": "380,620,100,100",
+    "roiFront": "579,639,63,65",
+    "roiBack": "118,626,1162,94",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 3 - 7
tasks/WeeklyTrifles/assets.py

@@ -57,15 +57,11 @@ class WeeklyTriflesAssets:
 	# 点击“式神” 
 	I_WT_SHIKIAGMI = RuleImage(roi_front=(280,620,920,100), roi_back=(280,620,920,100), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_shikiagmi.png")
 	# 点击式神绘卷 
-	I_WT_SCROLL = RuleImage(roi_front=(1128,615,77,67), roi_back=(1128,615,77,67), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_scroll.png")
-	# 点击分享 
-	I_WT_COLLECT = RuleImage(roi_front=(1170,606,78,83), roi_back=(1170,606,78,83), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_collect.png")
+	I_WT_SHARE = RuleImage(roi_front=(336,280,50,48), roi_back=(266,241,199,141), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_share.png")
 	# 百鬼夜行图 
-	I_WT_SCROLL_1 = RuleImage(roi_front=(1180,27,28,121), roi_back=(1159,12,65,152), threshold=0.7, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_scroll_1.png")
-	# 百妖风物鉴 
-	I_WT_SCROLL_2 = RuleImage(roi_front=(1182,24,24,122), roi_back=(1163,12,63,155), threshold=0.7, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_scroll_2.png")
+	I_WT_LOGO = RuleImage(roi_front=(1106,72,34,111), roi_back=(1065,11,117,207), threshold=0.7, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_logo.png")
 	# 微信分享 
-	I_WT_COLLECT_WECHAT = RuleImage(roi_front=(280,600,440,100), roi_back=(280,600,440,100), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_collect_wechat.png")
+	I_WT_COLLECT_WECHAT = RuleImage(roi_front=(325,645,50,45), roi_back=(119,594,1045,126), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_collect_wechat.png")
 	# 二维码 
 	I_WT_QR_CODE = RuleImage(roi_front=(473,161,336,96), roi_back=(404,112,483,168), threshold=0.65, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_qr_code.png")
 

BIN
tasks/WeeklyTrifles/collect/collect_wt_collect.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_collect_wechat.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_logo.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_scroll.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_scroll_1.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_scroll_2.png


BIN
tasks/WeeklyTrifles/collect/collect_wt_share.png


+ 10 - 28
tasks/WeeklyTrifles/collect/image.json

@@ -9,46 +9,28 @@
     "description": "点击“式神”"
   },
   {
-    "itemName": "wt_scroll",
-    "imageName": "collect_wt_scroll.png",
-    "roiFront": "1128,615,77,67",
-    "roiBack": "1128,615,77,67",
+    "itemName": "wt_share",
+    "imageName": "collect_wt_share.png",
+    "roiFront": "336,280,50,48",
+    "roiBack": "266,241,199,141",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击式神绘卷"
   },
   {
-    "itemName": "wt_collect",
-    "imageName": "collect_wt_collect.png",
-    "roiFront": "1170,606,78,83",
-    "roiBack": "1170,606,78,83",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "点击分享"
-  },
-  {
-    "itemName": "wt_scroll_1",
-    "imageName": "collect_wt_scroll_1.png",
-    "roiFront": "1180,27,28,121",
-    "roiBack": "1159,12,65,152",
+    "itemName": "wt_logo",
+    "imageName": "collect_wt_logo.png",
+    "roiFront": "1106,72,34,111",
+    "roiBack": "1065,11,117,207",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "百鬼夜行图"
   },
-  {
-    "itemName": "wt_scroll_2",
-    "imageName": "collect_wt_scroll_2.png",
-    "roiFront": "1182,24,24,122",
-    "roiBack": "1163,12,63,155",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "百妖风物鉴"
-  },
   {
     "itemName": "wt_collect_wechat",
     "imageName": "collect_wt_collect_wechat.png",
-    "roiFront": "280,600,440,100",
-    "roiBack": "280,600,440,100",
+    "roiFront": "325,645,50,45",
+    "roiBack": "119,594,1045,126",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "微信分享"

+ 2 - 9
tasks/WeeklyTrifles/script_task.py

@@ -69,15 +69,12 @@ class ScriptTask(GameUi, WeeklyTriflesAssets):
         # 一路进去
         while 1:
             self.screenshot()
-            if self.appear(self.I_WT_COLLECT):
+            if self.appear(self.I_WT_LOGO):
                 break
             if self.appear_then_click(self.I_WT_SHIKIAGMI, interval=1):
                 continue
-            if self.appear_then_click(self.I_WT_SCROLL, interval=1):
+            if self.appear_then_click(self.I_WT_SHARE, interval=1):
                 continue
-        # 确认的是百鬼夜行图
-        self.ui_click(self.I_WT_SCROLL_2, self.I_WT_SCROLL_1)
-        logger.info('Confirm the picture is 百妖风物鉴')
         # 点击分享
         while 1:
             self.screenshot()
@@ -85,8 +82,6 @@ class ScriptTask(GameUi, WeeklyTriflesAssets):
                 break
             if self.appear_then_click(self.I_WT_COLLECT_WECHAT, interval=1):
                 continue
-            if self.appear_then_click(self.I_WT_COLLECT, interval=5):
-                continue
         logger.info('Click share')
         get_timer = Timer(3)
         get_timer.start()
@@ -109,8 +104,6 @@ class ScriptTask(GameUi, WeeklyTriflesAssets):
                 break
             if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
                 continue
-            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1):
-                continue
             if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=1):
                 continue