Browse Source

Merge pull request #357 from runhey/dev

Dev
yEs1do 1 năm trước cách đây
mục cha
commit
f8160aefc7

+ 1 - 1
module/config/config_manual.py

@@ -19,7 +19,7 @@ class ConfigManual:
         > Pets > TalismanPass > Delegation > Hyakkiyakou
         > Pets > TalismanPass > Delegation > Hyakkiyakou
         > Secret > WeeklyTrifles > MysteryShop > Duel 
         > Secret > WeeklyTrifles > MysteryShop > Duel 
         > TrueOrochi > RichMan
         > TrueOrochi > RichMan
-        > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials
+        > MetaDemon > FrogBoss > FloatParade > Quiz > KittyShop > DyeTrials > MemoryScrolls
         """
         """
 
 
     DEVICE_OVER_HTTP = False
     DEVICE_OVER_HTTP = False

BIN
tasks/ActivityShikigami/as/as_ap.png


BIN
tasks/ActivityShikigami/as/as_ap_activity.png


BIN
tasks/ActivityShikigami/as/as_battle.png


BIN
tasks/ActivityShikigami/as/as_fire.png


BIN
tasks/ActivityShikigami/as/as_lock.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_unlock.png


+ 16 - 16
tasks/ActivityShikigami/as/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "shi",
     "itemName": "shi",
     "imageName": "as_shi.png",
     "imageName": "as_shi.png",
-    "roiFront": "519,165,33,34",
-    "roiBack": "507,150,66,67",
+    "roiFront": "520,202,33,34",
+    "roiBack": "506,185,66,67",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "进入活动"
     "description": "进入活动"
