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

fix(tasks): Adapt to both new and old fonts simultaneously

ryland 10 месяцев назад
Родитель
Сommit
5cd44c877b

+ 4 - 2
tasks/BondlingFairyland/script_task.py

@@ -795,10 +795,12 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
 
-    config = Config('SWITCH')
+    config = Config('oas1')
     device = Device(config)
     t = ScriptTask(config, device)
-    t.run()
+    # t.run()
+    t.ui_get_current_page()
+    t.ui_goto(page_bondling_fairyland)
     # image = task.screenshot()
 
     # con = config.bondling_fairyland

+ 0 - 1
tasks/Delegation/script_task.py

@@ -130,7 +130,6 @@ class ScriptTask(GameUi, DelegationAssets):
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
-    from memory_profiler import profile
     c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)

+ 8 - 8
tasks/GameUi/assets.py

@@ -46,25 +46,25 @@ class GameUiAssets:
 	# description 
 	I_CHECK_EXPLORATION = RuleImage(roi_front=(1146,175,21,22), roi_back=(1146,175,21,22), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
 	# 探索前往觉醒 
-	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(57,628,57,61), roi_back=(33,619,113,79), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
+	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(57,628,57,42), roi_back=(33,619,113,79), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
 	# 探索前往御魂 
 	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(159,633,55,55), roi_back=(138,620,89,75), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
 	# 探索前往结界突破 
-	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(248,636,67,48), roi_back=(229,612,203,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
+	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(248,636,67,48), roi_back=(229,612,203,87), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
 	# 探索前往御灵 
 	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(353,639,47,45), roi_back=(346,626,178,67), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
 	# 探索前往式神委派 
-	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(445,638,60,50), roi_back=(445,638,180,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
+	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(453,639,53,37), roi_back=(409,613,167,75), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
 	# 探索前往秘闻 
-	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(546,628,61,55), roi_back=(524,614,200,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(549,633,53,40), roi_back=(524,614,200,87), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
 	# 探索前往地域鬼王 
-	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,180,45), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
+	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,180,45), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
 	# 探索前往平安奇谭 
 	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(739,643,180,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	# 探索前往六道之门 
-	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(938,640,60,49), roi_back=(918,631,200,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(938,640,60,49), roi_back=(918,631,200,66), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
 	# 探索前往契灵之境 
-	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1037,639,56,49), roi_back=(1018,633,203,64), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
+	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1037,635,56,44), roi_back=(918,623,218,72), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
 	# description 
 	I_BACK_BLUE = RuleImage(roi_front=(32,37,54,52), roi_back=(3,2,130,114), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_blue.png")
 	# description 
@@ -148,7 +148,7 @@ class GameUiAssets:
 	# description 
 	I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,661,41,22), roi_back=(644,613,81,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
 	# description 
-	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(540,611,50,54), roi_back=(540,611,50,54), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
+	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(544,611,50,47), roi_back=(520,583,99,105), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
 	# description 
 	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(437,625,38,48), roi_back=(366,606,192,83), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
 	# description 

BIN
tasks/GameUi/page/page_exploration_goto_awake_zone.png


BIN
tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png


BIN
tasks/GameUi/page/page_exploration_goto_delegation.png


BIN
tasks/GameUi/page/page_exploration_goto_secret_zones.png


+ 13 - 13
tasks/GameUi/page/page_img.json

@@ -38,10 +38,10 @@
   {
     "itemName": "exploration_goto_awake_zone",
     "imageName": "page_exploration_goto_awake_zone.png",
-    "roiFront": "57,628,57,61",
+    "roiFront": "57,628,57,42",
     "roiBack": "33,619,113,79",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往觉醒"
   },
   {
@@ -59,7 +59,7 @@
     "roiFront": "248,636,67,48",
     "roiBack": "229,612,203,87",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往结界突破"
   },
   {
@@ -74,19 +74,19 @@
   {
     "itemName": "exploration_goto_delegation",
     "imageName": "page_exploration_goto_delegation.png",
-    "roiFront": "445,638,60,50",
-    "roiBack": "445,638,180,50",
+    "roiFront": "453,639,53,37",
+    "roiBack": "409,613,167,75",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往式神委派"
   },
   {
     "itemName": "exploration_goto_secret_zones",
     "imageName": "page_exploration_goto_secret_zones.png",
-    "roiFront": "546,628,61,55",
+    "roiFront": "549,633,53,40",
     "roiBack": "524,614,200,87",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "探索前往秘闻"
   },
   {
@@ -95,7 +95,7 @@
     "roiFront": "640,638,51,45",
     "roiBack": "640,638,180,45",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往地域鬼王"
   },
   {
@@ -113,16 +113,16 @@
     "roiFront": "938,640,60,49",
     "roiBack": "918,631,200,66",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往六道之门"
   },
   {
     "itemName": "exploration_goto_bondling_fairyland",
     "imageName": "page_exploration_goto_bondling_fairyland.png",
-    "roiFront": "1037,639,56,49",
-    "roiBack": "1018,633,203,64",
+    "roiFront": "1037,635,56,44",
+    "roiBack": "918,623,218,72",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往契灵之境"
   },
   {

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

@@ -47,8 +47,8 @@
   {
     "itemName": "main_goto_guild",
     "imageName": "page_main_goto_guild.png",
-    "roiFront": "540,611,50,54",
-    "roiBack": "540,611,50,54",
+    "roiFront": "544,611,50,47",
+    "roiBack": "520,583,99,105",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "description"

BIN
tasks/GameUi/page/page_main_goto_guild.png


+ 2 - 2
tasks/KekkaiActivation/script_task.py

@@ -413,9 +413,9 @@ if __name__ == "__main__":
     from module.device.device import Device
     import cv2
 
-    c = Config('switch')
+    c = Config('oas1')
     d = Device(c)
 
     t = ScriptTask(c, d)
-    t.check_card_num()
+    t.run()
     # t.run_activation(t.config.kekkai_activation.activation_config)

+ 1 - 1
tasks/RyouToppa/assets.py

@@ -125,7 +125,7 @@ class RyouToppaAssets:
 	# 开始寮突按钮 
 	I_START_TOPPA_BUTTON = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_start_toppa_button.png")
 	# 寮击破奖励 
-	I_RYOU_REWARD = RuleImage(roi_front=(134,417,241,40), roi_back=(134,417,241,40), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_ryou_reward.png")
+	I_RYOU_REWARD = RuleImage(roi_front=(134,417,241,40), roi_back=(122,390,340,84), threshold=0.65, method="Template matching", file="./tasks/RyouToppa/res/res_ryou_reward.png")
 	# 勋章奖励标题 
 	I_GUILD_ORDERS_REWARDS = RuleImage(roi_front=(1123,31,115,56), roi_back=(1123,31,115,56), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_guild_orders_rewards.png")
 	# 攻破阴阳寮 

+ 2 - 2
tasks/RyouToppa/res/image.json

@@ -39,9 +39,9 @@
     "itemName": "ryou_reward",
     "imageName": "res_ryou_reward.png",
     "roiFront": "134,417,241,40",
-    "roiBack": "134,417,241,40",
+    "roiBack": "122,390,340,84",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "寮击破奖励"
   },
   {