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

Merge pull request #1060 from runhey/dev

Automated PR 2025.09.18
huangrunheng 1 год назад
Родитель
Сommit
fe0f75fd36

+ 2 - 0
tasks/Component/GeneralBattle/assets.py

@@ -145,6 +145,8 @@ class GeneralBattleAssets:
 	O_BATTLE_PREPARE = RuleOcr(roi=(1122,546,92,51), area=(1122,546,92,51), mode="Single", method="Default", keyword="准备", name="battle_prepare")
 	# 预设,部分场景预设按钮上的文字为'预设'+数字,导致点击preset失败 
 	O_PRESET = RuleOcr(roi=(20,620,60,80), area=(20,620,60,80), mode="Single", method="Default", keyword="预", name="preset")
+	# 预设 
+	O_PRESET_FULL = RuleOcr(roi=(20,620,60,80), area=(20,620,60,80), mode="Single", method="Default", keyword="预设", name="preset_full")
 
 
 	# Swipe Rule Assets

+ 9 - 0
tasks/Component/GeneralBattle/gb/ocr.json

@@ -16,5 +16,14 @@
     "method": "Default",
     "keyword": "预",
     "description": "预设,部分场景预设按钮上的文字为'预设'+数字,导致点击preset失败"
+  },
+  {
+    "itemName": "preset_full",
+    "roiFront": "20,620,60,80",
+    "roiBack":  "20,620,60,80",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "预设",
+    "description": "预设"
   }
 ]

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

@@ -317,6 +317,9 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             if self.ocr_appear(self.O_PRESET):
                 self.click(self.O_PRESET, interval=1)
                 continue
+            if self.ocr_appear(self.O_PRESET_FULL):
+                self.click(self.O_PRESET_FULL, interval=1)
+                continue
         logger.info("Click preset button")
 
         def get_unselect_color(tmp1, tmp2, tmp3, size):

+ 3 - 1
tasks/GameUi/assets.py

