Просмотр исходного кода

Merge pull request #1290 from runhey/dev

Automated PR 2025.12.04
huangrunheng 11 месяцев назад
Родитель
Сommit
a84712408a

+ 1 - 1
tasks/Duel/assets.py

@@ -66,7 +66,7 @@ class DuelAssets:
 	I_D_HELP = RuleImage(roi_front=(784,502,32,30), roi_back=(774,489,49,55), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_d_help.png")
 	# 准备 
 	I_D_PREPARE = RuleImage(roi_front=(1127,541,100,100), roi_back=(1127,541,100,100), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_d_prepare.png")
-	# 准备完毕 
+	# 准备完毕  
 	I_D_PREPARE_DONE = RuleImage(roi_front=(495,82,75,55), roi_back=(495,82,75,55), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_d_prepare_done.png")
 	# 战斗数据 
 	I_D_BATTLE_DATA = RuleImage(roi_front=(1068,610,38,60), roi_back=(1068,610,38,60), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_d_battle_data.png")

+ 9 - 0
tasks/Duel/duel/image.json

@@ -61,6 +61,15 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "准备"
+  },
+    {
+    "itemName": "d_prepare_done",
+    "imageName": "duel_d_prepare_done.png",
+    "roiFront": "495,82,75,55",
+    "roiBack": "495,82,75,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "准备完毕 "
   },
   {
     "itemName": "d_battle_data",

+ 6 - 6
tasks/Pets/assets.py

@@ -17,12 +17,12 @@ class PetsAssets:
 	I_PET_CLAW = RuleImage(roi_front=(1171,625,55,56), roi_back=(1171,625,55,56), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_claw.png")
 	# 其乐融融 
 	I_PET_HAPPY = RuleImage(roi_front=(853,614,67,70), roi_back=(853,614,67,70), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_happy.png")
-	# 大餐 
-	I_PET_FEAST = RuleImage(roi_front=(747,619,69,61), roi_back=(747,619,69,61), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_feast.png")
+	# 快速喂养 
+	I_PET_FEAST = RuleImage(roi_front=(849,624,69,49), roi_back=(849,624,69,49), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_feast.png")
 	# 玩耍 
 	I_PET_PLAY = RuleImage(roi_front=(788,500,75,75), roi_back=(788,500,75,75), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_play.png")
-	# 投喂 
-	I_PET_FEED = RuleImage(roi_front=(798,497,77,81), roi_back=(798,497,77,81), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_feed.png")
+	# 喂食 
+	I_PET_FEED = RuleImage(roi_front=(899,511,79,68), roi_back=(884,485,127,123), threshold=0.8, method="Template matching", file="./tasks/Pets/pet/pet_pet_feed.png")
 	# 跳过 
 	I_PET_SKIP = RuleImage(roi_front=(1089,119,72,41), roi_back=(999,42,242,147), threshold=0.65, method="Template matching", file="./tasks/Pets/pet/pet_pet_skip.png")
 	# 退出 
@@ -30,8 +30,8 @@ class PetsAssets:
 
 
 	# Ocr Rule Assets
-	# 投喂的体力 
-	O_PET_FEED_AP = RuleOcr(roi=(730,527,57,33), area=(730,527,57,33), mode="Digit", method="Default", keyword="", name="pet_feed_ap")
+	# 喂食的体力 
+	O_PET_FEED_AP = RuleOcr(roi=(817,538,57,33), area=(817,538,57,33), mode="Digit", method="Default", keyword="", name="pet_feed_ap")
 	# 玩耍的体力 
 	O_PET_PLAY_GOLD = RuleOcr(roi=(681,524,74,40), area=(681,524,74,40), mode="Digit", method="Default", keyword="", name="pet_play_gold")
 

+ 2 - 2
tasks/Pets/config.py

@@ -9,8 +9,8 @@ from tasks.Component.config_base import ConfigBase
 
 class PetsConfig(ConfigBase):
     # 其乐融融
-    pets_happy: bool = Field(default=True)
-    # 大餐
+    # pets_happy: bool = Field(default=True)
+    # 快速喂养
     pets_feast: bool = Field(default=True)
 
 class Pets(ConfigBase):

+ 6 - 6
tasks/Pets/pet/image.json

@@ -29,11 +29,11 @@
   {
     "itemName": "pet_feast",
     "imageName": "pet_pet_feast.png",
-    "roiFront": "747,619,69,61",
-    "roiBack": "747,619,69,61",
+    "roiFront": "849,624,69,49",
+    "roiBack": "849,624,69,49",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "大餐"
+    "description": "快速喂养"
   },
   {
     "itemName": "pet_play",
@@ -47,11 +47,11 @@
   {
     "itemName": "pet_feed",
     "imageName": "pet_pet_feed.png",
-    "roiFront": "798,497,77,81",
-    "roiBack": "798,497,77,81",
+    "roiFront": "899,511,79,68",
+    "roiBack": "884,485,127,123",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "投喂"
+    "description": "喂食"
   },
   {
     "itemName": "pet_skip",

+ 3 - 3
tasks/Pets/pet/ocr.json

@@ -1,12 +1,12 @@
 [
   {
     "itemName": "pet_feed_ap",
-    "roiFront": "730,527,57,33",
-    "roiBack": "730,527,57,33",
+    "roiFront": "817,538,57,33",
+    "roiBack": "817,538,57,33",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",
-    "description": "投喂的体力"
+    "description": "喂食的体力"
   },
   {
     "itemName": "pet_play_gold",

BIN
tasks/Pets/pet/pet_pet_feast.png


BIN
tasks/Pets/pet/pet_pet_feed.png


+ 2 - 2
tasks/Pets/script_task.py

@@ -25,8 +25,8 @@ class ScriptTask(GameUi, PetsAssets):
             if self.appear_then_click(self.I_PET_CLAW, interval=1):
                 continue
         logger.info('Enter Pets')
-        if con.pets_happy:
-            self._play()
+        # if con.pets_happy:
+        #     self._play()
         if con.pets_feast:
             self._feed()
         self.ui_click(self.I_PET_EXIT, self.I_CHECK_MAIN)

+ 7 - 0
tasks/SixRealms/assets.py

@@ -100,6 +100,8 @@ class SixRealmsAssets:
 	I_ISLAND_TAG_FLAG = RuleImage(roi_front=(543,601,100,100), roi_back=(543,601,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_island_tag_flag.png")
 	# 暂时离开六道之门 
 	I_EXIT_SIXREALMS = RuleImage(roi_front=(507.5,308,100,100), roi_back=(507.5,308,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_exit_sixrealms.png")
+	# 选择一个式神加入征伐队伍 
+	I_SELECT_SHIKIGAMI_AND_CONFIRM = RuleImage(roi_front=(499,238,151,57), roi_back=(479,213,199,113), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_shikigami_and_confirm.png")
 
 
 	# Ocr Rule Assets
@@ -140,6 +142,11 @@ class SixRealmsAssets:
 	I_SKILL105 = RuleImage(roi_front=(178,187,80,69), roi_back=(112,149,779,151), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill105.png")
 
 
+	# Swipe Rule Assets
+	# 征伐队伍选择界面底部阵容上拉 
+	S_TEAM_SWIPE_UP = RuleSwipe(roi_front=(520,571,93,98), roi_back=(589,180,100,100), mode="default", name="team_swipe_up")
+
+
 	# Image Rule Assets
 	# 宁息刷新 
 	I_STORE_REFRESH = RuleImage(roi_front=(545,596,46,47), roi_back=(519,568,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_refresh.png")

BIN
tasks/SixRealms/gate1/gate1_select_shikigami_and_confirm.png


+ 9 - 0
tasks/SixRealms/gate1/image.json

@@ -160,5 +160,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "暂时离开六道之门"
+  },
+  {
+    "itemName": "select_shikigami_and_confirm",
+    "imageName": "gate1_select_shikigami_and_confirm.png",
+    "roiFront": "499,238,151,57",
+    "roiBack": "479,213,199,113",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "选择一个式神加入征伐队伍"
   }
 ]

+ 9 - 0
tasks/SixRealms/gate1/swipe.json

@@ -0,0 +1,9 @@
+[
+  {
+    "itemName": "team_swipe_up",
+    "roiFront": "520,571,93,98",
+    "roiBack": "589,180,100,100",
+    "mode": "default",
+    "description": "征伐队伍选择界面底部阵容上拉"
+  }
+]

+ 17 - 0
tasks/SixRealms/moon_sea/moon_sea.py

@@ -104,6 +104,9 @@ class MoonSea(MoonSeaMap, MoonSeaL101, MoonSeaL102, MoonSeaL103, MoonSeaL104, Mo
             self.screenshot()
             if self.in_main():
                 break
+            if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM):
+                self.select_shikigami_and_confirm()
+                continue
             if self.appear_then_click(self.I_MCONINUE, interval=1):
                 continue
 
@@ -149,6 +152,10 @@ class MoonSea(MoonSeaMap, MoonSeaL101, MoonSeaL102, MoonSeaL103, MoonSeaL104, Mo
                 continue
             if self.appear_then_click(self.I_MCONINUE, interval=3):
                 continue
+        # Hook: select one shikigami and confirm before starting
+        if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM):
+            self.select_shikigami_and_confirm()
+
         logger.info("Start Roguelike")
         while 1:
             self.screenshot()
@@ -222,6 +229,16 @@ class MoonSea(MoonSeaMap, MoonSeaL101, MoonSeaL102, MoonSeaL103, MoonSeaL104, Mo
             self.ui_click(self.I_BOSS_SHUTU, stop=self.I_MSTART)
         return True
 
+    def select_shikigami_and_confirm(self):
+        """Select shikigami and confirm to start battle."""
+        while True:
+            self.screenshot()
+            if not self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM):
+                break
+            self.swipe(self.S_TEAM_SWIPE_UP)
+            self.appear_then_click(self.I_MSTART_CONFIRM, interval=2)
+            self.appear_then_click(self.I_COIN2, interval=2)
+
 
 if __name__ == '__main__':
     from module.config.config import Config

+ 3 - 0
tasks/SixRealms/moon_sea/skills.py

@@ -37,6 +37,9 @@ class MoonSeaSkills(BaseTask, SixRealmsAssets):
                 break
             if self.appear(self.I_COIN):
                 break
+            if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM):
+                self.select_shikigami_and_confirm()
+                continue
             if self.appear_then_click(self.I_NPC_FIRE, interval=1):
                 self.device.stuck_record_clear()
                 self.device.stuck_record_add('BATTLE_STATUS_S')