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

Merge pull request #940 from runhey/dev

Automated PR 2025.07.17
huangrunheng 1 год назад
Родитель
Сommit
7e62be584e
72 измененных файлов с 342 добавлено и 155 удалено
  1. 3 3
      dev_tools/assets_test.py
  2. BIN
      tasks/ActivityShikigami/as/as_ap.png
  3. BIN
      tasks/ActivityShikigami/as/as_ap_activity.png
  4. BIN
      tasks/ActivityShikigami/as/as_battle.png
  5. BIN
      tasks/ActivityShikigami/as/as_fire.png
  6. BIN
      tasks/ActivityShikigami/as/as_lock.png
  7. BIN
      tasks/ActivityShikigami/as/as_red_exit.png
  8. BIN
      tasks/ActivityShikigami/as/as_shi.png
  9. BIN
      tasks/ActivityShikigami/as/as_shi_org.png
  10. BIN
      tasks/ActivityShikigami/as/as_skip_button.png
  11. BIN
      tasks/ActivityShikigami/as/as_switch.png
  12. BIN
      tasks/ActivityShikigami/as/as_toggle_button.png
  13. BIN
      tasks/ActivityShikigami/as/as_unlock.png
  14. 4 4
      tasks/ActivityShikigami/as/click.json
  15. 38 20
      tasks/ActivityShikigami/as/image.json
  16. 4 4
      tasks/ActivityShikigami/as/ocr.json
  17. 19 15
      tasks/ActivityShikigami/assets.py
  18. 57 4
      tasks/ActivityShikigami/script_task.py
  19. 1 1
      tasks/Component/GeneralBattle/assets.py
  20. BIN
      tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png
  21. 2 2
      tasks/Component/GeneralBattle/gb/image.json
  22. 1 1
      tasks/Component/GeneralBuff/assets.py
  23. 2 2
      tasks/Component/GeneralBuff/gb/image.json
  24. 5 5
      tasks/DailyTrifles/assets.py
  25. 8 8
      tasks/DailyTrifles/store/image.json
  26. BIN
      tasks/DailyTrifles/store/store_gift_recommend.png
  27. BIN
      tasks/DailyTrifles/store/store_gift_sign.png
  28. BIN
      tasks/DailyTrifles/store/store_room_gift.png
  29. 4 2
      tasks/DemonEncounter/assets.py
  30. 6 0
      tasks/DemonEncounter/config.py
  31. 0 0
      tasks/DemonEncounter/demon/demon_jade_50.png
  32. 0 0
      tasks/DemonEncounter/demon/demon_mystery_amulet.png
  33. BIN
      tasks/DemonEncounter/demon/demon_sushi.png
  34. 16 7
      tasks/DemonEncounter/demon/image.json
  35. 13 5
      tasks/DemonEncounter/script_task.py
  36. 1 1
      tasks/Exploration/assets.py
  37. 3 3
      tasks/Exploration/res/image.json
  38. 8 8
      tasks/FloatParade/assets.py
  39. 2 1
      tasks/FloatParade/config.py
  40. BIN
      tasks/FloatParade/fp/fp_.png
  41. BIN
      tasks/FloatParade/fp/fp_batch_selection.png
  42. BIN
      tasks/FloatParade/fp/fp_batch_selection_confirm.png
  43. BIN
      tasks/FloatParade/fp/fp_fp_access.png
  44. BIN
      tasks/FloatParade/fp/fp_fp_batch.png
  45. BIN
      tasks/FloatParade/fp/fp_fp_batch_false.png
  46. BIN
      tasks/FloatParade/fp/fp_fp_batch_true.png
  47. BIN
      tasks/FloatParade/fp/fp_fp_getall0.png
  48. BIN
      tasks/FloatParade/fp/fp_fp_getall1.png
  49. BIN
      tasks/FloatParade/fp/fp_fp_gift_close.png
  50. BIN
      tasks/FloatParade/fp/fp_fp_gift_flag1.png
  51. BIN
      tasks/FloatParade/fp/fp_fp_gift_flag2.png
  52. BIN
      tasks/FloatParade/fp/fp_fp_red_close.png
  53. BIN
      tasks/FloatParade/fp/fp_fp_red_point0.png
  54. BIN
      tasks/FloatParade/fp/fp_fp_red_point1.png
  55. BIN
      tasks/FloatParade/fp/fp_fp_red_point2.png
  56. BIN
      tasks/FloatParade/fp/fp_fp_tasks.png
  57. BIN
      tasks/FloatParade/fp/fp_fp_upgrade.png
  58. BIN
      tasks/FloatParade/fp/fp_toggle_button.png
  59. 31 31
      tasks/FloatParade/fp/image.json
  60. 13 4
      tasks/FloatParade/script_task.py
  61. 1 1
      tasks/Hyakkiyakou/slave/hya_device.py
  62. 3 1
      tasks/KekkaiUtilize/assets.py
  63. 2 0
      tasks/KekkaiUtilize/config.py
  64. 56 19
      tasks/KekkaiUtilize/script_task.py
  65. 9 0
      tasks/KekkaiUtilize/utilize/ocr.json
  66. 2 2
      tasks/KekkaiUtilize/utilize/swipe.json
  67. 4 0
      tasks/Restart/assets.py
  68. 5 0
      tasks/Restart/login.py
  69. 18 0
      tasks/Restart/login/image.json
  70. BIN
      tasks/Restart/login/login_early_server.png
  71. BIN
      tasks/Restart/login/login_early_server_cancel.png
  72. 1 1
      tasks/RichMan/mall/special.py

+ 3 - 3
dev_tools/assets_test.py

@@ -34,10 +34,10 @@ def detect_ocr(file: str, target: RuleOcr):
 
 
 
 
 # 图片文件路径 可以是相对路径
 # 图片文件路径 可以是相对路径
-IMAGE_FILE = r"C:\Users\萌萌哒\Desktop\424368633-6b29ec7d-8f68-4cfc-a52f-c671bb159999.png"
+IMAGE_FILE = r"C:\Users\萌萌哒\Desktop\465610922-c9f6f975-0159-4e24-a569-88aa3e862d70.png"
 if __name__ == '__main__':
 if __name__ == '__main__':
-    from tasks.RyouToppa.script_task import ScriptTask
-    targe = ScriptTask.I_PREPARE_HIGHLIGHT
+    from tasks.Exploration.script_task import ScriptTask
+    targe = ScriptTask.I_CLOUD
     print(detect_image(IMAGE_FILE, targe))
     print(detect_image(IMAGE_FILE, targe))
 
 
     # ocr demo
     # ocr demo

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_red_exit.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_shi_org.png


BIN
tasks/ActivityShikigami/as/as_skip_button.png


BIN
tasks/ActivityShikigami/as/as_switch.png


BIN
tasks/ActivityShikigami/as/as_toggle_button.png


BIN
tasks/ActivityShikigami/as/as_unlock.png


+ 4 - 4
tasks/ActivityShikigami/as/click.json

