Ver Fonte

组队挑战&麒麟

yEs1do há 1 ano atrás
pai
commit
5e0c8e7d5f

+ 1 - 1
tasks/Component/GeneralInvite/assets.py

@@ -18,7 +18,7 @@ class GeneralInviteAssets:
 	# description 
 	# description 
 	I_FIRE_FAIL = RuleImage(roi_front=(1177,604,81,74), roi_back=(1177,604,81,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_fail.png")
 	I_FIRE_FAIL = RuleImage(roi_front=(1177,604,81,74), roi_back=(1177,604,81,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_fail.png")
 	# description 
 	# description 
-	I_FIRE = RuleImage(roi_front=(1179,602,81,87), roi_back=(1179,602,81,87), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire.png")
+	I_FIRE = RuleImage(roi_front=(1179,602,81,74), roi_back=(1179,602,81,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire.png")
 	# 锁定阵容的图片 
 	# 锁定阵容的图片 
 	I_LOCK = RuleImage(roi_front=(29,644,29,32), roi_back=(29,644,29,32), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_lock.png")
 	I_LOCK = RuleImage(roi_front=(29,644,29,32), roi_back=(29,644,29,32), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_lock.png")
 	# 还没有锁定阵容 
 	# 还没有锁定阵容 

BIN
tasks/Component/GeneralInvite/gi/gi_fire.png


+ 2 - 2
tasks/Component/GeneralInvite/gi/image.json

@@ -29,8 +29,8 @@
   {
   {
     "itemName": "fire",
     "itemName": "fire",
     "imageName": "gi_fire.png",
     "imageName": "gi_fire.png",
-    "roiFront": "1179,602,81,87",
-    "roiBack": "1179,602,81,87",
+    "roiFront": "1179,602,81,74",
+    "roiBack": "1179,602,81,74",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"

+ 3 - 3
tasks/Hunt/assets.py

@@ -24,11 +24,11 @@ class HuntAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 麒麟的挑战 
 	# 麒麟的挑战 
-	I_KIRIN_CHALLAGE = RuleImage(roi_front=(1064,559,117,108), roi_back=(1064,559,117,108), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_challage.png")
+	I_KIRIN_CHALLAGE = RuleImage(roi_front=(1134,597,90,54), roi_back=(1134,597,90,54), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_challage.png")
 	# 集合 
 	# 集合 
 	I_KIRIN_GATHER = RuleImage(roi_front=(28,480,75,64), roi_back=(28,480,75,64), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_gather.png")
 	I_KIRIN_GATHER = RuleImage(roi_front=(28,480,75,64), roi_back=(28,480,75,64), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_gather.png")
-	# 已结束 
-	I_KIRIN_END = RuleImage(roi_front=(1049,579,143,59), roi_back=(1049,579,143,59), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_end.png")
+	# 麒麟已挑战 
+	I_KIRIN_END = RuleImage(roi_front=(1126,601,104,44), roi_back=(1126,601,104,44), threshold=0.8, method="Template matching", file="./tasks/Hunt/kirin/kirin_kirin_end.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets

+ 5 - 5
tasks/Hunt/kirin/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "kirin_challage",
     "itemName": "kirin_challage",
     "imageName": "kirin_kirin_challage.png",
     "imageName": "kirin_kirin_challage.png",
-    "roiFront": "1064,559,117,108",
-    "roiBack": "1064,559,117,108",
+    "roiFront": "1134,597,90,54",
+    "roiBack": "1134,597,90,54",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "麒麟的挑战"
     "description": "麒麟的挑战"
@@ -20,10 +20,10 @@
   {
   {
     "itemName": "kirin_end",
     "itemName": "kirin_end",
     "imageName": "kirin_kirin_end.png",
     "imageName": "kirin_kirin_end.png",
-    "roiFront": "1049,579,143,59",
-    "roiBack": "1049,579,143,59",
+    "roiFront": "1126,601,104,44",
+    "roiBack": "1126,601,104,44",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
-    "description": "已结束"
+    "description": "麒麟已挑战"
   }
   }
 ]
 ]

BIN
tasks/Hunt/kirin/kirin_kirin_challage.png


BIN
tasks/Hunt/kirin/kirin_kirin_end.png


+ 33 - 36
tasks/Hunt/script_task.py

@@ -67,26 +67,30 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
             self.tomorrow_kirin_day = True
             self.tomorrow_kirin_day = True
 
 
         now = datetime.now()
         now = datetime.now()
-        # 如果时间在00:00-19:00 之间则设定时间为当天的自定义时间,返回False
-        if now.time() < time(19, 0):
-            if self.kirin_day:
-                logger.info('Today is the Kirin day')
+        # 如果时间在可执行时间(麒麟日6:00、阴界日19:00)之前则设定时间为当天的自定义时间,返回False
+        # 如果是在可执行时间则返回True
+        if self.kirin_day:
+            logger.info('Today is the Kirin day')
+            if now.time() < time(6, 0):
                 self.custom_next_run(task='Hunt', custom_time=self.con_time.kirin_time, time_delta=0)
                 self.custom_next_run(task='Hunt', custom_time=self.con_time.kirin_time, time_delta=0)
+                raise TaskEnd('Hunt')
+            # 如果是麒麟日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
+            elif now.time() > time(23, 0):
+                self.plan_tomorrow_hunt()
+                raise TaskEnd('Hunt')
             else:
             else:
-                logger.info('Today is the Netherworld day')
-                self.custom_next_run(task='Hunt', custom_time=self.con_time.netherworld_time, time_delta=0)
-            raise TaskEnd('Hunt')
-        # 如果是麒麟日在21:00-23:59之间则设定时间为明天的自定义时间,返回False
-        elif now.time() > time(21, 0) and self.kirin_day:
-            self.plan_tomorrow_hunt()
-            raise TaskEnd('Hunt')
-        # 如果是阴界日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
-        elif now.time() > time(23, 0) and not self.kirin_day:
-            self.plan_tomorrow_hunt()
-            raise TaskEnd('Hunt')
-        # 如果是在19:00-21:00之间则返回True
+                return True
         else:
         else:
-            return True
+            logger.info('Today is the Netherworld day')
+            if now.time() < time(19, 0):
+                self.custom_next_run(task='Hunt', custom_time=self.con_time.netherworld_time, time_delta=0)
+                raise TaskEnd('Hunt')
+            # 如果是阴界日在23:00-23:59之间则设定时间为明天的自定义时间,返回False
+            elif now.time() > time(23, 0):
+                self.plan_tomorrow_hunt()
+                raise TaskEnd('Hunt')
+            else:
+                return True
 
 
     def plan_tomorrow_hunt(self):
     def plan_tomorrow_hunt(self):
         # 安排次日狩猎战,便于复用
         # 安排次日狩猎战,便于复用
@@ -99,29 +103,22 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
 
 
     def kirin(self):
     def kirin(self):
         logger.hr('kirin', 2)
         logger.hr('kirin', 2)
-        # TODO: 没有碰到:(1)麒麟未开 (2)麒麟已经挑战完毕
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
-
-            if self.appear(self.I_KIRIN_END):
-                # 你的阴阳寮已经打过的麒麟了
-                logger.warning('Your guild have already challenged the Kirin')
-                self.plan_tomorrow_hunt()
-                raise TaskEnd('Hunt')
-            if self.appear_then_click(self.I_KIRIN_CHALLAGE, interval=0.9):
+            if self.appear(self.I_FIRE):
+                self.click_fire()
                 break
                 break
-            if self.click(self.C_HUNT_ENTER, interval=2.9):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=0.9):
                 continue
                 continue
-        logger.info('Arrive the Kirin')
-        self.ui_click(self.I_KIRIN_CHALLAGE, self.I_KIRIN_GATHER)
-        # 等待进入战斗
-        # 等待挑战, 5秒也是等
-        sleep(5)
-        self.device.stuck_record_add('BATTLE_STATUS_S')
-        self.wait_until_disappear(self.I_KIRIN_GATHER)
-        self.device.stuck_record_clear()
-        self.device.stuck_record_add('BATTLE_STATUS_S')
-        self.run_general_battle()
+            if self.appear_then_click(self.I_KIRIN_CHALLAGE, interval=1.5):
+                continue
+            if self.appear(self.I_KIRIN_END):
+                # 今日已挑战
+                logger.warning('Today have already challenged the Kirin')
+                self.ui_click_until_disappear(self.I_UI_BACK_YELLOW)
+                return
+        logger.info('Start battle')
+        self.run_general_battle()        
 
 
 
 
     def netherworld(self):
     def netherworld(self):