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

Merge branch 'runhey:dev' into dev

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

+ 1 - 1
module/config/config_manual.py

@@ -18,7 +18,7 @@ class ConfigManual:
         > TrueOrochi > RichMan
         > TrueOrochi > RichMan
         > CollectiveMissions
         > CollectiveMissions
         > Pets > TalismanPass > SoulsTidy > Delegation > Hyakkiyakou
         > Pets > TalismanPass > SoulsTidy > Delegation > Hyakkiyakou
-        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss
+        > Secret > WeeklyTrifles > MysteryShop > Duel > MetaDemon > FrogBoss > FloatParade
         """
         """
 
 
     DEVICE_OVER_HTTP = False
     DEVICE_OVER_HTTP = False

+ 1 - 1
module/config/config_menu.py

@@ -33,7 +33,7 @@ class ConfigMenu:
         # 每周任务
         # 每周任务
         self.menu["Weekly Task"] = ['TrueOrochi', 'RichMan', 'Secret', 'WeeklyTrifles', 'MysteryShop', 'Duel']
         self.menu["Weekly Task"] = ['TrueOrochi', 'RichMan', 'Secret', 'WeeklyTrifles', 'MysteryShop', 'Duel']
         # 活动的任务
         # 活动的任务
-        self.menu["Activity Task"] = ['ActivityShikigami', 'MetaDemon', 'FrogBoss']
+        self.menu["Activity Task"] = ['ActivityShikigami', 'MetaDemon', 'FrogBoss', 'FloatParade']
         # 开发工具
         # 开发工具
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
 
 

+ 2 - 0
module/config/config_model.py

@@ -49,6 +49,7 @@ from tasks.Hunt.config import Hunt
 from tasks.ActivityShikigami.config import ActivityShikigami
 from tasks.ActivityShikigami.config import ActivityShikigami
 from tasks.MetaDemon.config import MetaDemon
 from tasks.MetaDemon.config import MetaDemon
 from tasks.FrogBoss.config import FrogBoss
 from tasks.FrogBoss.config import FrogBoss
+from tasks.FloatParade.config import FloatParade
 # ----------------------------------------------------------------------------------------------------------------------
 # ----------------------------------------------------------------------------------------------------------------------
 
 
 # 肝帝专属---------------------------------------------------------------------------------------------------------------
 # 肝帝专属---------------------------------------------------------------------------------------------------------------
@@ -103,6 +104,7 @@ class ConfigModel(ConfigBase):
     activity_shikigami: ActivityShikigami = Field(default_factory=ActivityShikigami)
     activity_shikigami: ActivityShikigami = Field(default_factory=ActivityShikigami)
     meta_demon: MetaDemon = Field(default_factory=MetaDemon)
     meta_demon: MetaDemon = Field(default_factory=MetaDemon)
     frog_boss: FrogBoss = Field(default_factory=FrogBoss)
     frog_boss: FrogBoss = Field(default_factory=FrogBoss)
+    float_parade: FloatParade = Field(default_factory=FloatParade)
 
 
     # 这些是肝帝专属
     # 这些是肝帝专属
     bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)
     bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)

+ 74 - 80
tasks/Dokan/assets.py

@@ -9,105 +9,99 @@ from module.atom.list import RuleList
 # Don't modify it manually.
 # Don't modify it manually.
 class DokanAssets: 
 class DokanAssets: 
 
 
+
+	# Click Rule Assets
+	# 道馆随机点击安全区域 
 	C_DOKAN_RANDOM_CLICK_AREA = RuleClick(roi_front=(142,294,107,555), roi_back=(142,294,107,555), name="dokan_random_click_area")
 	C_DOKAN_RANDOM_CLICK_AREA = RuleClick(roi_front=(142,294,107,555), roi_back=(142,294,107,555), name="dokan_random_click_area")
+	# 道馆随机点击安全区域1:竂友突破信息 
 	C_DOKAN_RANDOM_CLICK_AREA1 = RuleClick(roi_front=(42,594,10,100), roi_back=(42,594,10,100), name="dokan_random_click_area1")
 	C_DOKAN_RANDOM_CLICK_AREA1 = RuleClick(roi_front=(42,594,10,100), roi_back=(42,594,10,100), name="dokan_random_click_area1")
+	# 道馆随机点击安全区域2:切换查看队伍模式 
 	C_DOKAN_RANDOM_CLICK_AREA2 = RuleClick(roi_front=(1122,360,10,40), roi_back=(1122,360,10,40), name="dokan_random_click_area2")
 	C_DOKAN_RANDOM_CLICK_AREA2 = RuleClick(roi_front=(1122,360,10,40), roi_back=(1122,360,10,40), name="dokan_random_click_area2")
+	# 道馆随机点击安全区域3 
 	C_DOKAN_RANDOM_CLICK_AREA3 = RuleClick(roi_front=(333,44,107,20), roi_back=(333,44,107,20), name="dokan_random_click_area3")
 	C_DOKAN_RANDOM_CLICK_AREA3 = RuleClick(roi_front=(333,44,107,20), roi_back=(333,44,107,20), name="dokan_random_click_area3")