@@ -1,14 +1,14 @@
 [
 [
   {
   {
     "itemName": "random_left",
     "itemName": "random_left",
-    "roiFront": "21,23,290,599",
-    "roiBack": "21,23,290,599",
+    "roiFront": "21,23,237,599",
+    "roiBack": "21,23,237,599",
     "description": "description"
     "description": "description"
   },
   },
   {
   {
     "itemName": "random_right",
     "itemName": "random_right",
-    "roiFront": "969,55,296,638",
-    "roiBack": "969,55,296,638",
+    "roiFront": "1047,55,218,638",
+    "roiBack": "1047,55,218,638",
     "description": "description"
     "description": "description"
   },
   },
   {
   {

+ 38 - 20
tasks/ActivityShikigami/as/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "shi",
     "itemName": "shi",
     "imageName": "as_shi.png",
     "imageName": "as_shi.png",
-    "roiFront": "520,202,33,34",
-    "roiBack": "506,185,66,67",
+    "roiFront": "1183,241,47,38",
+    "roiBack": "1164,134,83,318",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "进入活动"
     "description": "进入活动"
@@ -20,11 +20,11 @@
   {
   {
     "itemName": "battle",
     "itemName": "battle",
     "imageName": "as_battle.png",
     "imageName": "as_battle.png",
-    "roiFront": "458,238,35,135",
-    "roiBack": "407,147,153,315",
+    "roiFront": "744,327,35,135",
+    "roiBack": "680,230,154,315",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
-    "description": "进入爬塔"
+    "description": "不尽山途"
   },
   },
   {
   {
     "itemName": "battle_1",
     "itemName": "battle_1",
@@ -47,8 +47,8 @@
   {
   {
     "itemName": "lock",
     "itemName": "lock",
     "imageName": "as_lock.png",
     "imageName": "as_lock.png",
-    "roiFront": "801,662,25,28",
-    "roiBack": "774,639,76,80",
+    "roiFront": "877,647,25,26",
+    "roiBack": "761,613,255,76",
     "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": "799,661,28,28",
-    "roiBack": "774,645,78,74",
+    "roiFront": "875,647,28,25",
+    "roiBack": "758,607,242,85",
     "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": "1129,611,84,46",
-    "roiBack": "1097,552,150,160",
+    "roiFront": "1131,598,103,54",
+    "roiBack": "1123,589,124,88",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "点击战斗"
     "description": "点击战斗"
@@ -74,16 +74,16 @@
   {
   {
     "itemName": "ap",
     "itemName": "ap",
     "imageName": "as_ap.png",
     "imageName": "as_ap.png",
-    "roiFront": "1091,557,23,24",
+    "roiFront": "1091,550,23,24",
     "roiBack": "1081,532,103,71",
     "roiBack": "1081,532,103,71",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
-    "description": "体力按钮"
+    "description": "寿司体力"
   },
   },
   {
   {
     "itemName": "ap_activity",
     "itemName": "ap_activity",
     "imageName": "as_ap_activity.png",
     "imageName": "as_ap_activity.png",
-    "roiFront": "1133,557,21,27",
+    "roiFront": "1152,552,21,25",
     "roiBack": "1108,542,84,54",
     "roiBack": "1108,542,84,54",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
@@ -92,8 +92,8 @@
   {
   {
     "itemName": "switch",
     "itemName": "switch",
     "imageName": "as_switch.png",
     "imageName": "as_switch.png",
-    "roiFront": "1214,559,23,23",
-    "roiBack": "1204,541,69,56",
+    "roiFront": "1242,553,23,23",
+    "roiBack": "1222,541,54,49",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "切换按键"
     "description": "切换按键"
@@ -117,10 +117,28 @@
     "description": "增加到最大"
     "description": "增加到最大"
   },
   },
   {
   {
-    "itemName": "new",
-    "imageName": "as_new.png",
-    "roiFront": "1004,192,65,52",
-    "roiBack": "0,0,100,100",
+    "itemName": "skip_button",
+    "imageName": "as_skip_button.png",
+    "roiFront": "1154,34,64,30",
+    "roiBack": "1154,34,64,30",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "右上跳过按钮"
+  },
+  {
+    "itemName": "red_exit",
+    "imageName": "as_red_exit.png",
+    "roiFront": "1071,141,49,46",
+    "roiBack": "1071,141,49,46",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "红色退出"
+  },
+  {
+    "itemName": "toggle_button",
+    "imageName": "as_toggle_button.png",
+    "roiFront": "1193,463,27,25",
+    "roiBack": "1169,146,73,403",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"

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

@@ -1,8 +1,8 @@
 [
 [
   {
   {
     "itemName": "remain_ap",
     "itemName": "remain_ap",
-    "roiFront": "942,16,68,32",
-    "roiBack": "942,16,68,32",
+    "roiFront": "98,591,38,28",
+    "roiBack": "98,591,38,28",
     "mode": "DigitCounter",
     "mode": "DigitCounter",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
@@ -28,8 +28,8 @@
   },
   },
   {
   {
     "itemName": "remain_ap_activity2",
     "itemName": "remain_ap_activity2",
-    "roiFront": "534,18,71,29",
-    "roiBack": "534,18,71,29",
+    "roiFront": "740,25,71,29",
+    "roiBack": "740,25,71,29",
     "mode": "Digit",
     "mode": "Digit",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",

+ 19 - 15
tasks/ActivityShikigami/assets.py

@@ -32,9 +32,9 @@ class ActivityShikigamiAssets:
 
 
 	# Click Rule Assets
 	# Click Rule Assets
 	# description 
 	# description 
-	C_RANDOM_LEFT = RuleClick(roi_front=(21,23,290,599), roi_back=(21,23,290,599), name="random_left")
+	C_RANDOM_LEFT = RuleClick(roi_front=(21,23,237,599), roi_back=(21,23,237,599), name="random_left")
 	# description 
 	# description 
-	C_RANDOM_RIGHT = RuleClick(roi_front=(969,55,296,638), roi_back=(969,55,296,638), name="random_right")
+	C_RANDOM_RIGHT = RuleClick(roi_front=(1047,55,218,638), roi_back=(1047,55,218,638), name="random_right")
 	# description 
 	# description 
 	C_RANDOM_TOP = RuleClick(roi_front=(85,46,1159,101), roi_back=(85,46,1159,101), name="random_top")
 	C_RANDOM_TOP = RuleClick(roi_front=(85,46,1159,101), roi_back=(85,46,1159,101), name="random_top")
 	# description 
 	# description 
@@ -45,44 +45,48 @@ class ActivityShikigamiAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 进入活动 
 	# 进入活动 
-	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_SHI = RuleImage(roi_front=(1183,241,47,38), roi_back=(1164,134,83,318), 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=(458,238,35,135), roi_back=(407,147,153,315), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle.png")
+	# 不尽山途 
+	I_BATTLE = RuleImage(roi_front=(744,327,35,135), roi_back=(680,230,154,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=(801,662,25,28), roi_back=(774,639,76,80), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_lock.png")
+	I_LOCK = RuleImage(roi_front=(877,647,25,26), roi_back=(761,613,255,76), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_lock.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_UNLOCK = RuleImage(roi_front=(875,647,28,25), roi_back=(758,607,242,85), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.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=(1091,557,23,24), roi_back=(1081,532,103,71), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_ap.png")
+	I_FIRE = RuleImage(roi_front=(1131,598,103,54), roi_back=(1123,589,124,88), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_fire.png")
+	# 寿司体力 
+	I_AP = RuleImage(roi_front=(1091,550,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=(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_AP_ACTIVITY = RuleImage(roi_front=(1152,552,21,25), 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=(1214,559,23,23), roi_back=(1204,541,69,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_switch.png")
+	I_SWITCH = RuleImage(roi_front=(1242,553,23,23), roi_back=(1222,541,54,49), 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")
 	# 增加到最大 
 	# 增加到最大 
 	I_ADD_MAX = RuleImage(roi_front=(17,24,33,37), roi_back=(974,524,57,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_add_max.png")
 	I_ADD_MAX = RuleImage(roi_front=(17,24,33,37), roi_back=(974,524,57,54), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_add_max.png")
+	# 右上跳过按钮 
+	I_SKIP_BUTTON = RuleImage(roi_front=(1154,34,64,30), roi_back=(1154,34,64,30), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_skip_button.png")
+	# 红色退出 
+	I_RED_EXIT = RuleImage(roi_front=(1071,141,49,46), roi_back=(1071,141,49,46), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_red_exit.png")
 	# description 
 	# description 
-	I_NEW = RuleImage(roi_front=(1004,192,65,52), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_new.png")
+	I_TOGGLE_BUTTON = RuleImage(roi_front=(1193,463,27,25), roi_back=(1169,146,73,403), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_toggle_button.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets
 	# 体力的数量检测 
 	# 体力的数量检测 
-	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 = RuleOcr(roi=(98,591,38,28), area=(98,591,38,28), mode="DigitCounter", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
 	# 活动体力的剩余检测 
 	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_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=(534,18,71,29), area=(534,18,71,29), mode="Digit", method="Default", keyword="", name="remain_ap_activity2")
+	O_REMAIN_AP_ACTIVITY2 = RuleOcr(roi=(740,25,71,29), area=(740,25,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")
 
 

+ 57 - 4
tasks/ActivityShikigami/script_task.py

@@ -139,22 +139,32 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
 
 
     def home_main(self) -> bool:
     def home_main(self) -> bool:
         """
         """
-        从庭院到活动的爬塔界面
+        从庭院到活动的爬塔界面,统一入口
         :return:
         :return:
         """
         """
 
 
         logger.hr("Enter Shikigami", 2)
         logger.hr("Enter Shikigami", 2)
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
+            self.C_RANDOM_LEFT.name = "BATTLE_RANDOM"
+            self.C_RANDOM_RIGHT.name = "BATTLE_RANDOM"
+            self.C_RANDOM_TOP.name = "BATTLE_RANDOM"
+            self.C_RANDOM_BOTTOM.name = "BATTLE_RANDOM"
             if self.appear(self.I_FIRE):
             if self.appear(self.I_FIRE):
                 break
                 break
             if self.appear_then_click(self.I_SHI, interval=1):
             if self.appear_then_click(self.I_SHI, interval=1):
                 continue
                 continue
-            if self.ocr_appear_click(self.O_ENTRY_ACTIVITY, interval=1):
+            if self.appear_then_click(self.I_TOGGLE_BUTTON, interval=3):
                 continue
                 continue
-            if self.appear_then_click(self.I_BATTLE, interval=1):
+            if self.appear_then_click(self.I_SKIP_BUTTON, interval=1.5):
                 continue
                 continue
-            if self.appear_then_click(self.I_BATTLE_1, interval=1):
+            # 如果出现了 “获得奖励”
+            reward_click = random.choice([self.C_RANDOM_LEFT, self.C_RANDOM_RIGHT, self.C_RANDOM_TOP, self.C_RANDOM_BOTTOM])
+            if self.appear_then_click(self.I_UI_REWARD, action=reward_click, interval=1.3):
+                continue
+            if self.appear_then_click(self.I_RED_EXIT, interval=1.5):
+                continue
+            if self.appear_then_click(self.I_BATTLE, interval=2):
                 continue
                 continue
 
 
     def main_home(self) -> bool:
     def main_home(self) -> bool:
@@ -273,6 +283,49 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
     #         if random_click_swipt_enable:
     #         if random_click_swipt_enable:
     #             self.random_click_swipt()
     #             self.random_click_swipt()
 
 
+    def battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        # 重写
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        self.device.click_record_clear()
+        logger.info("Start battle process")
+        self.C_RANDOM_LEFT.name = "BATTLE_RANDOM"
+        self.C_RANDOM_RIGHT.name = "BATTLE_RANDOM"
+        self.C_RANDOM_TOP.name = "BATTLE_RANDOM"
+        self.C_RANDOM_BOTTOM.name = "BATTLE_RANDOM"
+        click_count = 0
+        while 1:
+            self.screenshot()
+            # 如果出现了 “鼓”
+            if self.appear_then_click(self.I_WIN, interval=2.3):
+                logger.info("Win")
+                continue
+            #  出现 “魂” 和 紫蛇皮
+            if self.appear(self.I_REWARD):
+                logger.info('Win battle')
+                self.wait_until_appear(self.I_REWARD_PURPLE_SNAKE_SKIN, wait_time=5)
+                while 1:
+                    self.screenshot()
+                    appear_reward = self.appear(self.I_REWARD)
+                    appear_reward_purple_snake_skin = self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN)
+                    if not appear_reward and not appear_reward_purple_snake_skin and click_count >= 1:
+                        break
+                    if appear_reward or appear_reward_purple_snake_skin:
+                        reward_click = random.choice(
+                            [self.C_RANDOM_LEFT, self.C_RANDOM_RIGHT, self.C_RANDOM_TOP])
+                        self.click(reward_click, interval=1.8)
+                        click_count += 1
+                        continue
+                return True
+
+            # 失败 -> 正常人不会失败
+            if self.appear(self.I_FALSE):
+                logger.warning('False battle')
+                self.ui_click_until_disappear(self.I_FALSE)
+                return False
+            # 如果开启战斗过程随机滑动
+            if random_click_swipt_enable:
+                self.random_click_swipt()
+
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config

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

@@ -110,7 +110,7 @@ class GeneralBattleAssets:
 	# 结算金币 
 	# 结算金币 
 	I_REWARD_GOLD = RuleImage(roi_front=(268,178,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
 	I_REWARD_GOLD = RuleImage(roi_front=(268,178,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
 	# 结算紫蛇皮 
 	# 结算紫蛇皮 
-	I_REWARD_PURPLE_SNAKE_SKIN = RuleImage(roi_front=(403,177,97,73), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png")
+	I_REWARD_PURPLE_SNAKE_SKIN = RuleImage(roi_front=(604,213,67,37), roi_back=(108,163,1070,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png")
 	# 结算金蛇皮 
 	# 结算金蛇皮 
 	I_REWARD_GOLD_SNAKE_SKIN = RuleImage(roi_front=(537,176,97,75), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png")
 	I_REWARD_GOLD_SNAKE_SKIN = RuleImage(roi_front=(537,176,97,75), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png")
 	# 结算四星青吉鬼 
 	# 结算四星青吉鬼 

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


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

@@ -191,8 +191,8 @@
   {
   {
     "itemName": "reward_purple_snake_skin",
     "itemName": "reward_purple_snake_skin",
     "imageName": "gb_reward_purple_snake_skin.png",
     "imageName": "gb_reward_purple_snake_skin.png",
-    "roiFront": "403,177,97,73",
-    "roiBack": "254,163,797,261",
+    "roiFront": "604,213,67,37",
+    "roiBack": "108,163,1070,261",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "结算紫蛇皮"
     "description": "结算紫蛇皮"

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

@@ -30,7 +30,7 @@ class GeneralBuffAssets:
 	# description 
 	# description 
 	I_CLOSE_RED = RuleImage(roi_front=(774,143,21,21), roi_back=(764,134,38,369), threshold=0.63, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_close_red.png")
 	I_CLOSE_RED = RuleImage(roi_front=(774,143,21,21), roi_back=(764,134,38,369), threshold=0.63, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_close_red.png")
 	# 用来判定是否点击的那个 
 	# 用来判定是否点击的那个 
-	I_CLOUD = RuleImage(roi_front=(356,505,65,38), roi_back=(356,505,65,38), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_cloud.png")
+	I_CLOUD = RuleImage(roi_front=(357,505,65,38), roi_back=(313,484,158,75), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_cloud.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets

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

@@ -83,8 +83,8 @@
   {
   {
     "itemName": "cloud",
     "itemName": "cloud",
     "imageName": "gb_cloud.png",
     "imageName": "gb_cloud.png",
-    "roiFront": "356,505,65,38",
-    "roiBack": "356,505,65,38",
+    "roiFront": "357,505,65,38",
+    "roiBack": "313,484,158,75",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "用来判定是否点击的那个"
     "description": "用来判定是否点击的那个"

+ 5 - 5
tasks/DailyTrifles/assets.py

@@ -31,13 +31,13 @@ class DailyTriflesAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 礼包屋 
 	# 礼包屋 
-	I_ROOM_GIFT = RuleImage(roi_front=(1152,644,52,53), roi_back=(1127,611,103,94), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_room_gift.png")
+	I_ROOM_GIFT = RuleImage(roi_front=(1138,658,52,40), roi_back=(1119,621,103,94), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_room_gift.png")
 	# description 
 	# description 
-	I_GIFT_RECOMMEND = RuleImage(roi_front=(1186,98,53,64), roi_back=(1172,83,83,306), threshold=0.7, method="Template matching", file="./tasks/DailyTrifles/store/store_gift_recommend.png")
-	# 免费一抽 
-	I_GIFT_SIGN = RuleImage(roi_front=(236,129,306,218), roi_back=(236,129,306,218), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_gift_sign.png")
+	I_GIFT_RECOMMEND = RuleImage(roi_front=(1183,454,53,64), roi_back=(1162,77,98,457), threshold=0.7, method="Template matching", file="./tasks/DailyTrifles/store/store_gift_recommend.png")
+	# 免费一抽领黑蛋 
+	I_GIFT_SIGN = RuleImage(roi_front=(629,192,129,149), roi_back=(130,129,891,473), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_gift_sign.png")
 	# 体力 
 	# 体力 
-	I_SPECIAL_SUSHI = RuleImage(roi_front=(180,130,800,460), roi_back=(180,130,800,460), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_sushi.png")
+	I_SPECIAL_SUSHI = RuleImage(roi_front=(180,130,800,460), roi_back=(180,130,800,460), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_special_sushi.png")
 	# 购买时货币类型为勾玉 
 	# 购买时货币类型为勾玉 
 	I_STORE_COST_TYPE_JADE = RuleImage(roi_front=(600,490,50,60), roi_back=(600,490,50,60), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_cost_type_jade.png")
 	I_STORE_COST_TYPE_JADE = RuleImage(roi_front=(600,490,50,60), roi_back=(600,490,50,60), threshold=0.8, method="Template matching", file="./tasks/DailyTrifles/store/store_cost_type_jade.png")
 
 

+ 8 - 8
tasks/DailyTrifles/store/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "room_gift",
     "itemName": "room_gift",
     "imageName": "store_room_gift.png",
     "imageName": "store_room_gift.png",
-    "roiFront": "1152,644,52,53",
-    "roiBack": "1127,611,103,94",
+    "roiFront": "1138,658,52,40",
+    "roiBack": "1119,621,103,94",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "礼包屋"
     "description": "礼包屋"
@@ -11,8 +11,8 @@
   {
   {
     "itemName": "gift_recommend",
     "itemName": "gift_recommend",
     "imageName": "store_gift_recommend.png",
     "imageName": "store_gift_recommend.png",
-    "roiFront": "1186,98,53,64",
-    "roiBack": "1172,83,83,306",
+    "roiFront": "1183,454,53,64",
+    "roiBack": "1162,77,98,457",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "description"
     "description": "description"
@@ -20,15 +20,15 @@
   {
   {
     "itemName": "gift_sign",
     "itemName": "gift_sign",
     "imageName": "store_gift_sign.png",
     "imageName": "store_gift_sign.png",
-    "roiFront": "236,129,306,218",
-    "roiBack": "236,129,306,218",
+    "roiFront": "629,192,129,149",
+    "roiBack": "130,129,891,473",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
-    "description": "免费一抽"
+    "description": "免费一抽领黑蛋"
   },
   },
   {
   {
     "itemName": "special_sushi",
     "itemName": "special_sushi",
-    "imageName": "store_sushi.png",
+    "imageName": "store_special_sushi.png",
     "roiFront": "180,130,800,460",
     "roiFront": "180,130,800,460",
     "roiBack": "180,130,800,460",
     "roiBack": "180,130,800,460",
     "method": "Template matching",
     "method": "Template matching",

BIN
tasks/DailyTrifles/store/store_gift_recommend.png


BIN
tasks/DailyTrifles/store/store_gift_sign.png


BIN
tasks/DailyTrifles/store/store_room_gift.png


+ 4 - 2
tasks/DemonEncounter/assets.py

@@ -84,9 +84,11 @@ class DemonEncounterAssets:
 	# 左下角小指针 
 	# 左下角小指针 
 	I_DE_LOCATION = RuleImage(roi_front=(26,653,44,47), roi_back=(26,653,44,47), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_location.png")
 	I_DE_LOCATION = RuleImage(roi_front=(26,653,44,47), roi_back=(26,653,44,47), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_location.png")
 	# 逢魔蓝票 
 	# 逢魔蓝票 
-	I_BLUE_PIAO = RuleImage(roi_front=(420,226,444,262), roi_back=(420,226,444,262), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/blue_piao.png")
+	I_MYSTERY_AMULET = RuleImage(roi_front=(596,314,84,82), roi_back=(581,294,115,116), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_mystery_amulet.png")
+	# 逢魔体力 
+	I_SUSHI = RuleImage(roi_front=(602,318,72,54), roi_back=(581,294,115,116), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_sushi.png")
 	# 50勾玉购买 
 	# 50勾玉购买 
-	I_JADE_50 = RuleImage(roi_front=(420,226,444,262), roi_back=(420,226,444,262), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/jade_50.png")
+	I_JADE_50 = RuleImage(roi_front=(593,425,84,46), roi_back=(548,405,182,83), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_jade_50.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets

+ 6 - 0
tasks/DemonEncounter/config.py

@@ -10,6 +10,11 @@ from tasks.Component.config_base import ConfigBase, TimeDelta
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Utils.config_enum import ShikigamiClass
 from tasks.Utils.config_enum import ShikigamiClass
 
 
+# 宝箱购买项目
+class BoxBuyConfig(BaseModel):
+    # 默认购买蓝票,未添加选项,没人会不买吧!
+    box_buy_sushi: bool = Field(default=False, description='逢魔宝箱是否购买体力')
+
 class BestDemonBossSelect(BaseModel):
 class BestDemonBossSelect(BaseModel):
     enable: bool = Field(
     enable: bool = Field(
         default=False,
         default=False,
@@ -70,6 +75,7 @@ class UtilizeScheduler(Scheduler):
 
 
 class DemonEncounter(ConfigBase):
 class DemonEncounter(ConfigBase):
     scheduler: UtilizeScheduler = Field(default_factory=UtilizeScheduler)
     scheduler: UtilizeScheduler = Field(default_factory=UtilizeScheduler)
+    box_buy_config: BoxBuyConfig = Field(default_factory=BoxBuyConfig)
     best_demon_boss_config: BestDemonBossSelect = Field(default_factory=BestDemonBossSelect)
     best_demon_boss_config: BestDemonBossSelect = Field(default_factory=BestDemonBossSelect)
     demon_soul_config: DemonConfig = Field(default_factory=DemonConfig)
     demon_soul_config: DemonConfig = Field(default_factory=DemonConfig)
     best_demon_soul_config: BestDemonConfig = Field(default_factory=BestDemonConfig)
     best_demon_soul_config: BestDemonConfig = Field(default_factory=BestDemonConfig)

+ 0 - 0
tasks/DemonEncounter/demon/jade_50.png → tasks/DemonEncounter/demon/demon_jade_50.png


+ 0 - 0
tasks/DemonEncounter/demon/blue_piao.png → tasks/DemonEncounter/demon/demon_mystery_amulet.png


BIN
tasks/DemonEncounter/demon/demon_sushi.png


+ 16 - 7
tasks/DemonEncounter/demon/image.json

@@ -54,19 +54,28 @@
     "description": "左下角小指针"
     "description": "左下角小指针"
   },
   },
   {
   {
-    "itemName": "blue_piao",
-    "imageName": "blue_piao.png",
-    "roiFront": "420,226,444,262",
-    "roiBack": "420,226,444,262",
+    "itemName": "mystery_amulet",
+    "imageName": "demon_mystery_amulet.png",
+    "roiFront": "596,314,84,82",
+    "roiBack": "581,294,115,116",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "逢魔蓝票"
     "description": "逢魔蓝票"
   },
   },
+  {
+    "itemName": "sushi",
+    "imageName": "demon_sushi.png",
+    "roiFront": "602,318,72,54",
+    "roiBack": "581,294,115,116",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "逢魔体力"
+  },
   {
   {
     "itemName": "jade_50",
     "itemName": "jade_50",
-    "imageName": "jade_50.png",
-    "roiFront": "420,226,444,262",
-    "roiBack": "420,226,444,262",
+    "imageName": "demon_jade_50.png",
+    "roiFront": "593,425,84,46",
+    "roiBack": "548,405,182,83",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "50勾玉购买"
     "description": "50勾玉购买"

+ 13 - 5
tasks/DemonEncounter/script_task.py

@@ -389,6 +389,7 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
             return LanternClass.BATTLE
             return LanternClass.BATTLE
 
 
     def _box(self, target_click):
     def _box(self, target_click):
+        box_buy_config = self.config.demon_encounter.box_buy_config
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
             if self.appear(self.I_JADE_50):
             if self.appear(self.I_JADE_50):
@@ -397,13 +398,20 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
                 continue
                 continue
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
-            if self.appear(self.I_BLUE_PIAO):
-                if self.click(self.I_JADE_50):
-                    logger.info('Buy a mystery amulet for 50 jade')
-                    continue
-            if not self.appear(self.I_BLUE_PIAO):
+            if not self.appear(self.I_MYSTERY_AMULET) and not (box_buy_config.box_buy_sushi and self.appear(self.I_SUSHI)):
                 if self.appear_then_click(self.I_DE_FIND, interval=2.5):
                 if self.appear_then_click(self.I_DE_FIND, interval=2.5):
                     break
                     break
+            # 默认购买蓝票
+            if self.appear(self.I_MYSTERY_AMULET):
+                logger.info('Buy a mystery amulet for 50 jade')
+                self.click(self.I_JADE_50)
+                continue
+            # 可选购买体力
+            if box_buy_config.box_buy_sushi and self.appear(self.I_SUSHI):
+                logger.info('Buy one hundred sushi for 50 jade')
+                self.click(self.I_JADE_50)
+                continue
+            
 
 
     def _mail(self, target_click):
     def _mail(self, target_click):
         # 答题
         # 答题

+ 1 - 1
tasks/Exploration/assets.py

@@ -90,7 +90,7 @@ class ExplorationAssets:
 	# 已候补出战的狗粮 
 	# 已候补出战的狗粮 
 	I_E_RATATE_EXSIT = RuleImage(roi_front=(108,580,995,32), roi_back=(108,580,995,32), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_ratate_exsit.png")
 	I_E_RATATE_EXSIT = RuleImage(roi_front=(108,580,995,32), roi_back=(108,580,995,32), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_ratate_exsit.png")
 	# 确定按钮 
 	# 确定按钮 
-	I_E_SURE_BUTTON = RuleImage(roi_front=(1135,426,43,37), roi_back=(1135,426,43,37), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_sure_button.png")
+	I_E_SURE_BUTTON = RuleImage(roi_front=(1131,425,43,37), roi_back=(1077,367,165,152), threshold=0.65, method="Template matching", file="./tasks/Exploration/res/res_e_sure_button.png")
 	# 设置按钮 
 	# 设置按钮 
 	I_E_SETTINGS_BUTTON = RuleImage(roi_front=(37,692,53,26), roi_back=(37,692,53,26), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_settings_button.png")
 	I_E_SETTINGS_BUTTON = RuleImage(roi_front=(37,692,53,26), roi_back=(37,692,53,26), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_settings_button.png")
 	# 普通怪 
 	# 普通怪 

+ 3 - 3
tasks/Exploration/res/image.json

@@ -83,10 +83,10 @@
   {
   {
     "itemName": "e_sure_button",
     "itemName": "e_sure_button",
     "imageName": "res_e_sure_button.png",
     "imageName": "res_e_sure_button.png",
-    "roiFront": "1135,426,43,37",
-    "roiBack": "1135,426,43,37",
+    "roiFront": "1131,425,43,37",
+    "roiBack": "1077,367,165,152",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "确定按钮"
     "description": "确定按钮"
   },
   },
   {
   {

+ 8 - 8
tasks/FloatParade/assets.py

@@ -12,18 +12,12 @@ class FloatParadeAssets:
 
 
 	# Image Rule Assets
 	# Image Rule Assets
 	# 从庭院进入花车活动 
 	# 从庭院进入花车活动 
-	I_FP_ACCESS = RuleImage(roi_front=(1192,317,36,34), roi_back=(1000,101,261,472), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_access.png")
+	I_FP_ACCESS = RuleImage(roi_front=(1178,168,43,34), roi_back=(1051,101,210,472), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_access.png")
 	# description 
 	# 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")
 	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 
 	# 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=(1198,555,53,54), roi_back=(1163,506,113,164), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_getall1.png")
 	I_FP_GETALL1 = RuleImage(roi_front=(1198,555,53,54), roi_back=(1163,506,113,164), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_getall1.png")
 	# description 
 	# 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")
 	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 
 	# 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")
 	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")
@@ -36,10 +30,16 @@ class FloatParadeAssets:
 	# 红色关闭 
 	# 红色关闭 
 	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")
 	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")
 	# 寻找花车的切换按钮 
 	# 寻找花车的切换按钮 
-	I_TOGGLE_BUTTON = RuleImage(roi_front=(1202,466,22,21), roi_back=(1090,127,176,377), threshold=0.7, method="Template matching", file="./tasks/FloatParade/fp/fp_toggle_button.png")
+	I_TOGGLE_BUTTON = RuleImage(roi_front=(1193,462,21,23), roi_back=(1116,127,150,377), threshold=0.7, method="Template matching", file="./tasks/FloatParade/fp/fp_toggle_button.png")
 	# 批量选择 
 	# 批量选择 
 	I_BATCH_SELECTION = RuleImage(roi_front=(933,517,44,40), roi_back=(933,517,44,40), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_batch_selection.png")
 	I_BATCH_SELECTION = RuleImage(roi_front=(933,517,44,40), roi_back=(933,517,44,40), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_batch_selection.png")
 	# 批量选择确认 
 	# 批量选择确认 
 	I_BATCH_SELECTION_CONFIRM = RuleImage(roi_front=(676,392,130,63), roi_back=(676,392,130,63), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_batch_selection_confirm.png")
 	I_BATCH_SELECTION_CONFIRM = RuleImage(roi_front=(676,392,130,63), roi_back=(676,392,130,63), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_batch_selection_confirm.png")
+	# 礼包关闭 
+	I_FP_GIFT_CLOSE = RuleImage(roi_front=(1056,96,36,38), roi_back=(1046,89,60,60), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_gift_close.png")
+	# 礼包类型1 
+	I_FP_GIFT_FLAG1 = RuleImage(roi_front=(559,295,55,44), roi_back=(559,295,55,44), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_gift_flag1.png")
+	# 礼包类型2 
+	I_FP_GIFT_FLAG2 = RuleImage(roi_front=(557,293,58,47), roi_back=(557,293,58,47), threshold=0.8, method="Template matching", file="./tasks/FloatParade/fp/fp_fp_gift_flag2.png")
 
 
 
 

+ 2 - 1
tasks/FloatParade/config.py

@@ -18,7 +18,8 @@ class LevelReward(str, Enum):
     THREE = '体力/樱饼'
     THREE = '体力/樱饼'
 
 
 class FloatParadeConfig(BaseModel):
 class FloatParadeConfig(BaseModel):
-    level_reward: LevelReward = Field(default=LevelReward.TWO)
+    level_reward1: LevelReward = Field(default=LevelReward.THREE)
+    level_reward2: LevelReward = Field(default=LevelReward.ONE)
 
 
 class FloatParade(ConfigBase):
 class FloatParade(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)

BIN
tasks/FloatParade/fp/fp_.png


BIN
tasks/FloatParade/fp/fp_batch_selection.png


BIN
tasks/FloatParade/fp/fp_batch_selection_confirm.png


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_gift_close.png


BIN
tasks/FloatParade/fp/fp_fp_gift_flag1.png


BIN
tasks/FloatParade/fp/fp_fp_gift_flag2.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


BIN
tasks/FloatParade/fp/fp_toggle_button.png


+ 31 - 31
tasks/FloatParade/fp/image.json

@@ -2,8 +2,8 @@
   {
   {
     "itemName": "fp_access",
     "itemName": "fp_access",
     "imageName": "fp_fp_access.png",
     "imageName": "fp_fp_access.png",
-    "roiFront": "1192,317,36,34",
-    "roiBack": "1000,101,261,472",
+    "roiFront": "1178,168,43,34",
+    "roiBack": "1051,101,210,472",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "从庭院进入花车活动"
     "description": "从庭院进入花车活动"
@@ -17,15 +17,6 @@
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "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",
     "itemName": "fp_getall1",
     "imageName": "fp_fp_getall1.png",
     "imageName": "fp_fp_getall1.png",
@@ -35,24 +26,6 @@
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "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",
     "itemName": "fp_batch",
     "imageName": "fp_fp_batch.png",
     "imageName": "fp_fp_batch.png",
@@ -110,8 +83,8 @@
   {
   {
     "itemName": "toggle_button",
     "itemName": "toggle_button",
     "imageName": "fp_toggle_button.png",
     "imageName": "fp_toggle_button.png",
-    "roiFront": "1202,466,22,21",
-    "roiBack": "1090,127,176,377",
+    "roiFront": "1193,462,21,23",
+    "roiBack": "1116,127,150,377",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "寻找花车的切换按钮"
     "description": "寻找花车的切换按钮"
@@ -133,5 +106,32 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "批量选择确认"
     "description": "批量选择确认"
+  },
+  {
+    "itemName": "fp_gift_close",
+    "imageName": "fp_fp_gift_close.png",
+    "roiFront": "1056,96,36,38",
+    "roiBack": "1046,89,60,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "礼包关闭"
+  },
+  {
+    "itemName": "fp_gift_flag1",
+    "imageName": "fp_fp_gift_flag1.png",
+    "roiFront": "559,295,55,44",
+    "roiBack": "559,295,55,44",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "礼包类型1"
+  },
+  {
+    "itemName": "fp_gift_flag2",
+    "imageName": "fp_fp_gift_flag2.png",
+    "roiFront": "557,293,58,47",
+    "roiBack": "557,293,58,47",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "礼包类型2"
   }
   }
 ]
 ]

+ 13 - 4
tasks/FloatParade/script_task.py

@@ -31,7 +31,7 @@ class ScriptTask(GameUi, FloatParadeAssets, TalismanPassAssets):
                 continue
                 continue
         logger.info('Goback to float parade main page')
         logger.info('Goback to float parade main page')
         # 收取花车等级奖励
         # 收取花车等级奖励
-        self.get_flower(con.level_reward)
+        self.get_flower(con.level_reward1, con.level_reward2) # 第一种
         # main page
         # main page
         self.ui_get_current_page()
         self.ui_get_current_page()
         self.ui_goto(page_main)
         self.ui_goto(page_main)
@@ -53,6 +53,8 @@ class ScriptTask(GameUi, FloatParadeAssets, TalismanPassAssets):
                 continue
                 continue
             if self.appear_then_click(self.I_FP_RED_CLOSE, interval=1.5):
             if self.appear_then_click(self.I_FP_RED_CLOSE, interval=1.5):
                 continue
                 continue
+            if self.appear_then_click(self.I_FP_GIFT_CLOSE, interval=3):
+                continue
             if self.appear_then_click(self.I_FP_TASKS, interval=1.8):
             if self.appear_then_click(self.I_FP_TASKS, interval=1.8):
                 continue
                 continue
             if self.appear_then_click(self.I_TOGGLE_BUTTON, interval=3):
             if self.appear_then_click(self.I_TOGGLE_BUTTON, interval=3):
@@ -65,7 +67,7 @@ class ScriptTask(GameUi, FloatParadeAssets, TalismanPassAssets):
         self.ui_get_reward(self.I_FP_GETALL1)
         self.ui_get_reward(self.I_FP_GETALL1)
         logger.info('Got all reward')
         logger.info('Got all reward')
 
 
-    def get_flower(self, level: LevelReward = LevelReward.TWO):
+    def get_flower(self, level1: LevelReward = LevelReward.TWO, level2: LevelReward = LevelReward.TWO):
         """
         """
         收取花合战等级奖励
         收取花合战等级奖励
         :return:
         :return:
@@ -92,8 +94,15 @@ class ScriptTask(GameUi, FloatParadeAssets, TalismanPassAssets):
             if self.appear_then_click(self.I_BATCH_SELECTION_CONFIRM, interval=0.8):
             if self.appear_then_click(self.I_BATCH_SELECTION_CONFIRM, interval=0.8):
                 continue
                 continue
 
 
-            if self.appear_then_click(match_level[level], interval=0.8):
-                logger.info(f'Select {level} reward')
+            if self.appear(self.I_FP_GIFT_FLAG1) and self.appear_then_click(match_level[level1], interval=0.8):
+                logger.info(f'Select {level1} reward')
+                if self.appear_then_click(self.I_OVERFLOW_CONFIRME, interval=0.8):
+                    pass
+                check_timer.reset()
+                continue
+
+            if self.appear(self.I_FP_GIFT_FLAG2) and self.appear_then_click(match_level[level2], interval=0.8):
+                logger.info(f'Select {level2} reward')
                 if self.appear_then_click(self.I_OVERFLOW_CONFIRME, interval=0.8):
                 if self.appear_then_click(self.I_OVERFLOW_CONFIRME, interval=0.8):
                     pass
                     pass
                 check_timer.reset()
                 check_timer.reset()

+ 1 - 1
tasks/Hyakkiyakou/slave/hya_device.py

@@ -26,7 +26,7 @@ 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)  # 五分钟跑不完就应该是出问题了
+    hya_fs_check_timer = Timer(3 * 60)  # 五分钟跑不完就应该是出问题了
 
 
     def fast_screenshot(self, screenshot: ScreenshotMethod):
     def fast_screenshot(self, screenshot: ScreenshotMethod):
         self.hya_screenshot_interval.wait()
         self.hya_screenshot_interval.wait()

+ 3 - 1
tasks/KekkaiUtilize/assets.py

@@ -119,11 +119,13 @@ class KekkaiUtilizeAssets:
 	O_BOX_EXP = RuleOcr(roi=(654,538,179,39), area=(654,538,179,39), mode="DigitCounter", method="Default", keyword="", name="box_exp")
 	O_BOX_EXP = RuleOcr(roi=(654,538,179,39), area=(654,538,179,39), mode="DigitCounter", method="Default", keyword="", name="box_exp")
 	# 今日已领取经验(招财上宾) 
 	# 今日已领取经验(招财上宾) 
 	O_BOX_EXP_ZCSB = RuleOcr(roi=(584,542,181,35), area=(584,542,181,35), mode="DigitCounter", method="Default", keyword="", name="box_exp_zcsb")
 	O_BOX_EXP_ZCSB = RuleOcr(roi=(584,542,181,35), area=(584,542,181,35), mode="DigitCounter", method="Default", keyword="", name="box_exp_zcsb")
+	# Ocr-description 
+	O_UTILIZE_F_LIST = RuleOcr(roi=(307,171,213,416), area=(307,171,213,416), mode="Full", method="Default", keyword="", name="utilize_f_list")
 
 
 
 
 	# Swipe Rule Assets
 	# Swipe Rule Assets
 	# 向下滑动 
 	# 向下滑动 
-	S_U_UP = RuleSwipe(roi_front=(235,419,50,21), roi_back=(225,177,72,21), mode="default", name="u_up")
+	S_U_UP = RuleSwipe(roi_front=(237,349,50,21), roi_back=(225,177,72,21), mode="default", name="u_up")
 	# 滑动到底部 
 	# 滑动到底部 
 	S_U_END = RuleSwipe(roi_front=(175,179,26,26), roi_back=(164,518,49,102), mode="default", name="u_end")
 	S_U_END = RuleSwipe(roi_front=(175,179,26,26), roi_back=(164,518,49,102), mode="default", name="u_end")
 
 

+ 2 - 0
tasks/KekkaiUtilize/config.py

@@ -18,6 +18,7 @@ class UtilizeRule(str, Enum):
     TAIKO = 'kaiko'  # 太鼓优先
     TAIKO = 'kaiko'  # 太鼓优先
     FISH = 'fish'  # 斗鱼优先
     FISH = 'fish'  # 斗鱼优先
     AUTO = 'auto'  # 自动 兼容代码罢了
     AUTO = 'auto'  # 自动 兼容代码罢了
+    FRIEND = 'friend'  # 好友选定
 
 
 
 
 
 
@@ -28,6 +29,7 @@ class UtilizeScheduler(Scheduler):
 
 
 class UtilizeConfig(BaseModel):
 class UtilizeConfig(BaseModel):
     utilize_rule: UtilizeRule = Field(default=UtilizeRule.DEFAULT, description='utilize_rule_help')
     utilize_rule: UtilizeRule = Field(default=UtilizeRule.DEFAULT, description='utilize_rule_help')
+    utilize_friend: str = Field(default= '',description='你要指定的好友的名字,需要选择同区好友还是跨区好友(就是下面那个选项)')
     select_friend_list: SelectFriendList = Field(default=SelectFriendList.SAME_SERVER, description='select_friend_list_help')
     select_friend_list: SelectFriendList = Field(default=SelectFriendList.SAME_SERVER, description='select_friend_list_help')
     shikigami_class: ShikigamiClass = Field(default=ShikigamiClass.N, description='shikigami_class_help')
     shikigami_class: ShikigamiClass = Field(default=ShikigamiClass.N, description='shikigami_class_help')
     shikigami_order: int = Field(default=4, description='shikigami_order_help')
     shikigami_order: int = Field(default=4, description='shikigami_order_help')

+ 56 - 19
tasks/KekkaiUtilize/script_task.py

@@ -384,6 +384,22 @@ class ScriptTask(GameUi, ReplaceShikigami, KekkaiUtilizeAssets):
             # while 1:
             # while 1:
             #     self.screenshot()
             #     self.screenshot()
             return card_class
             return card_class
+        def select_friend(friend_name: str) -> bool:
+            """
+            尝试在当前界面中识别并选择指定名称的好友
+            :param friend_name: 要选择的好友名称
+            :return: 成功选择返回True
+            """
+            logger.info(f"尝试选择好友: {friend_name}")
+            while 1:
+                self.screenshot()
+                self.O_UTILIZE_F_LIST.keyword = friend_name
+                if self.ocr_appear_click(self.O_UTILIZE_F_LIST):
+                    logger.info(f"成功选择好友: {friend_name}")
+                    return True
+                else:
+                    return False
+
 
 
         logger.hr('Start utilize')
         logger.hr('Start utilize')
         self.switch_friend_list(friend)
         self.switch_friend_list(friend)
@@ -394,28 +410,49 @@ class ScriptTask(GameUi, ReplaceShikigami, KekkaiUtilizeAssets):
         else:
         else:
             self.switch_friend_list(SelectFriendList.SAME_SERVER)
             self.switch_friend_list(SelectFriendList.SAME_SERVER)
             self.switch_friend_list(SelectFriendList.DIFFERENT_SERVER)
             self.switch_friend_list(SelectFriendList.DIFFERENT_SERVER)
-        card_best = None
-        swipe_count = 0
-        while 1:
-            self.screenshot()
-            current_card = _current_select_best(card_best)
 
 
-            if current_card is None:
-                break
-            else:
-                card_best = current_card
+        rule = self.config.kekkai_utilize.utilize_config.utilize_rule
+        friend_name = self.config.kekkai_utilize.utilize_config.utilize_friend
+        if rule == UtilizeRule.FRIEND:
+            swipe_count = 0
+            while 1:
+                self.screenshot()
+                if select_friend(friend_name):
+                    break
 
 
-            # 超过十次就退出
-            if swipe_count > 10:
-                logger.warning('Swipe count is more than 10')
-                break
+                # 超过十次就退出
+                if swipe_count > 10:
+                    logger.warning('Swipe count is more than 10')
+                    break
+
+                # 一直向下滑动
+                self.swipe(self.S_U_UP, interval=0.9)
+                swipe_count += 1
+                time.sleep(3)
+
+        else:
+            card_best = None
+            swipe_count = 0
+            while 1:
+                self.screenshot()
+                current_card = _current_select_best(card_best)
+
+                if current_card is None:
+                    break
+                else:
+                    card_best = current_card
+
+                # 超过十次就退出
+                if swipe_count > 10:
+                    logger.warning('Swipe count is more than 10')
+                    break
 
 
-            # 一直向下滑动
-            self.swipe(self.S_U_UP, interval=0.9)
-            swipe_count += 1
-            time.sleep(3)
-        # 最好的结界卡
-        logger.info('End best card is %s', card_best)
+                # 一直向下滑动
+                self.swipe(self.S_U_UP, interval=0.9)
+                swipe_count += 1
+                time.sleep(3)
+            # 最好的结界卡
+            logger.info('End best card is %s', card_best)
 
 
         # 进入结界
         # 进入结界
         self.screenshot()
         self.screenshot()

+ 9 - 0
tasks/KekkaiUtilize/utilize/ocr.json

@@ -25,5 +25,14 @@
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
     "description": "今日已领取经验(招财上宾)"
     "description": "今日已领取经验(招财上宾)"
+  },
+  {
+    "itemName": "utilize_f_list",
+    "roiFront": "307,171,213,416",
+    "roiBack": "307,171,213,416",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
   }
   }
 ]
 ]

+ 2 - 2
tasks/KekkaiUtilize/utilize/swipe.json

@@ -1,7 +1,7 @@
 [
 [
   {
   {
     "itemName": "u_up",
     "itemName": "u_up",
-    "roiFront": "235,419,50,21",
+    "roiFront": "237,349,50,21",
     "roiBack": "225,177,72,21",
     "roiBack": "225,177,72,21",
     "mode": "default",
     "mode": "default",
     "description": "向下滑动"
     "description": "向下滑动"
@@ -13,4 +13,4 @@
     "mode": "default",
     "mode": "default",
     "description": "滑动到底部"
     "description": "滑动到底部"
   }
   }
-]
+]

+ 4 - 0
tasks/Restart/assets.py

@@ -89,6 +89,10 @@ class RestartAssets:
 	I_CHARACTARS = RuleImage(roi_front=(246,535,100,31), roi_back=(219,523,173,57), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_charactars.png")
 	I_CHARACTARS = RuleImage(roi_front=(246,535,100,31), roi_back=(219,523,173,57), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_charactars.png")
 	# description 
 	# description 
 	I_CREATE_ACCOUNT = RuleImage(roi_front=(555,636,169,52), roi_back=(504,614,263,100), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_create_account.png")
 	I_CREATE_ACCOUNT = RuleImage(roi_front=(555,636,169,52), roi_back=(504,614,263,100), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_create_account.png")
+	# 进入体验服过快出现弹窗 
+	I_EARLY_SERVER = RuleImage(roi_front=(596,269,115,33), roi_back=(596,269,115,33), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_early_server.png")
+	# 取消体验服切换弹窗 
+	I_EARLY_SERVER_CANCEL = RuleImage(roi_front=(435,404,172,56), roi_back=(435,404,172,56), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_early_server_cancel.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets

+ 5 - 0
tasks/Restart/login.py

@@ -117,6 +117,11 @@ class LoginHandler(BaseTask, RestartAssets):
             if self.appear(self.I_CHARACTARS, interval=1):
             if self.appear(self.I_CHARACTARS, interval=1):
                 # https://github.com/runhey/OnmyojiAutoScript/issues/585
                 # https://github.com/runhey/OnmyojiAutoScript/issues/585
                 self.device.click(x=246, y=535)
                 self.device.click(x=246, y=535)
+            # 登录体验服时,点击“进入游戏”速度过快,可能会出现体验服的弹窗
+            if self.appear(self.I_EARLY_SERVER):
+                if self.appear_then_click(self.I_EARLY_SERVER_CANCEL):
+                    logger.info('Cancel switch from early server to normal server')
+                    continue
             if self.ocr_appear_click(self.O_LOGIN_ENTER_GAME, interval=3):
             if self.ocr_appear_click(self.O_LOGIN_ENTER_GAME, interval=3):
                 self.wait_until_appear(self.I_LOGIN_SPECIFIC_SERVE, True, wait_time=5)
                 self.wait_until_appear(self.I_LOGIN_SPECIFIC_SERVE, True, wait_time=5)
                 continue
                 continue

+ 18 - 0
tasks/Restart/login/image.json

@@ -124,5 +124,23 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"
+  },
+  {
+    "itemName": "early_server",
+    "imageName": "login_early_server.png",
+    "roiFront": "596,269,115,33",
+    "roiBack": "596,269,115,33",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "进入体验服过快出现弹窗"
+  },
+  {
+    "itemName": "early_server_cancel",
+    "imageName": "login_early_server_cancel.png",
+    "roiFront": "435,404,172,56",
+    "roiBack": "435,404,172,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "取消体验服切换弹窗"
   }
   }
 ]
 ]

BIN
tasks/Restart/login/login_early_server.png


BIN
tasks/Restart/login/login_early_server_cancel.png


+ 1 - 1
tasks/RichMan/mall/special.py

@@ -161,7 +161,7 @@ class Special(Buy, MallNavbar):
         result = result.replace('?', '2').replace('?', '2').replace(':', ';').replace('火', '次').replace('教', '数')
         result = result.replace('?', '2').replace('?', '2').replace(':', ';').replace('火', '次').replace('教', '数')
         try:
         try:
             if ':' in result:
             if ':' in result:
-                result = re.findall(r'剩余购买次数:(\d+)', result)[0]
+                result = re.findall(r'余购买次数:(\d+)', result)[0]
                 result = int(result)
                 result = int(result)
             else:
             else:
                 result = re.findall(r'本周剩余数量(\d+)', result)[0]
                 result = re.findall(r'本周剩余数量(\d+)', result)[0]