Explorar el Código

Merge pull request #345 from runhey/dev

Dev
yEs1do hace 1 año
padre
commit
47f3f72a3b
Se han modificado 34 ficheros con 389 adiciones y 106 borrados
  1. 4 3
      module/config/config_manual.py
  2. 1 1
      tasks/ActivityShikigami/script_task.py
  3. 1 1
      tasks/CollectiveMissions/assets.py
  4. 2 2
      tasks/CollectiveMissions/cm/image.json
  5. 11 1
      tasks/Component/GeneralBattle/assets.py
  6. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png
  7. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_gold.png
  8. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png
  9. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png
  10. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png
  11. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png
  12. 47 2
      tasks/Component/GeneralBattle/gb/image.json
  13. 18 3
      tasks/Component/GeneralBattle/general_battle.py
  14. 6 0
      tasks/DemonEncounter/assets.py
  15. BIN
      tasks/DemonEncounter/boss/boss_boss_done_check.png
  16. BIN
      tasks/DemonEncounter/boss/boss_boss_gather.png
  17. BIN
      tasks/DemonEncounter/boss/boss_boss_wait.png
  18. 18 0
      tasks/DemonEncounter/boss/image.json
  19. 9 0
      tasks/DemonEncounter/boss/ocr.json
  20. 136 62
      tasks/DemonEncounter/script_task.py
  21. 6 1
      tasks/ExperienceYoukai/assets.py
  22. 7 1
      tasks/ExperienceYoukai/config.py
  23. BIN
      tasks/ExperienceYoukai/ey/ey_exp_win.png
  24. 11 0
      tasks/ExperienceYoukai/ey/image.json
  25. 91 13
      tasks/ExperienceYoukai/script_task.py
  26. 1 1
      tasks/GameUi/assets.py
  27. BIN
      tasks/GameUi/page/page_check_collection.png
  28. 2 2
      tasks/GameUi/page/page_img_3.json
  29. 3 0
      tasks/Hyakkiyakou/slave/hya_device.py
  30. 1 1
      tasks/MemoryScrolls/config.py
  31. 7 5
      tasks/MemoryScrolls/script_task.py
  32. 1 1
      tasks/Secret/script_task.py
  33. 2 2
      tasks/WeeklyTrifles/assets.py
  34. 4 4
      tasks/WeeklyTrifles/collect/image.json

+ 4 - 3
module/config/config_manual.py

@@ -15,10 +15,11 @@ class ConfigManual:
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > ActivityShikigami > WantedQuests
         > ActivityShikigami > WantedQuests
         > BondlingFairyland > EvoZone > GoryouRealm > HeroTest
         > BondlingFairyland > EvoZone > GoryouRealm > HeroTest
-        > TrueOrochi > RichMan
-        > CollectiveMissions
+        > CollectiveMissionsr
         > Pets > TalismanPass > Delegation > Hyakkiyakou
         > Pets > TalismanPass > Delegation > Hyakkiyakou
-        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials
+        > Secret > WeeklyTrifles > MysteryShop > Duel 
+        > TrueOrochi > RichMan
+        > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials
         """
         """
 
 
     DEVICE_OVER_HTTP = False
     DEVICE_OVER_HTTP = False

+ 1 - 1
tasks/ActivityShikigami/script_task.py

@@ -106,7 +106,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
 
 
             # 随机休息
             # 随机休息
             if config.general_climb.random_sleep:
             if config.general_climb.random_sleep:
-                random_sleep()
+                random_sleep(probability=0.2)
             # 点击战斗
             # 点击战斗
             logger.info("Click battle")
             logger.info("Click battle")
             while 1:
             while 1:

+ 1 - 1
tasks/CollectiveMissions/assets.py

