runhey 3 лет назад
Родитель
Сommit
5627590645

+ 2 - 0
tasks/Hunt/assets.py

@@ -36,5 +36,7 @@ class HuntAssets:
 	I_NW = RuleImage(roi_front=(1060,602,100,100), roi_back=(1060,602,100,100), threshold=0.8, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw.png")
 	# 点击挑战 
 	I_NW_CHALLAGE = RuleImage(roi_front=(306,590,171,63), roi_back=(306,590,171,63), threshold=0.8, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw_challage.png")
+	# 今日已挑战 
+	I_NW_DONE = RuleImage(roi_front=(308,600,156,41), roi_back=(308,600,156,41), threshold=0.9, method="Template matching", file="./tasks/Hunt/netherworld/netherworld_nw_done.png")
 
 

+ 9 - 0
tasks/Hunt/netherworld/image.json

@@ -16,5 +16,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击挑战"
+  },
+  {
+    "itemName": "nw_done",
+    "imageName": "netherworld_nw_done.png",
+    "roiFront": "308,600,156,41",
+    "roiBack": "308,600,156,41",
+    "method": "Template matching",
+    "threshold": 0.9,
+    "description": "今日已挑战"
   }
 ]

BIN
tasks/Hunt/netherworld/netherworld_nw_done.png


+ 5 - 0
tasks/Hunt/script_task.py

@@ -117,6 +117,11 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
                 continue
             if self.appear_then_click(self.I_NW_CHALLAGE, interval=1.5):
                 continue
+            if self.appear(self.I_NW_DONE):
+                # 今日已挑战
+                logger.warning('Today have already challenged the Netherworld')
+                self.ui_click_until_disappear(self.I_UI_BACK_RED)
+                return
         logger.info('Start battle')
         self.run_general_battle()