@@ -20,8 +20,8 @@
   {
   {
     "itemName": "battle",
     "itemName": "battle",
     "imageName": "as_battle.png",
     "imageName": "as_battle.png",
-    "roiFront": "937,308,35,135",
-    "roiBack": "892,214,153,315",
+    "roiFront": "458,238,35,135",
+    "roiBack": "407,147,153,315",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "进入爬塔"
     "description": "进入爬塔"
@@ -47,8 +47,8 @@
   {
   {
     "itemName": "lock",
     "itemName": "lock",
     "imageName": "as_lock.png",
     "imageName": "as_lock.png",
-    "roiFront": "732,613,25,28",
-    "roiBack": "707,592,76,80",
+    "roiFront": "801,662,25,28",
+    "roiBack": "774,639,76,80",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "上锁图标"
     "description": "上锁图标"
@@ -56,8 +56,8 @@
   {
   {
     "itemName": "unlock",
     "itemName": "unlock",
     "imageName": "as_unlock.png",
     "imageName": "as_unlock.png",
-    "roiFront": "730,613,28,28",
-    "roiBack": "704,595,78,74",
+    "roiFront": "799,661,28,28",
+    "roiBack": "774,645,78,74",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "还未上锁图片"
     "description": "还未上锁图片"
@@ -65,8 +65,8 @@
   {
   {
     "itemName": "fire",
     "itemName": "fire",
     "imageName": "as_fire.png",
     "imageName": "as_fire.png",
-    "roiFront": "1052,562,84,46",
-    "roiBack": "1021,521,150,160",
+    "roiFront": "1129,611,84,46",
+    "roiBack": "1097,552,150,160",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "点击战斗"
     "description": "点击战斗"
@@ -74,8 +74,8 @@
   {
   {
     "itemName": "ap",
     "itemName": "ap",
     "imageName": "as_ap.png",
     "imageName": "as_ap.png",
-    "roiFront": "1065,612,23,24",
-    "roiBack": "1044,589,103,71",
+    "roiFront": "1091,557,23,24",
+    "roiBack": "1081,532,103,71",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "体力按钮"
     "description": "体力按钮"
@@ -83,8 +83,8 @@
   {
   {
     "itemName": "ap_activity",
     "itemName": "ap_activity",
     "imageName": "as_ap_activity.png",
     "imageName": "as_ap_activity.png",
-    "roiFront": "1147,667,21,27",
-    "roiBack": "1095,654,84,54",
+    "roiFront": "1133,557,21,27",
+    "roiBack": "1108,542,84,54",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "活动体力"
     "description": "活动体力"
@@ -92,8 +92,8 @@
   {
   {
     "itemName": "switch",
     "itemName": "switch",
     "imageName": "as_switch.png",
     "imageName": "as_switch.png",
-    "roiFront": "1241,669,23,23",
-    "roiBack": "1207,652,69,56",
+    "roiFront": "1214,559,23,23",
+    "roiBack": "1204,541,69,56",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "切换按键"
     "description": "切换按键"

+ 6 - 6
tasks/ActivityShikigami/as/ocr.json

@@ -1,8 +1,8 @@
 [
 [
   {
   {
     "itemName": "remain_ap",
     "itemName": "remain_ap",
-    "roiFront": "1102,26,57,26",
-    "roiBack": "1102,26,57,26",
+    "roiFront": "942,16,68,32",
+    "roiBack": "942,16,68,32",
     "mode": "DigitCounter",
     "mode": "DigitCounter",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
@@ -10,8 +10,8 @@
   },
   },
   {
   {
     "itemName": "remain_ap_activity",
     "itemName": "remain_ap_activity",
-    "roiFront": "715,18,95,28",
-    "roiBack": "715,18,95,28",
+    "roiFront": "534,18,70,28",
+    "roiBack": "534,18,70,28",
     "mode": "DigitCounter",
     "mode": "DigitCounter",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
@@ -28,8 +28,8 @@
   },
   },
   {
   {
     "itemName": "remain_ap_activity2",
     "itemName": "remain_ap_activity2",
-    "roiFront": "756,17,52,29",
-    "roiBack": "756,17,52,29",
+    "roiFront": "534,18,71,29",
+    "roiBack": "534,18,71,29",
     "mode": "Digit",
     "mode": "Digit",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",

+ 11 - 11
tasks/ActivityShikigami/assets.py

@@ -45,27 +45,27 @@ class ActivityShikigamiAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 进入活动 
 	# 进入活动 
-	I_SHI = RuleImage(roi_front=(519,165,33,34), roi_back=(507,150,66,67), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
+	I_SHI = RuleImage(roi_front=(520,202,33,34), roi_back=(506,185,66,67), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_shi.png")
 	# 左上角返回 
 	# 左上角返回 
 	I_BACK_GREEN = RuleImage(roi_front=(27,19,34,38), roi_back=(2,1,170,75), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_back_green.png")
 	I_BACK_GREEN = RuleImage(roi_front=(27,19,34,38), roi_back=(2,1,170,75), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_back_green.png")
 	# 进入爬塔 
 	# 进入爬塔 
-	I_BATTLE = RuleImage(roi_front=(937,308,35,135), roi_back=(892,214,153,315), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
+	I_BATTLE = RuleImage(roi_front=(458,238,35,135), roi_back=(407,147,153,315), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
 	# 进入爬塔1 
 	# 进入爬塔1 
 	I_BATTLE_1 = RuleImage(roi_front=(541,663,191,26), roi_back=(506,622,273,96), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle_1.png")
 	I_BATTLE_1 = RuleImage(roi_front=(541,663,191,26), roi_back=(506,622,273,96), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle_1.png")
 	# 归鹿之途 
 	# 归鹿之途 
 	I_DRUM = RuleImage(roi_front=(327,627,145,28), roi_back=(256,462,301,232), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_drum.png")
 	I_DRUM = RuleImage(roi_front=(327,627,145,28), roi_back=(256,462,301,232), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_drum.png")
 	# 上锁图标 
 	# 上锁图标 
-	I_LOCK = RuleImage(roi_front=(732,613,25,28), roi_back=(707,592,76,80), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_lock.png")
+	I_LOCK = RuleImage(roi_front=(801,662,25,28), roi_back=(774,639,76,80), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_lock.png")
 	# 还未上锁图片 
 	# 还未上锁图片 
-	I_UNLOCK = RuleImage(roi_front=(730,613,28,28), roi_back=(704,595,78,74), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
+	I_UNLOCK = RuleImage(roi_front=(799,661,28,28), roi_back=(774,645,78,74), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
 	# 点击战斗 
 	# 点击战斗 
-	I_FIRE = RuleImage(roi_front=(1052,562,84,46), roi_back=(1021,521,150,160), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
+	I_FIRE = RuleImage(roi_front=(1129,611,84,46), roi_back=(1097,552,150,160), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
 	# 体力按钮 
 	# 体力按钮 
-	I_AP = RuleImage(roi_front=(1065,612,23,24), roi_back=(1044,589,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
+	I_AP = RuleImage(roi_front=(1091,557,23,24), roi_back=(1081,532,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
 	# 活动体力 
 	# 活动体力 
-	I_AP_ACTIVITY = RuleImage(roi_front=(1147,667,21,27), roi_back=(1095,654,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
+	I_AP_ACTIVITY = RuleImage(roi_front=(1133,557,21,27), roi_back=(1108,542,84,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap_activity.png")
 	# 切换按键 
 	# 切换按键 
-	I_SWITCH = RuleImage(roi_front=(1241,669,23,23), roi_back=(1207,652,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
+	I_SWITCH = RuleImage(roi_front=(1214,559,23,23), roi_back=(1204,541,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
 	# 购买活动的体力 
 	# 购买活动的体力 
 	I_BUY_JADE = RuleImage(roi_front=(1004,192,38,42), roi_back=(836,619,38,42), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_buy_jade.png")
 	I_BUY_JADE = RuleImage(roi_front=(1004,192,38,42), roi_back=(836,619,38,42), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_buy_jade.png")
 	# 增加到最大 
 	# 增加到最大 
@@ -76,13 +76,13 @@ class ActivityShikigamiAssets:
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets
 	# 体力的数量检测 
 	# 体力的数量检测 
-	O_REMAIN_AP = RuleOcr(roi=(1102,26,57,26), area=(1102,26,57,26), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
+	O_REMAIN_AP = RuleOcr(roi=(942,16,68,32), area=(942,16,68,32), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
 	# 活动体力的剩余检测 
-	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(715,18,95,28), area=(715,18,95,28), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
+	O_REMAIN_AP_ACTIVITY = RuleOcr(roi=(534,18,70,28), area=(534,18,70,28), mode="DigitCounter", method="Default", keyword="", name="remain_ap_activity")
 	# 还有多少次购买体力的机会 
 	# 还有多少次购买体力的机会 
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 	# 活动票数(没有百分比) 
 	# 活动票数(没有百分比) 
-	O_REMAIN_AP_ACTIVITY2 = RuleOcr(roi=(756,17,52,29), area=(756,17,52,29), mode="Digit", method="Default", keyword="", name="remain_ap_activity2")
+	O_REMAIN_AP_ACTIVITY2 = RuleOcr(roi=(534,18,71,29), area=(534,18,71,29), mode="Digit", method="Default", keyword="", name="remain_ap_activity2")
 	# Ocr-description 
 	# Ocr-description 
 	O_ENTRY_ACTIVITY = RuleOcr(roi=(71,241,98,32), area=(71,241,98,32), mode="Single", method="Default", keyword="阵练演武", name="entry_activity")
 	O_ENTRY_ACTIVITY = RuleOcr(roi=(71,241,98,32), area=(71,241,98,32), mode="Single", method="Default", keyword="阵练演武", name="entry_activity")
 
 

+ 4 - 3
tasks/ActivityShikigami/script_task.py

@@ -128,9 +128,10 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
                 logger.info("General battle success")
                 logger.info("General battle success")
 
 
         self.main_home()
         self.main_home()
-        self.open_buff()
-        self.soul(is_open=False)
-        self.close_buff()
+        # 某些活动需要开启御魂加成
+        # self.open_buff()
+        # self.soul(is_open=False)
+        # self.close_buff()
         if config.general_climb.active_souls_clean:
         if config.general_climb.active_souls_clean:
             self.set_next_run(task='SoulsTidy', success=False, finish=False, target=datetime.now())
             self.set_next_run(task='SoulsTidy', success=False, finish=False, target=datetime.now())
         self.set_next_run(task="ActivityShikigami", success=True)
         self.set_next_run(task="ActivityShikigami", success=True)

+ 3 - 3
tasks/Component/BaseActivity/config_activity.py

@@ -65,6 +65,6 @@ class GeneralClimb(ConfigBase):
             return def_value
             return def_value
         return def_value
         return def_value
 
 
-    @field_validator('ap_mode', mode='after')
-    def check_mode(cls, value):
-        return ApMode.AP_GAME
+    # @field_validator('ap_mode', mode='after')
+    # def check_mode(cls, value):
+    #     return ApMode.AP_GAME

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

@@ -82,7 +82,7 @@ class GeneralBattleAssets:
 	# 确认预设的队伍 
 	# 确认预设的队伍 
 	I_PRESET_ENSURE = RuleImage(roi_front=(352,643,141,50), roi_back=(305,625,236,83), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_preset_ensure.png")
 	I_PRESET_ENSURE = RuleImage(roi_front=(352,643,141,50), roi_back=(305,625,236,83), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_preset_ensure.png")
 	# 选择buff 
 	# 选择buff 
-	I_BUFF = RuleImage(roi_front=(115,657,42,50), roi_back=(106,641,67,77), threshold=0.7, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff.png")
+	I_BUFF = RuleImage(roi_front=(115,670,39,36), roi_back=(107,668,55,49), threshold=0.7, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff.png")
 	# 觉醒加成 
 	# 觉醒加成 
 	I_BUFF_AWAKEN = RuleImage(roi_front=(373,126,383,53), roi_back=(373,126,383,53), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff_awaken.png")
 	I_BUFF_AWAKEN = RuleImage(roi_front=(373,126,383,53), roi_back=(373,126,383,53), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff_awaken.png")
 	# 御魂加成 
 	# 御魂加成 

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


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

@@ -65,8 +65,8 @@
   {
   {
     "itemName": "buff",
     "itemName": "buff",
     "imageName": "gb_buff.png",
     "imageName": "gb_buff.png",
-    "roiFront": "115,657,42,50",
-    "roiBack": "106,641,67,77",
+    "roiFront": "115,670,39,36",
+    "roiBack": "107,668,55,49",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "选择buff"
     "description": "选择buff"

+ 2 - 2
tasks/DemonEncounter/script_task.py

@@ -461,14 +461,14 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
                     break
                     break
                 # 如果没有出现红色关闭按钮,说明答题结束
                 # 如果没有出现红色关闭按钮,说明答题结束
                 if not self.appear(self.I_LETTER_CLOSE):
                 if not self.appear(self.I_LETTER_CLOSE):
-                    time.sleep(0.5)
+                    time.sleep(1.8)
                     self.screenshot()
                     self.screenshot()
                     if not self.appear(self.I_LETTER_CLOSE):
                     if not self.appear(self.I_LETTER_CLOSE):
                         logger.warning('Answer finish')
                         logger.warning('Answer finish')
                         return
                         return
 
 
                 # 一直点击
                 # 一直点击
-                self.click(answer_click, interval=1)
+                self.click(answer_click, interval=1.5)
             time.sleep(0.5)
             time.sleep(0.5)
 
 
     def _battle(self, target_click):
     def _battle(self, target_click):

+ 2 - 0
tasks/GoldYoukai/script_task.py

@@ -88,6 +88,8 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
         logger.info("Start battle process")
         logger.info("Start battle process")
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
+            if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1):
+                logger.info('click prepare')
             if self.appear(self.I_DE_WIN):
             if self.appear(self.I_DE_WIN):
                 logger.info('Win battle')
                 logger.info('Win battle')
                 self.ui_click_until_disappear(self.I_DE_WIN)
                 self.ui_click_until_disappear(self.I_DE_WIN)

+ 3 - 3
tasks/MemoryScrolls/assets.py

@@ -52,10 +52,10 @@ class MemoryScrollsAssets:
 
 
 	# Swipe Rule Assets
 	# Swipe Rule Assets
 	# 小碎片拉满 
 	# 小碎片拉满 
-	S_MS_SWIPE_S = RuleSwipe(roi_front=(838,199,37,27), roi_back=(1131,188,66,52), mode="default", name="ms_swipe_s")
+	S_MS_SWIPE_S = RuleSwipe(roi_front=(838,199,37,27), roi_back=(1176,171,80,81), mode="default", name="ms_swipe_s")
 	# 中碎片拉满 
 	# 中碎片拉满 
-	S_MS_SWIPE_M = RuleSwipe(roi_front=(838,352,37,23), roi_back=(1133,339,56,53), mode="default", name="ms_swipe_m")
+	S_MS_SWIPE_M = RuleSwipe(roi_front=(838,352,37,23), roi_back=(1176,326,83,84), mode="default", name="ms_swipe_m")
 	# 大碎片拉满 
 	# 大碎片拉满 
-	S_MS_SWIPE_L = RuleSwipe(roi_front=(839,503,34,25), roi_back=(1130,492,51,48), mode="default", name="ms_swipe_l")
+	S_MS_SWIPE_L = RuleSwipe(roi_front=(839,503,34,25), roi_back=(1175,473,78,85), mode="default", name="ms_swipe_l")
 
 
 
 

+ 3 - 3
tasks/MemoryScrolls/ms/swipe.json

@@ -2,21 +2,21 @@
   {
   {
     "itemName": "ms_swipe_s",
     "itemName": "ms_swipe_s",
     "roiFront": "838,199,37,27",
     "roiFront": "838,199,37,27",
-    "roiBack": "1131,188,66,52",
+    "roiBack": "1176,171,80,81",
     "mode": "default",
     "mode": "default",
     "description": "小碎片拉满"
     "description": "小碎片拉满"
   },
   },
   {
   {
     "itemName": "ms_swipe_m",
     "itemName": "ms_swipe_m",
     "roiFront": "838,352,37,23",
     "roiFront": "838,352,37,23",
-    "roiBack": "1133,339,56,53",
+    "roiBack": "1176,326,83,84",
     "mode": "default",
     "mode": "default",
     "description": "中碎片拉满"
     "description": "中碎片拉满"
   },
   },
   {
   {
     "itemName": "ms_swipe_l",
     "itemName": "ms_swipe_l",
     "roiFront": "839,503,34,25",
     "roiFront": "839,503,34,25",
-    "roiBack": "1130,492,51,48",
+    "roiBack": "1175,473,78,85",
     "mode": "default",
     "mode": "default",
     "description": "大碎片拉满"
     "description": "大碎片拉满"
   }
   }

+ 1 - 1
tasks/RealmRaid/script_task.py

@@ -296,7 +296,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
         cu, res, total = self.O_NUMBER.ocr(self.device.image)
         cu, res, total = self.O_NUMBER.ocr(self.device.image)
 
 
         if total == 0:
         if total == 0:
-            self.reward_detect_click(False)
+            self.reward_detect_click(True)
             # 增加出现聊天框遮挡,处理奖励之后,重新识别票数
             # 增加出现聊天框遮挡,处理奖励之后,重新识别票数
             cu, res, total = self.O_NUMBER.ocr(self.device.image)
             cu, res, total = self.O_NUMBER.ocr(self.device.image)
         if cu == 0 and cu + res == total:
         if cu == 0 and cu + res == total:

+ 2 - 2
tasks/Restart/assets.py

@@ -41,9 +41,9 @@ class RestartAssets:
 	I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
 	I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
 	# 点击随机御魂 
 	# 点击随机御魂 
 	I_HARVEST_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_1.png")
 	I_HARVEST_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_1.png")
-	# 选择第一个御魂 
+	# 选择中间第二个御魂 
 	I_HARVEST_SOUL_2 = RuleImage(roi_front=(586,561,112,47), roi_back=(570,547,139,71), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_2.png")
 	I_HARVEST_SOUL_2 = RuleImage(roi_front=(586,561,112,47), roi_back=(570,547,139,71), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_2.png")
-	# description 
+	# 六星御魂标志 
 	I_HARVEST_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_3.png")
 	I_HARVEST_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul_3.png")
 	# 寮包 
 	# 寮包 
 	I_HARVEST_GUILD_REWARD = RuleImage(roi_front=(244,498,41,42), roi_back=(200,403,817,157), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_guild_reward.png")
 	I_HARVEST_GUILD_REWARD = RuleImage(roi_front=(244,498,41,42), roi_back=(200,403,817,157), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_guild_reward.png")

+ 2 - 2
tasks/Restart/harvest/image.json

@@ -141,7 +141,7 @@
     "roiBack": "570,547,139,71",
     "roiBack": "570,547,139,71",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
-    "description": "选择第一个御魂"
+    "description": "选择中间第二个御魂"
   },
   },
   {
   {
     "itemName": "harvest_soul_3",
     "itemName": "harvest_soul_3",
@@ -150,7 +150,7 @@
     "roiBack": "302,472,216,60",
     "roiBack": "302,472,216,60",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
-    "description": "description"
+    "description": "六星御魂标志"
   },
   },
   {
   {
     "itemName": "harvest_guild_reward",
     "itemName": "harvest_guild_reward",

+ 3 - 3
tasks/Restart/login.py

@@ -148,7 +148,7 @@ class LoginHandler(BaseTask, RestartAssets):
         :return: 如果没有发现任何奖励后退出
         :return: 如果没有发现任何奖励后退出
         """
         """
         logger.hr('Harvest')
         logger.hr('Harvest')
-        timer_harvest = Timer(5)  # 如果连续3秒没有发现任何奖励,退出
+        timer_harvest = Timer(5)  # 如果连续5秒没有发现任何奖励,退出
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
 
 
@@ -273,7 +273,7 @@ class LoginHandler(BaseTask, RestartAssets):
                 continue
                 continue
             # 自选御魂
             # 自选御魂
             if self.appear(self.I_HARVEST_SOUL_1):
             if self.appear(self.I_HARVEST_SOUL_1):
-                logger.info('Select soul 1')
+                logger.info('Select soul 2')
                 self.ui_click(self.I_HARVEST_SOUL_1, stop=self.I_HARVEST_SOUL_2)
                 self.ui_click(self.I_HARVEST_SOUL_1, stop=self.I_HARVEST_SOUL_2)
                 self.ui_click(self.I_HARVEST_SOUL_2, stop=self.I_HARVEST_SOUL_3, interval=3)
                 self.ui_click(self.I_HARVEST_SOUL_2, stop=self.I_HARVEST_SOUL_3, interval=3)
                 self.ui_click_until_disappear(click=self.I_HARVEST_SOUL_3)
                 self.ui_click_until_disappear(click=self.I_HARVEST_SOUL_3)
@@ -285,7 +285,7 @@ class LoginHandler(BaseTask, RestartAssets):
                 timer_harvest.reset()
                 timer_harvest.reset()
                 continue
                 continue
 
 
-            # 三秒内没有发现任何奖励,退出
+            # 五秒内没有发现任何奖励,退出
             if not timer_harvest.started():
             if not timer_harvest.started():
                 timer_harvest.start()
                 timer_harvest.start()
             else:
             else:

+ 6 - 0
tasks/TalismanPass/assets.py

@@ -33,5 +33,11 @@ class TalismanPassAssets:
 	I_TP_EXP = RuleImage(roi_front=(922,254,32,36), roi_back=(884,215,100,331), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_exp.png")
 	I_TP_EXP = RuleImage(roi_front=(922,254,32,36), roi_back=(884,215,100,331), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_exp.png")
 	# 溢出确认 
 	# 溢出确认 
 	I_OVERFLOW_CONFIRME = RuleImage(roi_front=(585,410,116,44), roi_back=(585,410,116,44), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_overflow_confirme.png")
 	I_OVERFLOW_CONFIRME = RuleImage(roi_front=(585,410,116,44), roi_back=(585,410,116,44), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_overflow_confirme.png")
+	# 点击随机御魂 
+	I_TP_SOUL_1 = RuleImage(roi_front=(248,501,34,37), roi_back=(165,389,929,168), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_1.png")
+	# 选择中间第二个御魂 
+	I_TP_SOUL_2 = RuleImage(roi_front=(582,438,115,48), roi_back=(570,427,139,71), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_2.png")
+	# 六星御魂标志 
+	I_TP_SOUL_3 = RuleImage(roi_front=(313,489,188,33), roi_back=(302,472,216,60), threshold=0.8, method="Template matching", file="./tasks/TalismanPass/tp/tp_tp_soul_3.png")
 
 
 
 

+ 1 - 0
tasks/TalismanPass/config.py

@@ -19,6 +19,7 @@ class LevelReward(str, Enum):
 
 
 class TalismanConfig(BaseModel):
 class TalismanConfig(BaseModel):
     level_reward: LevelReward = Field(default=LevelReward.TWO)
     level_reward: LevelReward = Field(default=LevelReward.TWO)
+    harvest_soul: bool = Field(default=False, description='收获1500签御魂')
 
 
 class TalismanPass(ConfigBase):
 class TalismanPass(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 28 - 1
tasks/TalismanPass/script_task.py

@@ -25,7 +25,10 @@ class ScriptTask(GameUi, TalismanPassAssets):
             self.get_all()
             self.get_all()
         # 收取花合战等级奖励
         # 收取花合战等级奖励
         self.get_flower(con.level_reward)
         self.get_flower(con.level_reward)
-
+        # 收取1500签御魂
+        if con.harvest_soul:
+            self.ui_goto(page_main)
+            self.harvest_soul()
         self.set_next_run(task='TalismanPass', success=True, finish=True)
         self.set_next_run(task='TalismanPass', success=True, finish=True)
         raise TaskEnd('TalismanPass')
         raise TaskEnd('TalismanPass')
 
 
@@ -91,6 +94,30 @@ class ScriptTask(GameUi, TalismanPassAssets):
         if self.appear(self.I_TP_GOTO) or self.appear(self.I_TP_EXP):
         if self.appear(self.I_TP_GOTO) or self.appear(self.I_TP_EXP):
             return True
             return True
         return False
         return False
+    
+    def harvest_soul(self):
+        """
+        获得1500签御魂奖励
+        :return: 如果没有发现御魂奖励则退出
+        """
+        logger.hr('Harvest soul')
+        timer_harvest = Timer(5)  # 如果连续5秒没有发现任何奖励,退出
+        while 1:
+            self.screenshot()
+            # 自选御魂
+            if self.appear(self.I_TP_SOUL_1):
+                logger.info('Select soul 2')
+                self.ui_click(self.I_TP_SOUL_1, stop=self.I_TP_SOUL_2)
+                self.ui_click(self.I_TP_SOUL_2, stop=self.I_TP_SOUL_3, interval=3)
+                self.ui_click_until_disappear(click=self.I_TP_SOUL_3)
+                timer_harvest.reset()
+            # 五秒内没有发现任何奖励,退出
+            if not timer_harvest.started():
+                timer_harvest.start()
+            else:
+                if timer_harvest.reached():
+                    logger.info('No more reward')
+                    return
 
 
 
 
 
 

+ 27 - 0
tasks/TalismanPass/tp/image.json

@@ -97,5 +97,32 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "溢出确认"
     "description": "溢出确认"
+  },
+  {
+    "itemName": "tp_soul_1",
+    "imageName": "tp_tp_soul_1.png",
+    "roiFront": "248,501,34,37",
+    "roiBack": "165,389,929,168",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击随机御魂"
+  },
+  {
+    "itemName": "tp_soul_2",
+    "imageName": "tp_tp_soul_2.png",
+    "roiFront": "582,438,115,48",
+    "roiBack": "570,427,139,71",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "选择中间第二个御魂"
+  },
+  {
+    "itemName": "tp_soul_3",
+    "imageName": "tp_tp_soul_3.png",
+    "roiFront": "313,489,188,33",
+    "roiBack": "302,472,216,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "六星御魂标志"
   }
   }
 ]
 ]

BIN
tasks/TalismanPass/tp/tp_tp_soul_1.png


BIN
tasks/TalismanPass/tp/tp_tp_soul_2.png


BIN
tasks/TalismanPass/tp/tp_tp_soul_3.png