Răsfoiți Sursa

悬赏协作增加忽略

yEs1do 2 ani în urmă
părinte
comite
d128b6f717

+ 4 - 2
tasks/GlobalGame/assets.py

@@ -11,12 +11,14 @@ class GlobalGameAssets:
 
 
 	# Image Rule Assets
-	# description 
+	# 接受 
 	I_G_ACCEPT = RuleImage(roi_front=(830,407,56,46), roi_back=(798,369,117,110), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_accept.png")
-	# description 
+	# 拒绝 
 	I_G_REJECT = RuleImage(roi_front=(832,508,53,51), roi_back=(808,480,108,101), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_reject.png")
 	# 勾玉 
 	I_G_JADE = RuleImage(roi_front=(661,466,43,46), roi_back=(661,466,43,46), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_jade.png")
+	# 忽略 
+	I_G_IGNORE = RuleImage(roi_front=(773,116,21,21), roi_back=(759,102,48,48), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_ignore.png")
 	# 网络异常 
 	I_NETWORK_ABNORMAL = RuleImage(roi_front=(583,330,221,67), roi_back=(583,330,221,67), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_network_abnormal.png")
 	# 已端口游戏服务器,需要重新连接,这种情况一般是断开很久了 

+ 1 - 0
tasks/GlobalGame/config_emergency.py

@@ -10,6 +10,7 @@ class FriendInvitation(str, Enum):
     ACCEPT = 'accept'
     REJECT = 'reject'
     ONLY_JADE = 'only_jade'  # 仅接受勾玉邀请
+    IGNORE = 'ignore'
 
 class WhenNetworkAbnormal(str, Enum):
     RESTART = 'restart'

BIN
tasks/GlobalGame/gg/gg_g_ignore.png


+ 11 - 2
tasks/GlobalGame/gg/image.json

@@ -6,7 +6,7 @@
     "roiBack": "798,369,117,110",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "接受"
   },
   {
     "itemName": "g_reject",
@@ -15,7 +15,7 @@
     "roiBack": "808,480,108,101",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "拒绝"
   },
   {
     "itemName": "g_jade",
@@ -26,6 +26,15 @@
     "threshold": 0.8,
     "description": "勾玉"
   },
+  {
+    "itemName": "g_ignore",
+    "imageName": "gg_g_ignore.png",
+    "roiFront": "773,116,21,21",
+    "roiBack": "759,102,48,48",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "忽略"
+  },
   {
     "itemName": "network_abnormal",
     "imageName": "gg_network_abnormal.png",

+ 9 - 0
tasks/base_task.py

@@ -98,6 +98,15 @@ class BaseTask(GlobalGameAssets, CostumeBase):
                         continue
                     if not self.appear(self.I_G_ACCEPT):
                         break
+            # 全部忽略
+            elif invite and self.config.global_game.emergency.friend_invitation == FriendInvitation.IGNORE:
+                logger.info(f"Ignore friend invitation")
+                while 1:
+                    self.device.screenshot()
+                    if self.appear_then_click(self.I_G_IGNORE, interval=1):
+                        continue
+                    if not self.appear(self.I_G_IGNORE):
+                        break
             # 有的时候长战斗 点击后会取消战斗状态
             self.device.detect_record = detect_record
             # 判断网络异常