@@ -109,8 +109,10 @@ class GameUiAssets:
 	I_CHECK_DUEL = RuleImage(roi_front=(110,10,64,38), roi_back=(79,1,110,74), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_duel.png")
 	# description 
 	I_CHECK_DEMON_ENCOUNTER = RuleImage(roi_front=(26,658,42,43), roi_back=(2,619,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter.png")
-	# description 
+	# 检查狩猎战界面 
 	I_CHECK_HUNT = RuleImage(roi_front=(575,30,46,25), roi_back=(553,1,81,68), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_hunt.png")
+	# 检查狩猎战麒麟界面 
+	I_CHECK_HUNT_KIRIN = RuleImage(roi_front=(353,240,30,54), roi_back=(328,234,81,68), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_hunt_kirin.png")
 	# description 
 	I_CHECK_HYAKKISEN = RuleImage(roi_front=(1014,607,53,55), roi_back=(986,587,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_hyakkisen.png")
 	# description 

+ 1 - 1
tasks/GameUi/game_ui.py

@@ -30,7 +30,7 @@ class GameUi(BaseTask, GameUiAssets):
         page_secret_zones, page_area_boss, page_heian_kitan, page_six_gates, page_bondling_fairyland,
         page_kekkai_toppa,
         # 町中的
-        page_duel, page_demon_encounter, page_hunt, page_draft_duel, page_hyakkisen,
+        page_duel, page_demon_encounter, page_hunt, page_hunt_kirin, page_draft_duel, page_hyakkisen,
         # 庭院里面的
         page_shikigami_records, page_onmyodo, page_friends, page_daily, page_mall, page_guild, page_team,
         page_collection,

+ 4 - 0
tasks/GameUi/page.py

@@ -108,6 +108,10 @@ page_town.link(button=G.I_TOWN_GOTO_DEMON_ENCOUNTER, destination=page_demon_enco
 page_hunt = Page(G.I_CHECK_HUNT)
 page_hunt.link(button=G.I_BACK_BL, destination=page_town)
 page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt)
+# 狩猎战麒麟 hunt_kirin
+page_hunt_kirin = Page(G.I_CHECK_HUNT_KIRIN)
+page_hunt_kirin.link(button=G.I_BACK_YOLLOW, destination=page_town)
+page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt_kirin)
 # 协同斗技 draft_duel
 page_draft_duel = Page(G.I_CHECK_DRAFT_DUEL)
 page_draft_duel.link(button=G.I_BACK_YOLLOW, destination=page_town)

BIN
tasks/GameUi/page/page_check_hunt_kirin.png


+ 10 - 1
tasks/GameUi/page/page_img_2.json

@@ -96,7 +96,16 @@
     "roiBack": "553,1,81,68",
     "method": "Template matching",
     "threshold": 0.7,
-    "description": "description"
+    "description": "检查狩猎战界面"
+  },
+  {
+    "itemName": "check_hunt_kirin",
+    "imageName": "page_check_hunt_kirin.png",
+    "roiFront": "353,240,30,54",
+    "roiBack": "328,234,81,68",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "检查狩猎战麒麟界面"
   },
   {
     "itemName": "check_hyakkisen",

+ 4 - 5
tasks/Hunt/script_task.py

@@ -10,7 +10,7 @@ from module.logger import logger
 from module.base.timer import Timer
 
 from tasks.GameUi.game_ui import GameUi
-from tasks.GameUi.page import page_main, page_hunt, page_shikigami_records
+from tasks.GameUi.page import page_main, page_hunt, page_hunt_kirin, page_shikigami_records
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.GeneralInvite.general_invite import GeneralInvite
@@ -38,11 +38,11 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
                 if con.netherworld_group_team != '-1,-1':
                     self.run_switch_soul(con.netherworld_group_team)
         self.ui_get_current_page()
-        self.ui_goto(page_hunt)
-
         if self.kirin_day:
+            self.ui_goto(page_hunt_kirin)
             self.kirin()
         else:
+            self.ui_goto(page_hunt)
             self.netherworld()
         sleep(1)
 
@@ -105,8 +105,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralInvite, SwitchSoul, HuntAssets):
         logger.hr('kirin', 2)
         while 1:
             self.screenshot()
-            if self.appear(self.I_FIRE):
-                self.click_fire()
+            if self.appear(self.I_PREPARE_HIGHLIGHT):
                 break
             if self.appear_then_click(self.I_UI_CONFIRM, interval=0.9):
                 continue

+ 8 - 8
tasks/KekkaiActivation/a/image.json

@@ -3,7 +3,7 @@
     "itemName": "a_harvest_fish4",
     "imageName": "a_a_harvest_fish4.png",
     "roiFront": "897,159,48,40",
-    "roiBack": "872,128,100,100",
+    "roiBack": "872,128,154,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "斗鱼收获奖励4星"
@@ -156,7 +156,7 @@
     "itemName": "a_harvest_kaiko_4",
     "imageName": "a_a_harvest_kaiko_4.png",
     "roiFront": "894,164,48,41",
-    "roiBack": "867,132,100,100",
+    "roiBack": "867,132,154,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "太鼓4"
@@ -165,7 +165,7 @@
     "itemName": "a_harvest_kaiko_3",
     "imageName": "a_a_harvest_kaiko_3.png",
     "roiFront": "893,163,47,42",
-    "roiBack": "865,136,100,100",
+    "roiBack": "865,136,154,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -174,7 +174,7 @@
     "itemName": "a_harvest_kaiko_6",
     "imageName": "a_a_harvest_kaiko_6.png",
     "roiFront": "898,160,45,38",
-    "roiBack": "868,129,100,100",
+    "roiBack": "868,129,154,174",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "太鼓6"
@@ -183,7 +183,7 @@
     "itemName": "a_harvest_fish_6",
     "imageName": "a_a_harvest_fish_6.png",
     "roiFront": "898,159,45,38",
-    "roiBack": "869,131,100,100",
+    "roiBack": "869,131,154,174",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "斗鱼6"
@@ -192,7 +192,7 @@
     "itemName": "a_harvest_moon_3",
     "imageName": "a_a_harvest_moon_3.png",
     "roiFront": "897,159,46,40",
-    "roiBack": "869,127,100,100",
+    "roiBack": "869,127,154,174",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "太阴3"
@@ -210,7 +210,7 @@
     "itemName": "a_harvest_fish_3",
     "imageName": "a_a_harvest_fish_3.png",
     "roiFront": "891,165,57,39",
-    "roiBack": "854,128,132,124",
+    "roiBack": "854,128,154,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "斗鱼3"
@@ -219,7 +219,7 @@
     "itemName": "a_harvest_oboroguruma",
     "imageName": "a_a_harvest_oboroguruma.png",
     "roiFront": "891,165,57,39",
-    "roiBack": "854,128,132,124",
+    "roiBack": "854,128,154,174",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "胧车 "

+ 8 - 8
tasks/KekkaiActivation/assets.py

@@ -29,7 +29,7 @@ class KekkaiActivationAssets:
 
 	# Image Rule Assets
 	# 斗鱼收获奖励4星 
-	I_A_HARVEST_FISH4 = RuleImage(roi_front=(897,159,48,40), roi_back=(872,128,100,100), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish4.png")
+	I_A_HARVEST_FISH4 = RuleImage(roi_front=(897,159,48,40), roi_back=(872,128,154,174), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish4.png")
 	# 一般的收获奖励 
 	I_A_HARVEST_EXP = RuleImage(roi_front=(891,153,49,43), roi_back=(865,121,100,100), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_exp.png")
 	# "结界卡" 
@@ -63,21 +63,21 @@ class KekkaiActivationAssets:
 	# description 
 	I_A_CHECK_CARD = RuleImage(roi_front=(513,32,260,49), roi_back=(513,32,260,49), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_check_card.png")
 	# 太鼓4 
-	I_A_HARVEST_KAIKO_4 = RuleImage(roi_front=(894,164,48,41), roi_back=(867,132,100,100), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_4.png")
+	I_A_HARVEST_KAIKO_4 = RuleImage(roi_front=(894,164,48,41), roi_back=(867,132,154,174), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_4.png")
 	# description 
-	I_A_HARVEST_KAIKO_3 = RuleImage(roi_front=(893,163,47,42), roi_back=(865,136,100,100), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_3.png")
+	I_A_HARVEST_KAIKO_3 = RuleImage(roi_front=(893,163,47,42), roi_back=(865,136,154,174), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_3.png")
 	# 太鼓6 
-	I_A_HARVEST_KAIKO_6 = RuleImage(roi_front=(898,160,45,38), roi_back=(868,129,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_6.png")
+	I_A_HARVEST_KAIKO_6 = RuleImage(roi_front=(898,160,45,38), roi_back=(868,129,154,174), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_kaiko_6.png")
 	# 斗鱼6 
-	I_A_HARVEST_FISH_6 = RuleImage(roi_front=(898,159,45,38), roi_back=(869,131,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_6.png")
+	I_A_HARVEST_FISH_6 = RuleImage(roi_front=(898,159,45,38), roi_back=(869,131,154,174), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_6.png")
 	# 太阴3 
-	I_A_HARVEST_MOON_3 = RuleImage(roi_front=(897,159,46,40), roi_back=(869,127,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_moon_3.png")
+	I_A_HARVEST_MOON_3 = RuleImage(roi_front=(897,159,46,40), roi_back=(869,127,154,174), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_moon_3.png")
 	# 卸下 
 	I_A_DEMOUNT = RuleImage(roi_front=(939,575,55,47), roi_back=(903,551,107,91), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_demount.png")
 	# 斗鱼3 
-	I_A_HARVEST_FISH_3 = RuleImage(roi_front=(891,165,57,39), roi_back=(854,128,132,124), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_3.png")
+	I_A_HARVEST_FISH_3 = RuleImage(roi_front=(891,165,57,39), roi_back=(854,128,154,174), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_3.png")
 	# 胧车  
-	I_A_HARVEST_OBOROGURUMA = RuleImage(roi_front=(891,165,57,39), roi_back=(854,128,132,124), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_oboroguruma.png")
+	I_A_HARVEST_OBOROGURUMA = RuleImage(roi_front=(891,165,57,39), roi_back=(854,128,154,174), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_oboroguruma.png")
 
 
 	# Image Rule Assets

+ 1 - 1
tasks/RealmRaid/assets.py

@@ -61,7 +61,7 @@ class RealmRaidAssets:
 	# 呱太入侵, 第一次进入结界时候出现 
 	I_FROG_RAID = RuleImage(roi_front=(511,301,282,100), roi_back=(511,301,282,100), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_frog_raid.png")
 	# 个人 
-	I_RR_PERSON = RuleImage(roi_front=(1203,236,56,100), roi_back=(1203,236,56,100), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_rr_person.png")
+	I_RR_PERSON = RuleImage(roi_front=(1203,236,56,100), roi_back=(1203,236,56,155), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_rr_person.png")
 
 
 	# Ocr Rule Assets

+ 1 - 1
tasks/RealmRaid/res/image2.json

@@ -30,7 +30,7 @@
     "itemName": "rr_person",
     "imageName": "res_rr_person.png",
     "roiFront": "1203,236,56,100",
-    "roiBack": "1203,236,56,100",
+    "roiBack": "1203,236,56,155",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "个人"