-	C_DOKAN_READY_FOR_BATLLE = RuleClick(roi_front=(42,94,1207,543), roi_back=(42,94,1207,543), name="dokan_ready_for_battle")
+	# 准备战斗 
+	C_DOKAN_READY_FOR_BATTLE = RuleClick(roi_front=(42,94,1207,543), roi_back=(42,94,1207,543), name="dokan_ready_for_battle")
 
 
-	# 阴阳竂-》神社
-	I_RYOU_SHENSHE = RuleImage(roi_front=(872,672,54,28), roi_back=(872,672,54,28), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_shenshe.png")
-	# 神社-》道馆
-	I_RYOU_DOKAN = RuleImage(roi_front=(476,173,62,24), roi_back=(476,173,62,24), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan.png")
 
 
-	# 是否已经成功进入道馆,上面中间的“道馆突破”文字
+	# Image Rule Assets
+	# 阴阳竂->神社 
+	I_RYOU_SHENSHE = RuleImage(roi_front=(476,173,62,24), roi_back=(476,173,62,24), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_shenshe.png")
+	# 神社->道馆 
+	I_RYOU_DOKAN = RuleImage(roi_front=(476,173,62,24), roi_back=(476,173,62,24), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan.png")
+	# []选择竂 
+	I_RYOU_DOKAN_RYOU_SELECT = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_ryou_select.png")
+	# 可选的竂列表 
+	I_RYOU_DOKAN_RYOU_LIST = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_ryou_list.png")
+	# 是否已经成功进入道馆,上面中间的“道馆突破”文字 
 	I_RYOU_DOKAN_CHECK = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_check.png")
 	I_RYOU_DOKAN_CHECK = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_check.png")
-	# 优先攻击
-	I_RYOU_DOKAN_PRIORITY = RuleImage(roi_front=(666,672,58,25), roi_back=(666,672,58,25), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority.png")
-	# 优先攻击选项:见习
-	I_RYOU_DOKAN_PRIORITY_0 = RuleImage(roi_front=(98,170,94,43), roi_back=(98,170,94,43), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority_0.png")
-	# 优先攻击选项:初级
-	I_RYOU_DOKAN_PRIORITY_1 = RuleImage(roi_front=(342,175,96,42), roi_back=(342,175,96,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority_1.png")
-	# 优先攻击选项:中级
-	I_RYOU_DOKAN_PRIORITY_2 = RuleImage(roi_front=(585,175,89,35), roi_back=(585,175,89,35), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority_2.png")
-	# 优先攻击选项:高级
-	I_RYOU_DOKAN_PRIORITY_3 = RuleImage(roi_front=(830,175,88,41), roi_back=(830,175,88,41), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority_3.png")
-	# 优先攻击选项:黑脸
-	I_RYOU_DOKAN_PRIORITY_4 = RuleImage(roi_front=(1072,178,94,39), roi_back=(1072,178,94,39), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_priority_4.png")
-
-	# 状态:集结等待中
-	I_RYOU_DOKAN_GATHERING = RuleImage(roi_front=(653,76,46,26), roi_back=(653,76,46,26), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_gathering.png")
-	# 状态:检查右下角有没有挑战?通常是失败了,并退出来到集结界面,可重新开始点击右下角挑战进入战斗
-	I_RYOU_DOKAN_START_CHALLENGE = RuleImage(roi_front=(1125,555,103,72), roi_back=(1125,555,103,72), threshold=0.95, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_start_challenge2.png")
-	I_RYOU_DOKAN_START_CHALLENGE2 = RuleImage(roi_front=(1132,572,89,43), roi_back=(1132,572,89,43), threshold=0.95, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_start_challenge.png")
-	# 状态:达到失败次数,CD中
-	I_RYOU_DOKAN_CD = RuleImage(roi_front=(1122,566,117,74), roi_back=(1122,566,117,74), threshold=0.9, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cd.png")
-	# 状态:进入战斗,待开始,右下角图标
+	# 优先攻击选项 
+	I_RYOU_DOKAN_ATTACK_PRIORITY = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority.png")
+	# 优先攻击: 见习 
+	I_RYOU_DOKAN_ATTACK_PRIORITY_0 = RuleImage(roi_front=(98,170,94,43), roi_back=(98,170,94,43), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority_0.png")
+	# 优先攻击: 初级 
+	I_RYOU_DOKAN_ATTACK_PRIORITY_1 = RuleImage(roi_front=(342,175,96,42), roi_back=(342,175,96,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority_1.png")
+	# 优先攻击: 中级 
+	I_RYOU_DOKAN_ATTACK_PRIORITY_2 = RuleImage(roi_front=(585,175,89,35), roi_back=(585,175,89,35), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority_2.png")
+	# 优先攻击: 高级 
+	I_RYOU_DOKAN_ATTACK_PRIORITY_3 = RuleImage(roi_front=(830,175,88,41), roi_back=(830,175,88,41), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority_3.png")
+	# 优先攻击: 黑脸 
+	I_RYOU_DOKAN_ATTACK_PRIORITY_4 = RuleImage(roi_front=(1072,178,94,39), roi_back=(1072,178,94,39), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_attack_priority_4.png")
+	# 状态:集结等待中。检查右下角的挑战是不是灰色的。FIXME 黄色和灰色的挑战截图总是傻傻分不清,先改用OCR 
+	I_RYOU_DOKAN_GATHERING = RuleImage(roi_front=(653,76,46,26), roi_back=(653,76,46,26), threshold=0.85, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_gathering.png")
+	# 状态:检查右下角有没有挑战?通常是失败了,并退出来到集结界面,可重新开始点击右下角挑战进入战斗 
+	I_RYOU_DOKAN_START_CHALLENGE = RuleImage(roi_front=(1132,572,89,43), roi_back=(1132,572,89,43), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_start_challenge.png")
+	# 状态:达到失败次数,CD中。挑战次数恢复倒数 
+	I_RYOU_DOKAN_CD1 = RuleImage(roi_front=(1068,500,146,27), roi_back=(1068,500,146,27), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cd1.png")
+	# 状态:达到失败次数,CD中。观战按钮 
+	I_RYOU_DOKAN_CD = RuleImage(roi_front=(1122,566,117,74), roi_back=(1122,566,117,74), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cd.png")
+	# 状态:进入战斗,待开始,右下角图标。TODO 欠截图。 
 	I_RYOU_DOKAN_IN_FIELD = RuleImage(roi_front=(1128,536,100,100), roi_back=(1128,536,100,100), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_in_field.png")
 	I_RYOU_DOKAN_IN_FIELD = RuleImage(roi_front=(1128,536,100,100), roi_back=(1128,536,100,100), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_in_field.png")
-	# 馆主战等待中
+	# 馆主战等待中 
 	I_DOKAN_BOSS_WAITING = RuleImage(roi_front=(603,148,130,32), roi_back=(603,148,130,32), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_dokan_boss_waiting.png")
 	I_DOKAN_BOSS_WAITING = RuleImage(roi_front=(603,148,130,32), roi_back=(603,148,130,32), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_dokan_boss_waiting.png")
-	# 状态:道馆胜利
+	# 状态:道馆胜利 
 	I_RYOU_DOKAN_WIN = RuleImage(roi_front=(628,60,45,33), roi_back=(628,60,45,33), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_win.png")
 	I_RYOU_DOKAN_WIN = RuleImage(roi_front=(628,60,45,33), roi_back=(628,60,45,33), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_win.png")
-	# 状态:进入战斗,待开始,右下角图标。
+	# 状态:进入战斗,待开始,右下角图标。 
 	I_RYOU_DOKAN_IN_FIELD2 = RuleImage(roi_front=(1131,562,88,48), roi_back=(1131,562,88,48), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_in_field2.png")
 	I_RYOU_DOKAN_IN_FIELD2 = RuleImage(roi_front=(1131,562,88,48), roi_back=(1131,562,88,48), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_in_field2.png")
-	# 状态:战斗结算,可能是打完小朋友了,也可能是失败了。
+	# 状态:战斗结算,可能是打完小朋友了,也可能是失败了。 
 	I_RYOU_DOKAN_BATTLE_OVER = RuleImage(roi_front=(571,503,106,49), roi_back=(571,503,106,49), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_battle_over.png")
 	I_RYOU_DOKAN_BATTLE_OVER = RuleImage(roi_front=(571,503,106,49), roi_back=(571,503,106,49), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_battle_over.png")
-
-
-	# 状态:战斗中,左上角的加油图标
-	I_RYOU_DOKAN_FIGHTING = RuleImage(roi_front=(374,38,74,19), roi_back=(374,38,74,19), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_fighting.png")
-	# 状态:加油中,左下角有鼓
-	I_RYOU_DOKAN_CHEERING = RuleImage(roi_front=(58,598,72,32), roi_back=(58,598,72,32), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering.png")
-	# 状态:加油中,左下角有鼓,灰色的鼓
-	I_RYOU_DOKAN_CHEERING_GRAY = RuleImage(roi_front=(58,601,84,35), roi_back=(58,601,84,35), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering_gray.png")
-	# 状态:道馆已经结束
-	I_RYOU_DOKAN_FINISHED = RuleImage(roi_front=(633,78,67,24), roi_back=(633,78,67,24), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_finished.png")
-	# 状态:道馆挑战失败,投票NO(暂不考虑)
-	I_RYOU_DOKAN_FAILED_VOTE_NO = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_failed_vote_no.png")
-	# 道馆退出确认
+	# 状态:战斗中,左上角的加油图标 
+	I_RYOU_DOKAN_FIGHTING = RuleImage(roi_front=(232,36,42,19), roi_back=(232,36,42,19), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_fighting.png")
+	# 状态:加油中,左下角有鼓 
+	I_RYOU_DOKAN_CHEERING = RuleImage(roi_front=(68,597,69,33), roi_back=(68,597,69,33), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering.png")
+	# 状态:加油中,左下角有鼓,灰色的鼓 
+	I_RYOU_DOKAN_CHEERING_GRAY = RuleImage(roi_front=(59,600,81,38), roi_back=(59,600,81,38), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering_gray.png")
+	# 状态:道馆已经结束 
+	I_RYOU_DOKAN_FINISHED = RuleImage(roi_front=(658,649,91,27), roi_back=(658,649,91,27), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_finished.png")
+	# 状态:道馆挑战失败,投票NO 
+	I_RYOU_DOKAN_FAILED_VOTE_NO = RuleImage(roi_front=(567,15,144,42), roi_back=(567,15,144,42), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_failed_vote_no.png")
+	# 道馆退出确认 
 	I_RYOU_DOKAN_EXIT_ENSURE = RuleImage(roi_front=(678,395,125,56), roi_back=(678,395,125,56), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_exit_ensure.png")
 	I_RYOU_DOKAN_EXIT_ENSURE = RuleImage(roi_front=(678,395,125,56), roi_back=(678,395,125,56), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_exit_ensure.png")
-
-	# 场景检测:阴阳竂
+	# 进入加油相关:道馆战报按钮 
+	I_RYOU_DOKAN_CHEERING_SCORES = RuleImage(roi_front=(157,100,35,39), roi_back=(157,100,35,39), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering_scores.png")
+	# 进入加油相关:前往战斗中的竂友 
+	I_RYOU_DOKAN_CHEERING_ATTACKING_SAMA = RuleImage(roi_front=(948,182,56,295), roi_back=(948,182,56,295), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering_attacking_sama.png")
+	# 场景检测:阴阳竂 
+	I_SCENE_RYOU = RuleImage(roi_front=(1161,674,75,31), roi_back=(1161,674,75,31), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/scene_ryou.png")
+	# 场景检测:阴阳竂 
 	I_SCENE_RYOU = RuleImage(roi_front=(1161,674,75,31), roi_back=(1161,674,75,31), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/scene_ryou.png")
 	I_SCENE_RYOU = RuleImage(roi_front=(1161,674,75,31), roi_back=(1161,674,75,31), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/scene_ryou.png")
-	# 进入加油相关:道馆积分按钮
-	I_RYOU_DOKAN_CHEERING_SCORES = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_scores.png")
-	# 进入加油相关:攻击中的竂友
-	I_RYOU_DOKAN_CHEERING_ATTACKING_SAMA = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_cheering_scores.png")
 
 
 
 
-	# activity list
-	L_RYOU_ACTIVITY_LIST = RuleList(folder="./tasks/Dokan/res", direction="vertical", mode="ocr", 
-								  roi_back=(35,157,37,250), 
-								  size=(42, 90), 
-								  array=["集体", "阴阳", "首领", "道馆", "狭间", "结界"])
+	# List Rule Assets
+	# 这个是当前活跃的竂活动列表界面 
+	L_LAYER_LIST = RuleList(folder="./tasks/Dokan/res", direction="vertical", mode="ocr", roi_back=(35,157,37,250), size=(42, 27), 
+					 array=["道馆", "首领", "狭间"])
+
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets
-	# 道馆地图,毛估的坐标。1280*720, 1280-540=740, 720-260=460
-	O_DOKAN_MAP = RuleOcr(roi=(270,130,740,460), area=(270,130,740,460), mode="Full", method="Default", keyword="万", name="dokan_map")
-	# 道馆里找文字:后开战
-	O_DOKAN_GATHERING = RuleOcr(roi=(653,76,46,26), area=(653,76,46,26), mode="Single", method="Default", keyword="开战", name="dokan_gathering")
-	# 道馆里找文字:剩余突破时间
+	# 道馆地图里找文字:万 
+	O_DOKAN_MAP = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Full", method="Default", keyword="万", name="dokan_map")
+	# 道馆里找文字:后开战 
+	O_DOKAN_GATHERING = RuleOcr(roi=(535,75,211,29), area=(535,75,211,29), mode="Single", method="Default", keyword="开战", name="dokan_gathering")
+	# 道馆里找文字:剩余突破时间 
 	O_DOKAN_ATTACKING = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Single", method="Default", keyword="剩余", name="dokan_attacking")
 	O_DOKAN_ATTACKING = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Single", method="Default", keyword="剩余", name="dokan_attacking")
-	# 道馆里找文字:后挑战馆主
+	# 道馆里找文字:后挑战馆主 
 	O_DOKAN_BOSS_WAITING = RuleOcr(roi=(603,148,130,32), area=(603,148,130,32), mode="Single", method="Default", keyword="馆主", name="dokan_boss_waiting")
 	O_DOKAN_BOSS_WAITING = RuleOcr(roi=(603,148,130,32), area=(603,148,130,32), mode="Single", method="Default", keyword="馆主", name="dokan_boss_waiting")
-	# 道馆里找文字:后关闭
-	O_DOKAN_SUCCEEDED = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Single", method="Default", keyword="关闭", name="dokan_succeeded")
-
-	# # Click Rule Assets
-	# # area1 
-	# C_AREA_1 = RuleClick(roi_front=(533,162,177,74), roi_back=(533,162,177,74), name="area_1")
-	# # area2 
-	# C_AREA_2 = RuleClick(roi_front=(863,164,181,71), roi_back=(863,164,181,71), name="area_2")
-	# # 在点击进攻后如果未进入战斗画面则点击的安全区域 
-	# C_SAFE_AREA = RuleClick(roi_front=(182,213,160,229), roi_back=(182,213,160,229), name="safe_area")
-
-	# Image Rule Assets
-	# I_DAILY_NAV = RuleImage(roi_front=(1, 291, 22, 63), roi_back=(1, 291, 22, 63), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_daily_nav.png")
-	# I_DAILY_DAILY = RuleImage(roi_front=(179, 127, 26, 52), roi_back=(179, 127, 26, 52), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_daily_daily.png")
-	# I_RYOU_DOKAN_CHECK2 = RuleImage(roi_front=(673,146,63,32), roi_back=(421,127,325,134), threshold=0.8, method="Template matching", file="./tasks/Dokan/res/res_ryou_dokan_check2.png")
-
-	# # Ocr Rule Assets
-	# # 日常活动-前往
-	# O_GOTO = RuleOcr(roi=(604,501,63,29), area=(604,501,63,29), mode="Single", method="Default", keyword="前往", name="goto")
+	# 道馆里找文字:后关闭 
+	O_DOKAN_SUCCEEDED = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Full", method="Default", keyword="关闭", name="dokan_succeeded")
 
 
 
 

+ 2 - 2
tasks/Dokan/script_task.py

@@ -291,9 +291,9 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, DokanAssets):
             return False
             return False
 
 
     def dokan_choose_attack_priority(self, attack_priority: int) -> bool:
     def dokan_choose_attack_priority(self, attack_priority: int) -> bool:
-        ''' 选择优先攻击
+        """ 选择优先攻击
         : return 
         : return 
-        '''
+        """
         logger.hr('Try to choose attack priority')
         logger.hr('Try to choose attack priority')
         max_try = 5
         max_try = 5
 
 

+ 39 - 0
tasks/FloatParade/assets.py

@@ -0,0 +1,39 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class FloatParadeAssets: 
+
+
+	# Image Rule Assets
+	# 从庭院进入花车活动 
+	I_FP_ACCESS = RuleImage(roi_front=(183,413,36,34), roi_back=(95,344,1042,229), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_access.png")
+	# description 
+	I_FP_GETALL0 = RuleImage(roi_front=(1153,287,65,56), roi_back=(1134,261,100,100), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_getall0.png")
+	# description 
+	I_FP_RED_POINT0 = RuleImage(roi_front=(1242,604,22,21), roi_back=(1225,585,53,54), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_red_point0.png")
+	# description 
+	I_FP_GETALL1 = RuleImage(roi_front=(1194,539,60,61), roi_back=(1167,520,100,100), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_getall1.png")
+	# description 
+	I_FP_RED_POINT1 = RuleImage(roi_front=(1249,155,21,21), roi_back=(1223,138,56,62), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_red_point1.png")
+	# description 
+	I_FP_RED_POINT2 = RuleImage(roi_front=(1246,288,22,21), roi_back=(1232,278,43,41), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_red_point2.png")
+	# description 
+	I_FP_BATCH = RuleImage(roi_front=(985,520,94,31), roi_back=(978,507,112,64), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_batch.png")
+	# description 
+	I_FP_BATCH_TRUE = RuleImage(roi_front=(938,518,35,37), roi_back=(924,506,64,62), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_batch_true.png")
+	# description 
+	I_FP_BATCH_FALSE = RuleImage(roi_front=(936,515,40,45), roi_back=(924,505,63,65), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_batch_false.png")
+	# 右下角的任务 
+	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")
+
+

+ 25 - 0
tasks/FloatParade/config.py

@@ -0,0 +1,25 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from datetime import timedelta
+from enum import Enum
+from pydantic import BaseModel, Field
+
+from tasks.Component.config_scheduler import Scheduler as BaseScheduler
+from tasks.Component.config_base import ConfigBase, TimeDelta
+
+class Scheduler(BaseScheduler):
+    success_interval: TimeDelta = Field(default=TimeDelta(days=3), description='success_interval_help')
+    failure_interval: TimeDelta = Field(default=TimeDelta(days=3), description='failure_interval_help')
+
+class LevelReward(str, Enum):
+    ONE = '蛇皮/青吉鬼'
+    TWO = '金币/勾玉'
+    THREE = '体力/樱饼'
+
+class FloatParadeConfig(BaseModel):
+    level_reward: LevelReward = Field(default=LevelReward.TWO)
+
+class FloatParade(ConfigBase):
+    scheduler: Scheduler = Field(default_factory=Scheduler)
+    float_parade: FloatParadeConfig = Field(default_factory=FloatParadeConfig)

BIN
tasks/FloatParade/fp/fp_fp_access.png


BIN
tasks/FloatParade/fp/fp_fp_batch.png


BIN
tasks/FloatParade/fp/fp_fp_batch_false.png


BIN
tasks/FloatParade/fp/fp_fp_batch_true.png


BIN
tasks/FloatParade/fp/fp_fp_getall0.png


BIN
tasks/FloatParade/fp/fp_fp_getall1.png


BIN
tasks/FloatParade/fp/fp_fp_red_close.png


BIN
tasks/FloatParade/fp/fp_fp_red_point0.png


BIN
tasks/FloatParade/fp/fp_fp_red_point1.png


BIN
tasks/FloatParade/fp/fp_fp_red_point2.png


BIN
tasks/FloatParade/fp/fp_fp_tasks.png


BIN
tasks/FloatParade/fp/fp_fp_upgrade.png


+ 110 - 0
tasks/FloatParade/fp/image.json

@@ -0,0 +1,110 @@
+[
+  {
+    "itemName": "fp_access",
+    "imageName": "fp_fp_access.png",
+    "roiFront": "183,413,36,34",
+    "roiBack": "95,344,1042,229",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "从庭院进入花车活动"
+  },
+  {
+    "itemName": "fp_getall0",
+    "imageName": "fp_fp_getall0.png",
+    "roiFront": "1153,287,65,56",
+    "roiBack": "1134,261,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_red_point0",
+    "imageName": "fp_fp_red_point0.png",
+    "roiFront": "1242,604,22,21",
+    "roiBack": "1225,585,53,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_getall1",
+    "imageName": "fp_fp_getall1.png",
+    "roiFront": "1194,539,60,61",
+    "roiBack": "1167,520,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_red_point1",
+    "imageName": "fp_fp_red_point1.png",
+    "roiFront": "1249,155,21,21",
+    "roiBack": "1223,138,56,62",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_red_point2",
+    "imageName": "fp_fp_red_point2.png",
+    "roiFront": "1246,288,22,21",
+    "roiBack": "1232,278,43,41",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_batch",
+    "imageName": "fp_fp_batch.png",
+    "roiFront": "985,520,94,31",
+    "roiBack": "978,507,112,64",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_batch_true",
+    "imageName": "fp_fp_batch_true.png",
+    "roiFront": "938,518,35,37",
+    "roiBack": "924,506,64,62",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_batch_false",
+    "imageName": "fp_fp_batch_false.png",
+    "roiFront": "936,515,40,45",
+    "roiBack": "924,505,63,65",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "fp_tasks",
+    "imageName": "fp_fp_tasks.png",
+    "roiFront": "1175,617,79,76",
+    "roiBack": "1162,605,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "右下角的任务"
+  },
+  {
+    "itemName": "fp_upgrade",
+    "imageName": "fp_fp_upgrade.png",
+    "roiFront": "1075,75,116,49",
+    "roiBack": "1040,52,169,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "升级"
+  },
+  {
+    "itemName": "fp_red_close",
+    "imageName": "fp_fp_red_close.png",
+    "roiFront": "1170,109,43,44",
+    "roiBack": "1157,101,72,62",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "红色关闭"
+  }
+]

+ 113 - 0
tasks/FloatParade/script_task.py

@@ -0,0 +1,113 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import time
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_main
+from tasks.TalismanPass.assets import TalismanPassAssets
+from tasks.FloatParade.assets import FloatParadeAssets
+from tasks.FloatParade.config import FloatParadeConfig, LevelReward
+
+from module.logger import logger
+from module.exception import TaskEnd
+from module.base.timer import Timer
+
+class ScriptTask(GameUi, FloatParadeAssets, TalismanPassAssets):
+
+    def run(self):
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+        con: FloatParadeConfig = self.config.talisman_pass.talisman
+
+        # 收取全部奖励
+        self.get_all()
+        # 回退
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_FP_TASKS):
+                break
+            if self.appear_then_click(self.I_BACK_Y, interval=3):
+                continue
+        logger.info('Goback to float parade main page')
+        # 收取花车等级奖励
+        self.get_flower(con.level_reward)
+        # main page
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+
+        self.set_next_run(task='FloatParade', success=True, finish=True)
+        raise TaskEnd('FloatParade')
+
+
+    def get_all(self):
+        """
+        一键收取所有的, 从庭院进入
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_FP_UPGRADE):
+                break
+            if self.appear_then_click(self.I_FP_ACCESS, interval=0.8):
+                continue
+            if self.appear_then_click(self.I_FP_RED_CLOSE, interval=1.5):
+                continue
+            if self.appear_then_click(self.I_FP_TASKS, interval=1.8):
+                continue
+        logger.info('Enter float parade')
+        logger.info('Click get all reward')
+        if not self.appear(self.I_FP_GETALL1):
+            logger.info('No appear get all button')
+            return
+        self.ui_get_reward(self.I_FP_GETALL1)
+        logger.info('Got all reward')
+
+    def get_flower(self, level: LevelReward = LevelReward.TWO):
+        """
+        收取花合战等级奖励
+        :return:
+        """
+        match_level = {
+            LevelReward.ONE: self.I_TP_LEVEL_1,
+            LevelReward.TWO: self.I_TP_LEVEL_2,
+            LevelReward.THREE: self.I_TP_LEVEL_3,
+        }
+        self.screenshot()
+        if not self.appear(self.I_FP_GETALL0):
+            logger.info('No any level reward')
+            return
+        logger.info('Appear level reward')
+        # self.ui_click(self.I_FP_GETALL0, self.I_TP_GET_ALL)
+        logger.info('Click level reward')
+        check_timer = Timer(2)
+        check_timer.start()
+        while 1:
+            self.screenshot()
+            if self.appear_then_click(match_level[level], interval=0.8):
+                logger.info(f'Select {level} reward')
+                check_timer.reset()
+                continue
+
+            if self.ui_reward_appear_click(False):
+                logger.info('Get reward')
+                check_timer.reset()
+                continue
+            if check_timer.reached():
+                logger.warning('No reward and break')
+                break
+            if self.appear_then_click(self.I_FP_GETALL0, interval=2.1):
+                logger.info('Get all reward')
+                check_timer.reset()
+                continue
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()

+ 1 - 1
tasks/Hyakkiyakou/script_task.py

@@ -135,7 +135,6 @@ class ScriptTask(GameUi, HyaSlave):
             if datetime.now() - self.start_time >= self.limit_time:
             if datetime.now() - self.start_time >= self.limit_time:
                 logger.info('Hyakkiyakou time limit out')
                 logger.info('Hyakkiyakou time limit out')
                 break
                 break
-                
 
 
             self.one()
             self.one()
             hya_count += 1
             hya_count += 1
@@ -175,6 +174,7 @@ class ScriptTask(GameUi, HyaSlave):
         logger.hr('Start Hyakkiyakou')
         logger.hr('Start Hyakkiyakou')
         init_bean_flag: bool = False
         init_bean_flag: bool = False
         last_action = [0, 0, False, 10]
         last_action = [0, 0, False, 10]
+        self.hya_fs_check_timer.reset()
         if self._config.debug_config.hya_show:
         if self._config.debug_config.hya_show:
             self.debugger.show_start()
             self.debugger.show_start()
         while 1:
         while 1:

+ 27 - 8
tasks/Hyakkiyakou/slave/hya_device.py

@@ -1,11 +1,20 @@
 import timeit
 import timeit
+import numpy as np
 
 
 from module.base.timer import Timer
 from module.base.timer import Timer
 from module.logger import logger
 from module.logger import logger
 from module.base.utils import point2str
 from module.base.utils import point2str
+from module.exception import RequestHumanTakeover, GameStuckError
 from tasks.base_task import BaseTask
 from tasks.base_task import BaseTask
 
 
 
 
+def image_black(img) -> bool:
+    for y, x in [(0, 0), (719, 1279), (719, 0), (0, 1279)]:
+        if np.all(img[y, x] != 0):
+            return False
+    return True
+
+
 class HyaDevice(BaseTask):
 class HyaDevice(BaseTask):
     """
     """
     这个类主要是是优化截屏点击速度
     这个类主要是是优化截屏点击速度
@@ -15,11 +24,19 @@ class HyaDevice(BaseTask):
     我宣布世界上最好的 Linux 系统是 Windows
     我宣布世界上最好的 Linux 系统是 Windows
     """
     """
     hya_screenshot_interval = Timer(0.2)  # 300ms
     hya_screenshot_interval = Timer(0.2)  # 300ms
+    hya_fs_check_timer = Timer(5 * 60)  # 五分钟跑不完就应该是出问题了
 
 
     def fast_screenshot(self):
     def fast_screenshot(self):
         self.hya_screenshot_interval.wait()
         self.hya_screenshot_interval.wait()
         self.hya_screenshot_interval.reset()
         self.hya_screenshot_interval.reset()
         self.device.image = self.device.screenshot_window_background()
         self.device.image = self.device.screenshot_window_background()
+        if image_black(self.device.image):
+            logger.error('Screenshot image is black, try again')
+            raise RequestHumanTakeover('Screenshot image is black, try again')
+        if self.hya_fs_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')
+            raise GameStuckError
         return self.device.image
         return self.device.image
 
 
     def fast_click(self, x: int, y: int) -> None:
     def fast_click(self, x: int, y: int) -> None:
@@ -37,7 +54,6 @@ class HyaDevice(BaseTask):
         self.hya_screenshot_interval = Timer(interval / 1000.)
         self.hya_screenshot_interval = Timer(interval / 1000.)
 
 
 
 
-
 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
@@ -46,10 +62,13 @@ if __name__ == '__main__':
     d = Device(c)
     d = Device(c)
     hd = HyaDevice(c, d)
     hd = HyaDevice(c, d)
 
 
-    def screenshot():
-        global hd
-        # hd.fast_screenshot()
-        hd.fast_click(420, 370)
-        hd.fast_click(750, 400)
-    execution_time = timeit.timeit(screenshot, number=50)
-    print(f"执行总的时间: {execution_time * 1000} ms")
+    # def screenshot():
+    #     global hd
+    #     # hd.fast_screenshot()
+    #     hd.fast_click(420, 370)
+    #     hd.fast_click(750, 400)
+    # execution_time = timeit.timeit(screenshot, number=50)
+    # print(f"执行总的时间: {execution_time * 1000} ms")
+
+    hd.fast_screenshot()
+

+ 8 - 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_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=(225,169,192,193), roi_back=(225,169,192,193), 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=(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_2 = RuleImage(roi_front=(539,161,180,198), roi_back=(539,161,180,198), 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,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_3 = RuleImage(roi_front=(864,180,181,175), roi_back=(864,180,181,175), 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=(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_4 = RuleImage(roi_front=(228,412,188,211), roi_back=(228,412,188,211), 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=(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_5 = RuleImage(roi_front=(534,414,211,218), roi_back=(534,414,211,218), 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=(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_6 = RuleImage(roi_front=(862,432,178,189), roi_back=(862,432,178,189), 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,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_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")
 	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 
 	# description 
@@ -257,6 +257,8 @@ class RichManAssets:
 	I_SCA_REWARD = RuleImage(roi_front=(584,503,100,100), roi_back=(584,503,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_reward.png")
 	I_SCA_REWARD = RuleImage(roi_front=(584,503,100,100), roi_back=(584,503,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_reward.png")
 	# 点击兑换 
 	# 点击兑换 
 	I_SCA_DEMON_BUY = RuleImage(roi_front=(861,572,180,62), roi_back=(861,572,180,62), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_buy.png")
 	I_SCA_DEMON_BUY = RuleImage(roi_front=(861,572,180,62), roi_back=(861,572,180,62), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_buy.png")
+	# 夜荒魂 
+	I_SCA_DEMON_BOSS_7 = RuleImage(roi_front=(819,489,100,100), roi_back=(640,423,412,222), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/scales/scales_sca_demon_boss_7.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets

+ 1 - 0
tasks/RichMan/mall/scales.py

@@ -202,6 +202,7 @@ class Scales(Buy, MallNavbar):
             DemonClass.NAMAZU: self.I_SCA_DEMON_BOSS_4,  # 鲶鱼
             DemonClass.NAMAZU: self.I_SCA_DEMON_BOSS_4,  # 鲶鱼
             DemonClass.SHINKIRO: self.I_SCA_DEMON_BOSS_5,  # 神木鸟
             DemonClass.SHINKIRO: self.I_SCA_DEMON_BOSS_5,  # 神木鸟
             DemonClass.GHOSTLY_SONGSTRESS: self.I_SCA_DEMON_BOSS_6,  # 歌姬
             DemonClass.GHOSTLY_SONGSTRESS: self.I_SCA_DEMON_BOSS_6,  # 歌姬
+            DemonClass.BOSS_7: self.I_SCA_DEMON_BOSS_7,  # 夜荒魂
         }
         }
         match_position = {
         match_position = {
             1: self.C_SCA_DEMON_1,
             1: self.C_SCA_DEMON_1,

+ 21 - 12
tasks/RichMan/mall/scales/image.json

@@ -29,8 +29,8 @@
   {
   {
     "itemName": "sca_demon_boss_1",
     "itemName": "sca_demon_boss_1",
     "imageName": "scales_sca_demon_boss_1.png",
     "imageName": "scales_sca_demon_boss_1.png",
-    "roiFront": "225,169,192,193",
-    "roiBack": "225,169,192,193",
+    "roiFront": "209,168,192,193",
+    "roiBack": "168,142,346,290",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "土蜘蛛"
     "description": "土蜘蛛"
@@ -38,8 +38,8 @@
   {
   {
     "itemName": "sca_demon_boss_2",
     "itemName": "sca_demon_boss_2",
     "imageName": "scales_sca_demon_boss_2.png",
     "imageName": "scales_sca_demon_boss_2.png",
-    "roiFront": "539,161,180,198",
-    "roiBack": "539,161,180,198",
+    "roiFront": "457,158,180,198",
+    "roiBack": "413,136,273,250",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "胧车"
     "description": "胧车"
@@ -47,8 +47,8 @@
   {
   {
     "itemName": "sca_demon_boss_3",
     "itemName": "sca_demon_boss_3",
     "imageName": "scales_sca_demon_boss_3.png",
     "imageName": "scales_sca_demon_boss_3.png",
-    "roiFront": "864,180,181,175",
-    "roiBack": "864,180,181,175",
+    "roiFront": "687,178,181,175",
+    "roiBack": "631,132,344,273",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "荒骷髅"
     "description": "荒骷髅"
@@ -56,8 +56,8 @@
   {
   {
     "itemName": "sca_demon_boss_4",
     "itemName": "sca_demon_boss_4",
     "imageName": "scales_sca_demon_boss_4.png",
     "imageName": "scales_sca_demon_boss_4.png",
-    "roiFront": "228,412,188,211",
-    "roiBack": "228,412,188,211",
+    "roiFront": "883,162,188,211",
+    "roiBack": "804,121,315,292",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "地震鲶"
     "description": "地震鲶"
@@ -65,8 +65,8 @@
   {
   {
     "itemName": "sca_demon_boss_5",
     "itemName": "sca_demon_boss_5",
     "imageName": "scales_sca_demon_boss_5.png",
     "imageName": "scales_sca_demon_boss_5.png",
-    "roiFront": "534,414,211,218",
-    "roiBack": "534,414,211,218",
+    "roiFront": "326,425,211,218",
+    "roiBack": "241,414,504,242",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "蜃气楼"
     "description": "蜃气楼"
@@ -74,8 +74,8 @@
   {
   {
     "itemName": "sca_demon_boss_6",
     "itemName": "sca_demon_boss_6",
     "imageName": "scales_sca_demon_boss_6.png",
     "imageName": "scales_sca_demon_boss_6.png",
-    "roiFront": "862,432,178,189",
-    "roiBack": "862,432,178,189",
+    "roiFront": "561,432,178,189",
+    "roiBack": "437,401,555,236",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "歌姬"
     "description": "歌姬"
@@ -133,5 +133,14 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "点击兑换"
     "description": "点击兑换"
+  },
+  {
+    "itemName": "sca_demon_boss_7",
+    "imageName": "scales_sca_demon_boss_7.png",
+    "roiFront": "819,489,100,100",
+    "roiBack": "640,423,412,222",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "夜荒魂"
   }
   }
 ]
 ]

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


+ 2 - 0
tasks/Utils/config_enum.py

@@ -26,6 +26,8 @@ class DemonClass(str, Enum):
     SHINKIRO = '蜃气楼'
     SHINKIRO = '蜃气楼'
     # ghostly songstress 鬼灵歌伎
     # ghostly songstress 鬼灵歌伎
     GHOSTLY_SONGSTRESS = '鬼灵歌伎'
     GHOSTLY_SONGSTRESS = '鬼灵歌伎'
+    # Boss_7 夜荒魂
+    BOSS_7 = '夜荒魂'