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

Merge branch 'runhey:dev' into dev

Jacky Wei 2 лет назад
Родитель
Сommit
f9cc3944f9

+ 6 - 0
tasks/BondlingFairyland/script_task.py

@@ -39,6 +39,12 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
         # 引用配置
         cong = self.config.bondling_fairyland
 
+        # 御魂切换方式一
+        if cong.switch_soul_config.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(cong.switch_soul_config.switch_group_team)
+          # 御魂切换方式二
         if cong.switch_soul_config.enable_switch_by_name:
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)

+ 1 - 1
tasks/FloatParade/assets.py

@@ -33,7 +33,7 @@ class FloatParadeAssets:
 	I_FP_TASKS = RuleImage(roi_front=(1175,617,79,76), roi_back=(1162,605,100,100), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_tasks.png")
 	# 升级 
 	I_FP_UPGRADE = RuleImage(roi_front=(1075,75,116,49), roi_back=(1040,52,169,100), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_upgrade.png")
-	# description 
+	# 红色关闭 
 	I_FP_RED_CLOSE = RuleImage(roi_front=(1170,109,43,44), roi_back=(1157,101,72,62), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_red_close.png")
 
 

+ 6 - 6
tasks/RichMan/assets.py

@@ -234,17 +234,17 @@ class RichManAssets:
 	# 永生之海 
 	I_SCA_PICTURE_BOOK = RuleImage(roi_front=(995,258,100,100), roi_back=(995,258,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_picture_book.png")
 	# 土蜘蛛 
-	I_SCA_DEMON_BOSS_1 = RuleImage(roi_front=(209,168,192,193), roi_back=(168,142,346,290), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_1.png")
+	I_SCA_DEMON_BOSS_1 = RuleImage(roi_front=(246,224,112,126), roi_back=(168,142,346,290), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_1.png")
 	# 胧车 
-	I_SCA_DEMON_BOSS_2 = RuleImage(roi_front=(457,158,180,198), roi_back=(413,136,273,250), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_2.png")
+	I_SCA_DEMON_BOSS_2 = RuleImage(roi_front=(457,203,123,153), roi_back=(413,136,273,250), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_2.png")
 	# 荒骷髅 
-	I_SCA_DEMON_BOSS_3 = RuleImage(roi_front=(687,178,181,175), roi_back=(631,132,344,273), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_3.png")
+	I_SCA_DEMON_BOSS_3 = RuleImage(roi_front=(686,239,131,121), roi_back=(631,132,344,273), threshold=0.6, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_3.png")
 	# 地震鲶 
-	I_SCA_DEMON_BOSS_4 = RuleImage(roi_front=(883,162,188,211), roi_back=(804,121,315,292), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_4.png")
+	I_SCA_DEMON_BOSS_4 = RuleImage(roi_front=(912,188,141,169), roi_back=(804,121,315,292), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_4.png")
 	# 蜃气楼 
-	I_SCA_DEMON_BOSS_5 = RuleImage(roi_front=(326,425,211,218), roi_back=(241,414,504,242), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_5.png")
+	I_SCA_DEMON_BOSS_5 = RuleImage(roi_front=(345,469,136,160), roi_back=(241,414,504,242), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_5.png")
 	# 歌姬 
-	I_SCA_DEMON_BOSS_6 = RuleImage(roi_front=(561,432,178,189), roi_back=(437,401,555,236), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_6.png")
+	I_SCA_DEMON_BOSS_6 = RuleImage(roi_front=(561,480,141,141), roi_back=(437,402,555,236), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_6.png")
 	# 永生之海第一个选择 
 	I_SCA_SELECT_1 = RuleImage(roi_front=(189,519,113,51), roi_back=(189,519,113,51), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_select_1.png")
 	# description 

+ 8 - 8
tasks/RichMan/mall/scales/image.json

@@ -29,7 +29,7 @@
   {
     "itemName": "sca_demon_boss_1",
     "imageName": "scales_sca_demon_boss_1.png",
-    "roiFront": "209,168,192,193",
+    "roiFront": "246,224,112,126",
     "roiBack": "168,142,346,290",
     "method": "Template matching",
     "threshold": 0.8,
@@ -38,7 +38,7 @@
   {
     "itemName": "sca_demon_boss_2",
     "imageName": "scales_sca_demon_boss_2.png",
-    "roiFront": "457,158,180,198",
+    "roiFront": "457,203,123,153",
     "roiBack": "413,136,273,250",
     "method": "Template matching",
     "threshold": 0.8,
@@ -47,16 +47,16 @@
   {
     "itemName": "sca_demon_boss_3",
     "imageName": "scales_sca_demon_boss_3.png",
-    "roiFront": "687,178,181,175",
+    "roiFront": "686,239,131,121",
     "roiBack": "631,132,344,273",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.6,
     "description": "荒骷髅"
   },
   {
     "itemName": "sca_demon_boss_4",
     "imageName": "scales_sca_demon_boss_4.png",
-    "roiFront": "883,162,188,211",
+    "roiFront": "912,188,141,169",
     "roiBack": "804,121,315,292",
     "method": "Template matching",
     "threshold": 0.8,
@@ -65,7 +65,7 @@
   {
     "itemName": "sca_demon_boss_5",
     "imageName": "scales_sca_demon_boss_5.png",
-    "roiFront": "326,425,211,218",
+    "roiFront": "345,469,136,160",
     "roiBack": "241,414,504,242",
     "method": "Template matching",
     "threshold": 0.8,
@@ -74,8 +74,8 @@
   {
     "itemName": "sca_demon_boss_6",
     "imageName": "scales_sca_demon_boss_6.png",
-    "roiFront": "561,432,178,189",
-    "roiBack": "437,401,555,236",
+    "roiFront": "561,480,141,141",
+    "roiBack": "437,402,555,236",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "歌姬"

BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_1.png


BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_2.png


BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_3.png


BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_4.png


BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_5.png


BIN
tasks/RichMan/mall/scales/scales_sca_demon_boss_6.png


+ 5 - 5
tasks/RichMan/shrine.py

@@ -25,12 +25,12 @@ class Shrine(GameUi, RichManAssets):
             self.screenshot()
             if self.appear(self.I_S_NEXT_PERIOD):
                 break
-            # if self.click(self.C_C_SHRINE, interval=1):
-            #     continue
-            if self.appear_then_click(self.I_CENTER1, interval=1):
-                continue
-            if self.appear_then_click(self.I_CENTER2, interval=1):
+            if self.click(self.C_C_SHRINE, interval=1):
                 continue
+            # if self.appear_then_click(self.I_CENTER1, interval=1):
+            #     continue
+            # if self.appear_then_click(self.I_CENTER2, interval=1):
+            #     continue
         logger.info('Enter Shrine')
         time.sleep(0.5)
         if con.black_daruma:

+ 2 - 1
tasks/TrueOrochi/config.py

@@ -8,6 +8,7 @@ from datetime import datetime, time
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase, TimeDelta
 from tasks.Utils.config_enum import ShikigamiClass
+from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
 class GreenMarkType(str, Enum):
     LEFT_1 = 'left_1'
@@ -34,4 +35,4 @@ class TrueOrochiConfig(BaseModel):
 class TrueOrochi(ConfigBase):
     scheduler: TrueOrochiScheduler = Field(default_factory=TrueOrochiScheduler)
     true_orochi_config: TrueOrochiConfig = Field(default_factory=TrueOrochiConfig)
-
+    switch_soul: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)

+ 27 - 2
tasks/TrueOrochi/script_task.py

@@ -14,19 +14,37 @@ from tasks.Component.GeneralInvite.general_invite import GeneralInvite
 from tasks.Component.GeneralRoom.general_room import GeneralRoom
 from tasks.Orochi.script_task import ScriptTask as OrochiScriptTask
 from tasks.Orochi.config import Layer
-from tasks.GameUi.page import page_main, page_soul_zones
+from tasks.GameUi.page import page_main, page_soul_zones,page_shikigami_records
 from tasks.TrueOrochi.assets import TrueOrochiAssets
 
 
 class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
 
+
     def run(self):
+    
+
+         # 御魂切换方式一
+        if self.config.true_orochi.switch_soul.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(self.config.true_orochi.switch_soul.switch_group_team)
+          # 御魂切换方式二
+        if self.config.true_orochi.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.true_orochi.switch_soul.group_name,
+                                         self.config.true_orochi.switch_soul.team_name)
+
+
         conf = self.config.true_orochi.true_orochi_config
         if conf.current_success >= 2:
             # 超过两次就说明这周打完了没有必要再打了
             logger.warning('This week is full')
             self.check_times(True)
             raise TaskEnd('TrueOrochi')
+       
+
         self.ui_get_current_page()
         self.ui_goto(page_soul_zones)
         self.orochi_enter()
@@ -34,6 +52,13 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
         if not battle:
             logger.warning('Not find true orochi')
             logger.warning('Try to battle orochi for ten times')
+
+            # 判断是否需要挑战十层触发真蛇
+            if not conf.find_true_orochi:
+                logger.info('Not find_true_orochi_help')
+                self.check_times(False)
+                raise TaskEnd('TrueOrochi')
+
             self.check_layer(Layer.TEN)
             self.check_lock(False)
             count_orochi_ten = 0
@@ -155,7 +180,7 @@ class ScriptTask(OrochiScriptTask, TrueOrochiAssets):
         if battle:
             next_run = now + self.config.true_orochi.scheduler.success_interval
         else:
-            next_run = now + self.config.true_orochi.scheduler.fail_interval
+            next_run = now + self.config.true_orochi.scheduler.failure_interval
         next_run_year, next_run_week_number, next_run_weekday = next_run.isocalendar()
         self.set_next_run(task='TrueOrochi', target=next_run)
         # 如果下次运行的时间是下一周,那么就重置成功次数