@@ -27,7 +27,7 @@ class CollectiveMissionsAssets:
 	# 提交 
 	# 提交 
 	I_CM_PRESENT = RuleImage(roi_front=(559,594,160,66), roi_back=(559,594,160,66), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_present.png")
 	I_CM_PRESENT = RuleImage(roi_front=(559,594,160,66), roi_back=(559,594,160,66), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_present.png")
 	# 判断是否到达 
 	# 判断是否到达 
-	I_CM_RECORDS = RuleImage(roi_front=(1105,626,54,63), roi_back=(1105,626,54,63), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_records.png")
+	I_CM_RECORDS = RuleImage(roi_front=(1032,617,54,63), roi_back=(960,562,193,138), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_records.png")
 	# 将材料拉满的按钮,用来判断是否拉满 
 	# 将材料拉满的按钮,用来判断是否拉满 
 	I_CM_MATTER = RuleImage(roi_front=(860,396,36,37), roi_back=(843,119,66,459), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_matter.png")
 	I_CM_MATTER = RuleImage(roi_front=(860,396,36,37), roi_back=(843,119,66,459), threshold=0.8, method="Template matching", file="./tasks/CollectiveMissions/cm/cm_cm_matter.png")
 	# description 
 	# description 

+ 2 - 2
tasks/CollectiveMissions/cm/image.json

@@ -29,8 +29,8 @@
   {
   {
     "itemName": "cm_records",
     "itemName": "cm_records",
     "imageName": "cm_cm_records.png",
     "imageName": "cm_cm_records.png",
-    "roiFront": "1105,626,54,63",
-    "roiBack": "1105,626,54,63",
+    "roiFront": "1032,617,54,63",
+    "roiBack": "960,562,193,138",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "判断是否到达"
     "description": "判断是否到达"

+ 11 - 1
tasks/Component/GeneralBattle/assets.py

@@ -108,7 +108,17 @@ class GeneralBattleAssets:
 	# 结算时左下角统计图标 
 	# 结算时左下角统计图标 
 	I_REWARD_STATISTICS = RuleImage(roi_front=(51,629,54,59), roi_back=(51,629,54,59), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_statistics.png")
 	I_REWARD_STATISTICS = RuleImage(roi_front=(51,629,54,59), roi_back=(51,629,54,59), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_statistics.png")
 	# 结算金币 
 	# 结算金币 
-	I_REWARD_GOLD = RuleImage(roi_front=(943,312,97,69), roi_back=(943,312,97,69), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	I_REWARD_GOLD = RuleImage(roi_front=(268,178,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	# 结算紫蛇皮 
+	I_REWARD_PURPLE_SNAKE_SKIN = RuleImage(roi_front=(403,177,97,73), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png")
+	# 结算金蛇皮 
+	I_REWARD_GOLD_SNAKE_SKIN = RuleImage(roi_front=(537,176,97,75), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png")
+	# 结算四星青吉鬼 
+	I_REWARD_EXP_SOUL_4 = RuleImage(roi_front=(806,177,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png")
+	# 结算五星御魂 
+	I_REWARD_SOUL_5 = RuleImage(roi_front=(266,533,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png")
+	# 结算六星御魂 
+	I_REWARD_SOUL_6 = RuleImage(roi_front=(942,397,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png")
 	# 针对封魔的特殊 
 	# 针对封魔的特殊 
 	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	# description 
 	# description 

BIN
tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png


BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png


+ 47 - 2
tasks/Component/GeneralBattle/gb/image.json

@@ -182,12 +182,57 @@
   {
   {
     "itemName": "reward_gold",
     "itemName": "reward_gold",
     "imageName": "gb_reward_gold.png",
     "imageName": "gb_reward_gold.png",
-    "roiFront": "943,312,97,69",
-    "roiBack": "943,312,97,69",
+    "roiFront": "268,178,97,69",
+    "roiBack": "254,163,797,261",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "结算金币"
     "description": "结算金币"
   },
   },
+  {
+    "itemName": "reward_purple_snake_skin",
+    "imageName": "gb_reward_purple_snake_skin.png",
+    "roiFront": "403,177,97,73",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算紫蛇皮"
+  },
+  {
+    "itemName": "reward_gold_snake_skin",
+    "imageName": "gb_reward_gold_snake_skin.png",
+    "roiFront": "537,176,97,75",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算金蛇皮"
+  },
+  {
+    "itemName": "reward_exp_soul_4",
+    "imageName": "gb_reward_exp_soul_4.png",
+    "roiFront": "806,177,97,69",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算四星青吉鬼"
+  },
+  {
+    "itemName": "reward_soul_5",
+    "imageName": "gb_reward_soul_5.png",
+    "roiFront": "266,533,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算五星御魂"
+  },
+  {
+    "itemName": "reward_soul_6",
+    "imageName": "gb_reward_soul_6.png",
+    "roiFront": "942,397,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算六星御魂"
+  },
   {
   {
     "itemName": "de_win",
     "itemName": "de_win",
     "imageName": "gb_de_win.png",
     "imageName": "gb_de_win.png",

+ 18 - 3
tasks/Component/GeneralBattle/general_battle.py

@@ -223,10 +223,25 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             self.screenshot()
             self.screenshot()
             # 如果出现领奖励
             # 如果出现领奖励
             action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
             action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
-            if self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or \
-                    self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5):
+            if (self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or
+                self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5)#  or
+                # self.appear_then_click(self.I_REWARD_STATISTICS, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_PURPLE_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_GOLD_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_EXP_SOUL_4, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_5, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_6, action=action_click, interval=1.5)
+                ):
                 continue
                 continue
-            if not self.appear(self.I_REWARD) and not self.appear(self.I_REWARD_GOLD):
+            if (not self.appear(self.I_REWARD) and
+                not self.appear(self.I_REWARD_GOLD)#  and
+                # not self.appear(self.I_REWARD_STATISTICS) and
+                # not self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_GOLD_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_EXP_SOUL_4) and
+                # not self.appear(self.I_REWARD_SOUL_5) and
+                # not self.appear(self.I_REWARD_SOUL_6)
+                ):
                 break
                 break
 
 
         return win
         return win

+ 6 - 0
tasks/DemonEncounter/assets.py

@@ -46,11 +46,17 @@ class DemonEncounterAssets:
 	I_BOSS_KILLED = RuleImage(roi_front=(654,596,35,68), roi_back=(614,537,123,176), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_boss_killed.png")
 	I_BOSS_KILLED = RuleImage(roi_front=(654,596,35,68), roi_back=(614,537,123,176), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_boss_killed.png")
 	# 极逢魔集结挑战 
 	# 极逢魔集结挑战 
 	I_BEST_BOSS_FIRE = RuleImage(roi_front=(1087,562,100,36), roi_back=(1087,562,100,36), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_best_boss_fire.png")
 	I_BEST_BOSS_FIRE = RuleImage(roi_front=(1087,562,100,36), roi_back=(1087,562,100,36), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_best_boss_fire.png")
+	# 战斗失败-等待界面 
+	I_BOSS_WAIT = RuleImage(roi_front=(490,50,350,150), roi_back=(490,50,350,150), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_boss_wait.png")
+	# 战斗结束标识,左下角有战绩按钮 
+	I_BOSS_DONE_CHECK = RuleImage(roi_front=(0,450,100,130), roi_back=(0,450,100,130), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_boss_done_check.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets
 	# 人数 
 	# 人数 
 	O_DE_BOSS_PEOPLE = RuleOcr(roi=(880,591,100,35), area=(880,591,100,35), mode="DigitCounter", method="Default", keyword="", name="de_boss_people")
 	O_DE_BOSS_PEOPLE = RuleOcr(roi=(880,591,100,35), area=(880,591,100,35), mode="DigitCounter", method="Default", keyword="", name="de_boss_people")
+	# Ocr-description 
+	O_DE_BEST_BOSS_PEOPLE = RuleOcr(roi=(902,564,100,31), area=(902,564,100,31), mode="DigitCounter", method="Default", keyword="", name="de_best_boss_people")
 
 
 
 
 	# Click Rule Assets
 	# Click Rule Assets

BIN
tasks/DemonEncounter/boss/boss_boss_done_check.png


BIN
tasks/DemonEncounter/boss/boss_boss_gather.png


BIN
tasks/DemonEncounter/boss/boss_boss_wait.png


+ 18 - 0
tasks/DemonEncounter/boss/image.json

@@ -133,5 +133,23 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "极逢魔集结挑战"
     "description": "极逢魔集结挑战"
+  },
+  {
+    "itemName": "boss_wait",
+    "imageName": "boss_boss_wait.png",
+    "roiFront": "490,50,350,150",
+    "roiBack": "490,50,350,150",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "战斗失败-等待界面"
+  },
+  {
+    "itemName": "boss_done_check",
+    "imageName": "boss_boss_done_check.png",
+    "roiFront": "0,450,100,130",
+    "roiBack": "0,450,100,130",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "战斗结束标识,左下角有战绩按钮"
   }
   }
 ]
 ]

+ 9 - 0
tasks/DemonEncounter/boss/ocr.json

@@ -7,5 +7,14 @@
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
     "description": "人数"
     "description": "人数"
+  },
+  {
+    "itemName": "de_best_boss_people",
+    "roiFront": "902,564,100,31",
+    "roiBack": "902,564,100,31",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
   }
   }
 ]
 ]

+ 136 - 62
tasks/DemonEncounter/script_task.py

@@ -2,12 +2,12 @@
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
 import time
 import time
+from time import sleep
 
 
 from enum import Enum
 from enum import Enum
 from cached_property import cached_property
 from cached_property import cached_property
 from datetime import datetime, timedelta
 from datetime import datetime, timedelta
 
 
-
 from module.logger import logger
 from module.logger import logger
 from module.exception import TaskEnd
 from module.exception import TaskEnd
 from module.base.timer import Timer
 from module.base.timer import Timer
@@ -20,6 +20,7 @@ from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.DemonEncounter.data.answer import Answer
 from tasks.DemonEncounter.data.answer import Answer
 
 
+
 class LanternClass(Enum):
 class LanternClass(Enum):
     BATTLE = 0  # 打怪  --> 无法判断因为怪的图片不一样,用排除法
     BATTLE = 0  # 打怪  --> 无法判断因为怪的图片不一样,用排除法
     BOX = 1  # 开宝箱
     BOX = 1  # 开宝箱
@@ -31,6 +32,7 @@ class LanternClass(Enum):
 
 
 
 
 class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
 class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
+    best_boss_enable = False
 
 
     def run(self):
     def run(self):
         if not self.check_time():
         if not self.check_time():
@@ -50,6 +52,24 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
         self.set_next_run(task='DemonEncounter', success=True, finish=False)
         self.set_next_run(task='DemonEncounter', success=True, finish=False)
         raise TaskEnd('DemonEncounter')
         raise TaskEnd('DemonEncounter')
 
 
+    def init_best_boss_enable(self):
+        today = datetime.now().weekday()
+        if today == 0:
+            # 鬼灵歌姬
+            self.best_boss_enable = self.config.model.demon_encounter.best_demon_boss_config.best_demon_kiryou_select
+        elif today == 1:
+            # 蜃气楼
+            self.best_boss_enable = self.config.model.demon_encounter.best_demon_boss_config.best_demon_shinkirou_select
+        elif today == 2:
+            # 土蜘蛛
+            self.best_boss_enable = self.config.model.demon_encounter.best_demon_boss_config.best_demon_tsuchigumo_select
+        elif today == 3:
+            # 荒骷髅
+            self.best_boss_enable = self.config.model.demon_encounter.best_demon_boss_config.best_demon_gashadokuro_select
+        elif today == 4:
+            # 地震鲶
+            self.best_boss_enable = self.config.model.demon_encounter.best_demon_boss_config.best_demon_namazu_select
+
     def checkout_soul(self):
     def checkout_soul(self):
         """
         """
         切换御魂
         切换御魂
@@ -112,76 +132,133 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
         :return:
         :return:
         """
         """
         logger.hr('Start boss battle', 1)
         logger.hr('Start boss battle', 1)
-        # 判断今天是周几
-        today = datetime.now().weekday()
+        self.init_best_boss_enable()
 
 
-        while 1:
-            self.screenshot()
-            if self.appear(self.I_BOSS_FIRE) or self.appear(self.I_BEST_BOSS_FIRE):
-                current, remain, total = self.O_DE_BOSS_PEOPLE.ocr(self.device.image)
-                if total == 300 and current >= 290:
-                    logger.info('Boss battle people is full')
-                    if not self.appear(self.I_UI_BACK_RED):
-                        logger.warning('Boss battle people is full but no red back')
-                        continue
-                    self.ui_click_until_disappear(self.I_UI_BACK_RED)
-                    # 退出重新选一个没人慢的boss
-                    logger.info('Exit and reselect')
+        def find_boss():
+            find_btn_clicked = False
+            timer_find_boss = Timer(10 * 60)
+            timer_find_boss.start()
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_BOSS_FIRE) or self.appear(self.I_BEST_BOSS_FIRE):
+                    break
+                if timer_find_boss.reached():
+                    logger.warning('find boss timeout')
+                    self.set_next_run(task='DemonEncounter', success=False, finish=True, server=False)
+                    raise TaskEnd('DemonEncounter')
+                if self.appear(self.I_JADE_50):
+                    # 没找到boss但地图中央出现宝箱,导致点击宝箱出现50勾玉购买界面
+                    self.ui_click_until_smt_disappear(self.I_DE_FIND, self.I_JADE_50, interval=1)
+                    continue
+                # if self.appear_then_click(self.I_BOSS_NAMAZU, interval=1):
+                #     continue
+                # if self.appear_then_click(self.I_BOSS_SHINKIRO, interval=1):
+                #     continue
+                # if self.appear_then_click(self.I_BOSS_ODOKURO, interval=1):
+                #     continue
+                # if self.appear_then_click(self.I_BOSS_OBOROGURUMA, interval=1):
+                #     continue
+                # if self.appear_then_click(self.I_BOSS_TSUCHIGUMO, interval=1):
+                #     continue
+                # if self.appear_then_click(self.I_BOSS_SONGSTRESS, interval=1):
+                #     continue
+                if find_btn_clicked and self.click(self.C_DM_BOSS_CLICK, interval=5):
+                    find_btn_clicked = False
                     continue
                     continue
+                if self.best_boss_enable:
+                    self.device.click_record_clear()
+                    if self.appear(self.I_DE_BOSS_BEST) and (not find_btn_clicked):
+                        self.device.click_record_remove(self.I_DE_BOSS_BEST)
+                        if self.click(self.I_DE_BOSS_BEST, interval=4):
+                            logger.info("Finding best boss...")
+                            find_btn_clicked = True
+                        continue
                 else:
                 else:
-                    logger.info('Boss battle people is not full')
+                    if self.appear(self.I_DE_BOSS) and (not find_btn_clicked):
+                        self.device.click_record_remove(self.I_DE_BOSS)
+                        if self.click(self.I_DE_BOSS, interval=4):
+                            logger.info("Finding normal boss...")
+                            find_btn_clicked = True
+                        continue
+            return True
+
+        def enter_boss():
+            logger.info('trying to enter boss...')
+            # 点击集结挑战
+            boss_fire_count = 0  # 五次没点到就意味着今天已经挑战过了
+            ocr_people_item = self.O_DE_BEST_BOSS_PEOPLE if self.best_boss_enable else self.O_DE_BOSS_PEOPLE
+            while 1:
+                self.screenshot()
+
+                if self.appear(self.I_BOSS_FIRE) or self.appear(self.I_BEST_BOSS_FIRE):
+                    current, remain, total = ocr_people_item.ocr(self.device.image)
+                    if total == 300 and current >= 290:
+                        logger.info('Boss battle people is full')
+                        if not self.appear(self.I_UI_BACK_RED):
+                            logger.warning('Boss battle people is full but no red back')
+                            continue
+                        self.ui_click_until_disappear(self.I_UI_BACK_RED)
+                        # 退出重新选一个没人慢的boss
+                        logger.info('Exit and reselect')
+                        return False
+
+                logger.info('Boss battle people is not full')
+
+                if self.appear(self.I_BOSS_CONFIRM):
+                    self.ui_click(self.I_BOSS_NO_SELECT, self.I_BOSS_SELECTED)
+                    self.ui_click(self.I_BOSS_CONFIRM, self.I_BOSS_GATHER)
+                    break
+                if self.appear(self.I_BOSS_GATHER):
                     break
                     break
+                if boss_fire_count >= 5:
+                    logger.warning('Boss battle already done')
+                    self.set_next_run(task='DemonEncounter', success=False, finish=True, server=True)
+                    self.ui_click_until_disappear(self.I_UI_BACK_RED)
+                    raise TaskEnd('DemonEncounter')
 
 
-            if self.appear_then_click(self.I_BOSS_NAMAZU, interval=1):
-                continue
-            if self.appear_then_click(self.I_BOSS_SHINKIRO, interval=1):
-                continue
-            if self.appear_then_click(self.I_BOSS_ODOKURO, interval=1):
-                continue
-            if self.appear_then_click(self.I_BOSS_OBOROGURUMA, interval=1):
-                continue
-            if self.appear_then_click(self.I_BOSS_TSUCHIGUMO, interval=1):
-                continue
-            if self.appear_then_click(self.I_BOSS_SONGSTRESS, interval=1):
-                continue
-            if self.config.demon_encounter.best_demon_boss_config.enable and today < 5:
-                if self.appear_then_click(self.I_DE_BOSS_BEST, interval=4):
+                if (self.appear_then_click(self.I_BOSS_FIRE, interval=3)
+                        or self.appear_then_click(self.I_BEST_BOSS_FIRE, interval=3)):
+                    boss_fire_count += 1
                     continue
                     continue
-            else:
-                if self.appear_then_click(self.I_DE_BOSS, interval=4):
-                    continue
-            if self.click(self.C_DM_BOSS_CLICK, interval=1.7):
-                continue
+            return True
 
 
-        logger.info('Boss battle start')
-        # 点击集结挑战
-        boss_fire_count = 0  # 五次没点到就意味着今天已经挑战过了
-        while 1:
-            self.screenshot()
-            if self.appear(self.I_BOSS_CONFIRM):
-                self.ui_click(self.I_BOSS_NO_SELECT, self.I_BOSS_SELECTED)
-                self.ui_click(self.I_BOSS_CONFIRM, self.I_BOSS_GATHER)
-                break
-            if self.appear(self.I_BOSS_GATHER):
-                break
-            if boss_fire_count >= 5:
-                logger.warning('Boss battle already done')
-                self.ui_click_until_disappear(self.I_UI_BACK_RED)
+        fail_count = 0
+        while True:
+            if fail_count >= 5:
                 return
                 return
-            if self.appear_then_click(self.I_BOSS_FIRE, interval=3) or self.appear_then_click(self.I_BEST_BOSS_FIRE, interval=3):
-                boss_fire_count += 1
+            if not find_boss():
                 continue
                 continue
+            if enter_boss():
+                break
+            fail_count += 1
+
         logger.info('Boss battle confirm and enter')
         logger.info('Boss battle confirm and enter')
         # 等待挑战, 5秒也是等
         # 等待挑战, 5秒也是等
         time.sleep(5)
         time.sleep(5)
-        self.device.stuck_record_add('BATTLE_STATUS_S')
-        self.wait_until_disappear(self.I_BOSS_GATHER)
-        self.device.stuck_record_clear()
-        self.device.stuck_record_add('BATTLE_STATUS_S')
         # 延长时间并在战斗结束后改回来
         # 延长时间并在战斗结束后改回来
         self.device.stuck_timer_long = Timer(480, count=480).start()
         self.device.stuck_timer_long = Timer(480, count=480).start()
+        #
         config = self.con
         config = self.con
-        self.run_general_battle(config)
+        while True:
+            self.screenshot()
+            if self.appear(self.I_BOSS_DONE_CHECK):
+                break
+            if self.appear(self.I_BOSS_GATHER):
+                self.device.stuck_record_clear()
+                self.device.stuck_record_add('BATTLE_STATUS_S')
+                logger.info('Boss Gathering...')
+                sleep(2)
+                continue
+            if self.appear(self.I_BOSS_WAIT):
+                logger.info('Boss battle failed, waiting for 2 seconds...')
+                sleep(2)
+                continue
+            if self.appear(self.I_PREPARE_HIGHLIGHT):
+                self.run_general_battle(config)
+                continue
+            logger.info('Unknown scene Or Boss fight failed.waiting for Prepare_Button appear...')
+            self.wait_until_appear(self.I_PREPARE_HIGHLIGHT, wait_time=2)
+
         self.device.stuck_timer_long = Timer(300, count=300).start()
         self.device.stuck_timer_long = Timer(300, count=300).start()
 
 
         # 等待回到挑战boss主界面
         # 等待回到挑战boss主界面
@@ -256,7 +333,7 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
     def con(self) -> GeneralBattleConfig:
     def con(self) -> GeneralBattleConfig:
         return GeneralBattleConfig()
         return GeneralBattleConfig()
 
 
-    def check_lantern(self, index: int=1):
+    def check_lantern(self, index: int = 1):
         """
         """
         检查灯笼的类型
         检查灯笼的类型
         :param index: 四个灯笼,从1开始
         :param index: 四个灯笼,从1开始
@@ -363,7 +440,7 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
             if self.click(target_click, interval=1):
             if self.click(target_click, interval=1):
                 continue
                 continue
         logger.info('Question answering Start')
         logger.info('Question answering Start')
-        for i in range(1,4):
+        for i in range(1, 4):
             # 还未测试题库无法识别的情况
             # 还未测试题库无法识别的情况
             logger.hr(f'Answer {i}', 3)
             logger.hr(f'Answer {i}', 3)
             answer_click = answer()
             answer_click = answer()
@@ -386,9 +463,7 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
                 if not self.appear(self.I_LETTER_CLOSE):
                 if not self.appear(self.I_LETTER_CLOSE):
                     time.sleep(0.5)
                     time.sleep(0.5)
                     self.screenshot()
                     self.screenshot()
-                    if self.appear(self.I_LETTER_CLOSE):
-                        continue
-                    else:
+                    if not self.appear(self.I_LETTER_CLOSE):
                         logger.warning('Answer finish')
                         logger.warning('Answer finish')
                         return
                         return
 
 
@@ -454,7 +529,6 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
             if self.click(target_click, interval=2.3):
             if self.click(target_click, interval=2.3):
                 continue
                 continue
 
 
-
     def check_time(self):
     def check_time(self):
         """
         """
         检查时间是否正确,
         检查时间是否正确,

+ 6 - 1
tasks/ExperienceYoukai/assets.py

@@ -8,5 +8,10 @@ from module.atom.list import RuleList
 # This file was automatically generated by ./dev_tools/assets_extract.py.
 # This file was automatically generated by ./dev_tools/assets_extract.py.
 # Don't modify it manually.
 # Don't modify it manually.
 class ExperienceYoukaiAssets: 
 class ExperienceYoukaiAssets: 
-	pass
+
+
+	# Image Rule Assets
+	# 经验妖怪的赢 
+	I_EXP_WIN = RuleImage(roi_front=(380,44,100,100), roi_back=(380,44,100,100), threshold=0.8, method="Template matching", file="./tasks/ExperienceYoukai/ey/ey_exp_win.png")
+
 
 

+ 7 - 1
tasks/ExperienceYoukai/config.py

@@ -5,7 +5,13 @@ from pydantic import BaseModel, Field
 
 
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase
 from tasks.Component.config_base import ConfigBase
+from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
+
+class ExperienceYoukaiConfig(ConfigBase):
+    buff_exp_50_click: bool = Field(default=False)
+    buff_exp_100_click: bool = Field(default=False)
 
 
 class ExperienceYoukai(ConfigBase):
 class ExperienceYoukai(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)
-
+    experience_youkai: ExperienceYoukaiConfig = Field(default_factory=ExperienceYoukaiConfig)
+    switch_soul: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)

BIN
tasks/ExperienceYoukai/ey/ey_exp_win.png


+ 11 - 0
tasks/ExperienceYoukai/ey/image.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "exp_win",
+    "imageName": "ey_exp_win.png",
+    "roiFront": "380,44,100,100",
+    "roiBack": "380,44,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "经验妖怪的赢"
+  }
+]

+ 91 - 13
tasks/ExperienceYoukai/script_task.py

@@ -15,27 +15,104 @@ from tasks.Component.GeneralRoom.general_room import GeneralRoom
 from tasks.Component.GeneralInvite.general_invite import GeneralInvite
 from tasks.Component.GeneralInvite.general_invite import GeneralInvite
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 from tasks.ExperienceYoukai.assets import ExperienceYoukaiAssets
 from tasks.ExperienceYoukai.assets import ExperienceYoukaiAssets
+from tasks.ExperienceYoukai.config import ExperienceYoukaiConfig
+
 
 
 class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, ExperienceYoukaiAssets):
 class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul, ExperienceYoukaiAssets):
 
 
     def run(self):
     def run(self):
-        con = self.config.experience_youkai
-        self.ui_get_current_page()
-        self.ui_goto(page_team)
-        self.check_zones('经验妖怪')
+        # 切换御魂
+        if self.config.experience_youkai.switch_soul.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(self.config.experience_youkai.switch_soul.switch_group_team)
+
+        if self.config.experience_youkai.switch_soul.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(self.config.experience_youkai.switch_soul.group_name,
+                                         self.config.experience_youkai.switch_soul.team_name)
+
+        # 开启加成
+        con = self.config.experience_youkai.experience_youkai
+        if con.buff_exp_50_click or con.buff_exp_100_click:
+            self.ui_get_current_page()
+            self.ui_goto(page_main)
+            self.open_buff()
+            if con.buff_exp_50_click:
+                self.exp_50()
+            if con.buff_exp_100_click:
+                self.exp_100()
+            self.close_buff()
+        count = 0
+        while count < 2:
+            self.ui_get_current_page()
+            self.ui_goto(page_team)
+            self.check_zones('经验妖怪')
+            # 开始
+            if not self.create_room():
+                self.experience_exit(con)
+            self.ensure_public()
+            self.create_ensure()
+            # 进入到了房间里面
+            wait_timer = Timer(50)
+            wait_timer.start()
+            while 1:
+                self.screenshot()
 
 
-        self.exp_exit()
+                if not self.is_in_room():
+                    continue
+                if wait_timer.reached():
+                    # 超过时间依然挑战
+                    logger.warning('Wait for too long and start the challenge')
+                    self.click_fire()
+                    count += 1
+                    self.run_general_battle()
+                    break
+                if not self.appear(self.I_ADD_5_1):
+                    # 有人进来了,可以进行挑战
+                    logger.info('There is someone in the room and start the challenge')
+                    self.click_fire()
+                    count += 1
+                    self.run_general_battle()
+                    break
+        # 退出 (要么是在组队界面要么是在庭院)
+        self.experience_exit(con)
 
 
-    def exp_exit(self, con=None):
+    def battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        # 重写
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        self.device.click_record_clear()
+        # 战斗过程 随机点击和滑动 防封
+        logger.info("Start battle process")
+        while 1:
+            self.screenshot()
+            if self.appear_then_click(self.I_PREPARE_HIGHLIGHT,interval=1):
+                logger.info('click prepare')
+            if self.appear(self.I_DE_WIN):
+                logger.info('Win battle')
+                self.ui_click_until_disappear(self.I_DE_WIN)
+                return True
+            if self.appear(self.I_EXP_WIN):
+                logger.info('Win battle')
+                self.ui_click_until_disappear(self.I_EXP_WIN)
+                return True
+
+            if self.appear(self.I_FALSE):
+                logger.warning('False battle')
+                self.ui_click_until_disappear(self.I_FALSE)
+                return False
+
+    def experience_exit(self, con):
         self.ui_get_current_page()
         self.ui_get_current_page()
         self.ui_goto(page_main)
         self.ui_goto(page_main)
-        # if con.buff_gold_50_click or con.buff_gold_100_click:
-        #     self.open_buff()
-        #     if con.buff_gold_50_click:
-        #         self.gold_50(False)
-        #     if con.buff_gold_100_click:
-        #         self.gold_100(False)
-        #     self.close_buff()
+        if con.buff_exp_50_click or con.buff_exp_100_click:
+            self.open_buff()
+            if con.buff_exp_50_click:
+                self.exp_50(False)
+            if con.buff_exp_100_click:
+                self.exp_100(False)
+            self.close_buff()
 
 
         self.set_next_run(task='ExperienceYoukai', success=True, finish=False)
         self.set_next_run(task='ExperienceYoukai', success=True, finish=False)
         raise TaskEnd('ExperienceYoukai')
         raise TaskEnd('ExperienceYoukai')
@@ -43,6 +120,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
 if __name__ == '__main__':
 if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device
+
     c = Config('oas1')
     c = Config('oas1')
     d = Device(c)
     d = Device(c)
     t = ScriptTask(c, d)
     t = ScriptTask(c, d)

+ 1 - 1
tasks/GameUi/assets.py

@@ -159,7 +159,7 @@ class GameUiAssets:
 	# description 
 	# 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")
 	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 
 	# description 
-	I_CHECK_COLLECTION = RuleImage(roi_front=(471,618,100,100), roi_back=(471,618,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.png")
+	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")
 	# description 
 	# 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")
 	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 
 	# description 

BIN
tasks/GameUi/page/page_check_collection.png


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

@@ -137,8 +137,8 @@
   {
   {
     "itemName": "check_collection",
     "itemName": "check_collection",
     "imageName": "page_check_collection.png",
     "imageName": "page_check_collection.png",
-    "roiFront": "471,618,100,100",
-    "roiBack": "471,618,100,100",
+    "roiFront": "380,620,100,100",
+    "roiBack": "380,620,100,100",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"

+ 3 - 0
tasks/Hyakkiyakou/slave/hya_device.py

@@ -1,5 +1,6 @@
 import timeit
 import timeit
 import numpy as np
 import numpy as np
+from datetime import datetime
 
 
 from module.base.timer import Timer
 from module.base.timer import Timer
 from module.logger import logger
 from module.logger import logger
@@ -38,6 +39,8 @@ class HyaDevice(BaseTask):
             logger.error('Fast screenshot check timer reached')
             logger.error('Fast screenshot check timer reached')
             logger.error('Five minutes have not ended, the game is probably stuck, please check the game')
             logger.error('Five minutes have not ended, the game is probably stuck, please check the game')
             raise GameStuckError
             raise GameStuckError
+        if self.config.script.error.save_error:
+            self.device.screenshot_deque.append({'time': datetime.now(), 'image': self.device.image})
         return self.device.image
         return self.device.image
 
 
     def fast_click(self, x: int, y: int, control_method: ControlMethod = ControlMethod.WINDOW_MESSAGE) -> None:
     def fast_click(self, x: int, y: int, control_method: ControlMethod = ControlMethod.WINDOW_MESSAGE) -> None:

+ 1 - 1
tasks/MemoryScrolls/config.py

@@ -19,7 +19,7 @@ class ScrollNumber(str, Enum):
 
 
 class MemoryScrollsConfig(ConfigBase):
 class MemoryScrollsConfig(ConfigBase):
     scroll_number: ScrollNumber = Field(default=ScrollNumber.ONE, description='scroll_number_help')
     scroll_number: ScrollNumber = Field(default=ScrollNumber.ONE, description='scroll_number_help')
-    auto_delay_exploration: bool = Field(default=True, description='指定绘卷结束后,自动延迟探索任务,避免长时间无意义执行')
+    auto_close_exploration: bool = Field(default=False, description='指定绘卷结束后,自动关闭探索任务,避免长时间无意义执行')
 
 
 class MemoryScrolls(ConfigBase):
 class MemoryScrolls(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 7 - 5
tasks/MemoryScrolls/script_task.py

@@ -82,11 +82,13 @@ class ScriptTask(GameUi, MemoryScrollsAssets):
         else:
         else:
             logger.info(f'Scroll {con.scroll_number.name} is already completed')
             logger.info(f'Scroll {con.scroll_number.name} is already completed')
             self.set_next_run(task='MemoryScrolls', success=False)
             self.set_next_run(task='MemoryScrolls', success=False)
-            if con.auto_delay_exploration:
-                # 自动延迟探索任务
-                logger.info('Auto delay exploration task after Memory Scrolls completion')
-                next_run=datetime.now() + timedelta(days=1)
-                self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
+            if con.auto_close_exploration:
+                # 自动关闭探索任务
+                logger.info('Auto close exploration task after Memory Scrolls completion')
+                self.config.exploration.scheduler.enable = False
+                self.config.save()
+                # next_run=datetime.now() + timedelta(days=1)
+                # self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
         # 返回绘卷主界面
         # 返回绘卷主界面
         self.ui_click_until_disappear(self.I_MS_CLOSE, interval=1)
         self.ui_click_until_disappear(self.I_MS_CLOSE, interval=1)
         logger.info('Closed Memory Scrolls contribution page')
         logger.info('Closed Memory Scrolls contribution page')

+ 1 - 1
tasks/Secret/script_task.py

@@ -84,7 +84,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, SecretAssets):
                     logger.warning('You have completed the weekly trifles, skip')
                     logger.warning('You have completed the weekly trifles, skip')
                     break
                     break
                 text = self.O_SE_TOTAL_TIME.ocr_single(self.device.image)
                 text = self.O_SE_TOTAL_TIME.ocr_single(self.device.image)
-                if '总耗时' in text:
+                if '尚未' not in text:
                     logger.warning('You have completed the weekly trifles, skip')
                     logger.warning('You have completed the weekly trifles, skip')
                     break
                     break
                 continue
                 continue

+ 2 - 2
tasks/WeeklyTrifles/assets.py

@@ -51,7 +51,7 @@ class WeeklyTriflesAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 点击“式神” 
 	# 点击“式神” 
-	I_WT_SHIKIAGMI = RuleImage(roi_front=(494,650,56,49), roi_back=(494,650,56,49), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_shikiagmi.png")
+	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_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")
 	# 点击分享 
 	# 点击分享 
@@ -61,7 +61,7 @@ class WeeklyTriflesAssets:
 	# 百妖风物鉴 
 	# 百妖风物鉴 
 	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_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_COLLECT_WECHAT = RuleImage(roi_front=(386,619,70,63), roi_back=(386,619,70,63), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/collect/collect_wt_collect_wechat.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_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")
 	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")
 
 

+ 4 - 4
tasks/WeeklyTrifles/collect/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "wt_shikiagmi",
     "itemName": "wt_shikiagmi",
     "imageName": "collect_wt_shikiagmi.png",
     "imageName": "collect_wt_shikiagmi.png",
-    "roiFront": "494,650,56,49",
-    "roiBack": "494,650,56,49",
+    "roiFront": "280,620,920,100",
+    "roiBack": "280,620,920,100",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "点击“式神”"
     "description": "点击“式神”"
@@ -47,8 +47,8 @@
   {
   {
     "itemName": "wt_collect_wechat",
     "itemName": "wt_collect_wechat",
     "imageName": "collect_wt_collect_wechat.png",
     "imageName": "collect_wt_collect_wechat.png",
-    "roiFront": "386,619,70,63",
-    "roiBack": "386,619,70,63",
+    "roiFront": "280,600,440,100",
+    "roiBack": "280,600,440,100",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "微信分享"
     "description": "微信分享"