diff --git a/tasks/GameUi/page/page_check_six_gates.png b/tasks/GameUi/page/page_check_six_gates.png index be414aa3b..d87ca27cd 100644 Binary files a/tasks/GameUi/page/page_check_six_gates.png and b/tasks/GameUi/page/page_check_six_gates.png differ diff --git a/tasks/GameUi/page/page_exploration_goto_six_gates.png b/tasks/GameUi/page/page_exploration_goto_six_gates.png index 047919887..13c04b98d 100644 Binary files a/tasks/GameUi/page/page_exploration_goto_six_gates.png and b/tasks/GameUi/page/page_exploration_goto_six_gates.png differ diff --git a/tasks/SixRealms/a/a_hundun.png b/tasks/SixRealms/a/a_hundun.png new file mode 100644 index 000000000..9facf5651 Binary files /dev/null and b/tasks/SixRealms/a/a_hundun.png differ diff --git a/tasks/SixRealms/a/a_ningxi.png b/tasks/SixRealms/a/a_ningxi.png new file mode 100644 index 000000000..6ab147ff9 Binary files /dev/null and b/tasks/SixRealms/a/a_ningxi.png differ diff --git a/tasks/SixRealms/a/a_shenmi.png b/tasks/SixRealms/a/a_shenmi.png new file mode 100644 index 000000000..07f155aa7 Binary files /dev/null and b/tasks/SixRealms/a/a_shenmi.png differ diff --git a/tasks/SixRealms/a/a_xing.png b/tasks/SixRealms/a/a_xing.png new file mode 100644 index 000000000..f0da31355 Binary files /dev/null and b/tasks/SixRealms/a/a_xing.png differ diff --git a/tasks/SixRealms/a/a_zhan.png b/tasks/SixRealms/a/a_zhan.png new file mode 100644 index 000000000..4477173a1 Binary files /dev/null and b/tasks/SixRealms/a/a_zhan.png differ diff --git a/tasks/SixRealms/a/image.json b/tasks/SixRealms/a/image.json new file mode 100644 index 000000000..f8677f70f --- /dev/null +++ b/tasks/SixRealms/a/image.json @@ -0,0 +1,47 @@ +[ + { + "itemName": "ningxi", + "imageName": "a_ningxi.png", + "roiFront": "1011,375,19,29", + "roiBack": "153,87,908,513", + "method": "Template matching", + "threshold": 0.65, + "description": "宁息" + }, + { + "itemName": "hundun", + "imageName": "a_hundun.png", + "roiFront": "896,447,23,33", + "roiBack": "162,122,908,513", + "method": "Template matching", + "threshold": 0.65, + "description": "混沌re" + }, + { + "itemName": "zhan", + "imageName": "a_zhan.png", + "roiFront": "207,366,22,26", + "roiBack": "156,103,908,513", + "method": "Template matching", + "threshold": 0.8, + "description": "鏖战re" + }, + { + "itemName": "shenmi", + "imageName": "a_shenmi.png", + "roiFront": "465,459,20,31", + "roiBack": "151,88,908,513", + "method": "Template matching", + "threshold": 0.65, + "description": "神秘re" + }, + { + "itemName": "xing", + "imageName": "a_xing.png", + "roiFront": "652,478,30,27", + "roiBack": "151,88,908,513", + "method": "Template matching", + "threshold": 0.7, + "description": "绽放之屿re" + } +] \ No newline at end of file diff --git a/tasks/SixRealms/assets.py b/tasks/SixRealms/assets.py index 1e978c410..1dd5e4716 100644 --- a/tasks/SixRealms/assets.py +++ b/tasks/SixRealms/assets.py @@ -10,6 +10,19 @@ class SixRealmsAssets: + # Image Rule Assets + # 宁息 + I_NINGXI = RuleImage(roi_front=(1011,375,19,29), roi_back=(153,87,908,513), threshold=0.65, method="Template matching", file="./tasks/SixRealms/a/a_ningxi.png") + # 混沌re + I_HUNDUN = RuleImage(roi_front=(896,447,23,33), roi_back=(162,122,908,513), threshold=0.65, method="Template matching", file="./tasks/SixRealms/a/a_hundun.png") + # 鏖战re + I_ZHAN = RuleImage(roi_front=(207,366,22,26), roi_back=(156,103,908,513), threshold=0.8, method="Template matching", file="./tasks/SixRealms/a/a_zhan.png") + # 神秘re + I_SHENMI = RuleImage(roi_front=(465,459,20,31), roi_back=(151,88,908,513), threshold=0.65, method="Template matching", file="./tasks/SixRealms/a/a_shenmi.png") + # 绽放之屿re + I_XING = RuleImage(roi_front=(652,478,30,27), roi_back=(151,88,908,513), threshold=0.7, method="Template matching", file="./tasks/SixRealms/a/a_xing.png") + + # Click Rule Assets # description C_MAIN_ANIMATE_KEEP = RuleClick(roi_front=(565,7,100,215), roi_back=(565,7,100,215), name="main_animate_keep") @@ -18,22 +31,22 @@ class SixRealmsAssets: # Image Rule Assets - # 大boss挑战 - I_BOSS_FIRE = RuleImage(roi_front=(1128,576,100,100), roi_back=(1091,557,156,147), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_fire.png") + # 大boss挑战re + I_BOSS_FIRE = RuleImage(roi_front=(1114,582,100,100), roi_back=(1084,559,156,147), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_fire.png") + # lockre + I_BOSS_TEAM_LOCK = RuleImage(roi_front=(1122,527,33,32), roi_back=(1116,520,43,43), threshold=0.9, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_team_lock.png") + # unlockre + I_BOSS_TEAM_UNLOCK = RuleImage(roi_front=(1128,529,25,26), roi_back=(1120,520,40,41), threshold=0.9, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_team_unlock.png") # description - I_BOSS_TEAM_LOCK = RuleImage(roi_front=(1139,493,21,21), roi_back=(1130,487,38,43), threshold=0.95, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_team_lock.png") - # description - I_BOSS_TEAM_UNLOCK = RuleImage(roi_front=(1138,497,22,21), roi_back=(1127,491,40,41), threshold=0.95, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_team_unlock.png") - # description - I_BOSS_SKIP = RuleImage(roi_front=(1131,13,100,42), roi_back=(1113,5,136,62), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_skip.png") + I_BOSS_SKIP = RuleImage(roi_front=(1140,39,48,27), roi_back=(1110,24,136,58), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_skip.png") # description I_BOSS_USE_DOUBLE = RuleImage(roi_front=(669,417,126,53), roi_back=(651,407,164,71), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_use_double.png") # 御神获得经验 I_BOSS_GET_EXP = RuleImage(roi_front=(561,109,171,45), roi_back=(492,86,281,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_get_exp.png") - # description - I_BOSS_SHARE = RuleImage(roi_front=(1090,604,70,74), roi_back=(1074,587,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_share.png") + # boss_sharere + I_BOSS_SHARE = RuleImage(roi_front=(1158,619,70,74), roi_back=(1144,606,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_share.png") # 结算的椒图 - I_BOSS_SHUTU = RuleImage(roi_front=(108,141,173,122), roi_back=(108,141,173,122), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_shutu.png") + I_BOSS_SHUTU = RuleImage(roi_front=(539,669,173,37), roi_back=(526,646,198,73), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_shutu.png") # description I_BOSS_BATTLE_AGAIN = RuleImage(roi_front=(435,403,173,64), roi_back=(409,390,212,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_boss_battle_again.png") # description @@ -42,11 +55,11 @@ class SixRealmsAssets: # Click Rule Assets # 左边的 - C_NPC_FIRE_LEFT = RuleClick(roi_front=(423,203,153,193), roi_back=(423,203,153,193), name="npc_fire_left") + C_NPC_FIRE_LEFT = RuleClick(roi_front=(423,203,53,193), roi_back=(423,203,53,193), name="npc_fire_left") # description - C_NPC_FIRE_RIGHT = RuleClick(roi_front=(740,248,181,180), roi_back=(740,248,181,180), name="npc_fire_right") + C_NPC_FIRE_RIGHT = RuleClick(roi_front=(811,285,72,111), roi_back=(737,249,183,180), name="npc_fire_right") # 中间的精英 - C_NPC_FIRE_CENTER = RuleClick(roi_front=(620,188,174,217), roi_back=(620,188,174,217), name="npc_fire_center") + C_NPC_FIRE_CENTER = RuleClick(roi_front=(689,199,83,126), roi_back=(620,188,174,217), name="npc_fire_center") # 默认的 C_ISLAND_ENTER = RuleClick(roi_front=(0,0,100,100), roi_back=(0,0,100,100), name="island_enter") # 右数第一个 @@ -64,44 +77,44 @@ class SixRealmsAssets: # Image Rule Assets - # description - I_MENTER = RuleImage(roi_front=(346,167,30,100), roi_back=(346,167,30,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_menter.png") - # 酒吞 + # 孔雀国re + I_MENTER = RuleImage(roi_front=(346,149,35,118), roi_back=(346,149,35,118), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_menter.png") + # 小鹿男re I_MSHUTEN = RuleImage(roi_front=(46,609,70,65), roi_back=(46,609,70,65), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshuten.png") - # 椒图选中 - I_MSHOUZU_SELECT = RuleImage(roi_front=(544,179,199,438), roi_back=(544,179,199,438), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshouzu_select.png") - # 椒图 + # 觉选中re + I_MSHOUZU_SELECT = RuleImage(roi_front=(777,180,199,438), roi_back=(777,180,199,438), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshouzu_select.png") + # 觉re I_MSHOUZU = RuleImage(roi_front=(43,608,73,67), roi_back=(43,608,73,67), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshouzu.png") - # 开启 - I_MSTART = RuleImage(roi_front=(1136,575,100,100), roi_back=(1043,527,215,167), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart.png") - # description - I_MSTART_CONFIRM = RuleImage(roi_front=(1136,575,100,100), roi_back=(1080,548,182,150), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_confirm.png") - # description + # 第一次开启re + I_MSTART = RuleImage(roi_front=(1121,586,100,100), roi_back=(1043,527,215,167), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart.png") + # 试炼式神选择re + I_MSTART_CONFIRM = RuleImage(roi_front=(1124,572,100,100), roi_back=(1080,548,182,150), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_confirm.png") + # mstart_uncheckoff I_MSTART_UNCHECK = RuleImage(roi_front=(543,340,38,40), roi_back=(543,340,38,40), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_uncheck.png") - # description + # mstart_check_off I_MSTART_CHECK = RuleImage(roi_front=(542,340,39,41), roi_back=(542,340,39,41), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_check.png") - # + # mskip_off I_MSKIP = RuleImage(roi_front=(1117,28,58,36), roi_back=(1117,28,58,36), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mskip.png") - # 左下角备战 - I_PREPARE_BATTLE = RuleImage(roi_front=(33,640,48,54), roi_back=(33,640,48,54), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_prepare_battle.png") - # 继续执行 + # 左下角备战re + I_PREPARE_BATTLE = RuleImage(roi_front=(29,638,55,66), roi_back=(20,630,72,81), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_prepare_battle.png") + # 继续执行re I_MCONINUE = RuleImage(roi_front=(1121,578,100,100), roi_back=(1121,578,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mconinue.png") - # 选第一个柔风 - I_MFIRST_SKILL = RuleImage(roi_front=(255,577,141,39), roi_back=(206,550,227,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mfirst_skill.png") - # 唤息 + # 极道轰炸选择re + I_MFIRST_SKILL = RuleImage(roi_front=(259,554,141,39), roi_back=(209,523,227,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mfirst_skill.png") + # 唤息re I_M_STORE = RuleImage(roi_front=(1124,594,61,57), roi_back=(1103,576,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_m_store.png") - # 左上角退出 + # 左上角退出re I_BACK_EXIT = RuleImage(roi_front=(11,18,51,47), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_back_exit.png") - # 可以购买的幻息 + # 可以购买的幻息off I_M_STORE_ACTIVITY = RuleImage(roi_front=(1121,596,72,57), roi_back=(1107,573,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_m_store_activity.png") - # description - I_MSTART_CONFIRM2 = RuleImage(roi_front=(1154,581,74,85), roi_back=(1079,535,196,177), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_confirm2.png") - # 动画完了就有这个东西 + # 式神阵容选择re + I_MSTART_CONFIRM2 = RuleImage(roi_front=(1146,570,84,101), roi_back=(1079,535,196,177), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_confirm2.png") + # 动画完了就有这个东西off I_ISLAND_TAG_FLAG = RuleImage(roi_front=(543,601,100,100), roi_back=(543,601,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_island_tag_flag.png") - # 暂时离开六道之门 - I_EXIT_SIXREALMS = RuleImage(roi_front=(507.5,308,100,100), roi_back=(507.5,308,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_exit_sixrealms.png") - # 选择一个式神加入征伐队伍 - I_SELECT_SHIKIGAMI_AND_CONFIRM = RuleImage(roi_front=(499,238,151,57), roi_back=(479,213,199,113), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_shikigami_and_confirm.png") + # 暂时离开六道之门re + I_EXIT_SIXREALMS = RuleImage(roi_front=(503,306,84,75), roi_back=(494,297,100,90), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_exit_sixrealms.png") + # 选择绽放之舞re + I_MPEACOCK_SKILL = RuleImage(roi_front=(219,601,95,43), roi_back=(167,584,192,86), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mpeacock_skill.png") # Ocr Rule Assets @@ -111,56 +124,62 @@ class SixRealmsAssets: O_ISLAND_NAME = RuleOcr(roi=(88,17,148,49), area=(88,17,148,49), mode="Single", method="Default", keyword="", name="island_name") # 有多少钱 O_COIN_NUM = RuleOcr(roi=(1171,23,59,31), area=(1171,23,59,31), mode="Digit", method="Default", keyword="", name="coin_num") + # 六道门票 + O_SIXREALMS_NUMBER = RuleOcr(roi=(1151,23,59,33), area=(1151,23,59,33), mode="Digit", method="Default", keyword="", name="sixrealms_number") # Ocr-description O_SKILL_REFRESH = RuleOcr(roi=(1172,684,100,31), area=(1172,684,100,31), mode="Single", method="Default", keyword="", name="skill_refresh") # Image Rule Assets - # 柔风 - I_SKILL101 = RuleImage(roi_front=(440,181,100,69), roi_back=(139,167,722,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill101.png") + # 轰雷选择off + I_SKILL101 = RuleImage(roi_front=(736,171,64,60), roi_back=(156,154,689,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill101.png") # description I_SKILL102 = RuleImage(roi_front=(456,186,76,63), roi_back=(136,151,709,128), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill102.png") # description I_SKILL103 = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill103.png") # description I_SKILL104 = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill104.png") - # description - I_SKILL_REFRESH = RuleImage(roi_front=(1196,625,44,39), roi_back=(1171,586,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill_refresh.png") - # description - I_SELECT_0 = RuleImage(roi_front=(152,572,132,44), roi_back=(140,542,163,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_0.png") - # description - I_SELECT_1 = RuleImage(roi_front=(424,573,137,46), roi_back=(382,544,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_1.png") - # description - I_SELECT_2 = RuleImage(roi_front=(696,572,140,47), roi_back=(666,546,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_2.png") - # 最右边的恢复生命 - I_SELECT_3 = RuleImage(roi_front=(1016,581,145,43), roi_back=(1000,550,173,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_3.png") + # skill_refreshre + I_SKILL_REFRESH = RuleImage(roi_front=(1187,625,52,47), roi_back=(1169,602,92,82), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill_refresh.png") + # select_0re + I_SELECT_0 = RuleImage(roi_front=(155,551,132,44), roi_back=(140,528,163,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_0.png") + # select_1re + I_SELECT_1 = RuleImage(roi_front=(428,551,137,46), roi_back=(394,528,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_1.png") + # select_2re + I_SELECT_2 = RuleImage(roi_front=(700,552,140,47), roi_back=(669,527,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_2.png") + # 舞技强化re + I_SELECT_3 = RuleImage(roi_front=(1018,552,145,43), roi_back=(1003,521,173,106), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_3.png") # 六道的金币 - I_COIN = RuleImage(roi_front=(612,345,66,53), roi_back=(405,229,561,270), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_coin.png") + I_COIN = RuleImage(roi_front=(567,343,66,53), roi_back=(405,229,561,270), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_coin.png") # 六道的金币 - I_COIN2 = RuleImage(roi_front=(612,345,66,53), roi_back=(405,229,561,270), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_coin.png") + I_COIN2 = RuleImage(roi_front=(567,343,66,53), roi_back=(405,229,561,270), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_coin2.png") # 洞察之力 I_SKILL105 = RuleImage(roi_front=(178,187,80,69), roi_back=(112,149,779,151), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill105.png") + # 力量强化 + I_PEACOCK_SKILL1 = RuleImage(roi_front=(244,501,95,35), roi_back=(223,478,143,73), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_peacock_skill1.png") + # 技巧强化 + I_PEACOCK_SKILL2 = RuleImage(roi_front=(779,501,93,36), roi_back=(747,480,163,76), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_peacock_skill2.png") - # Swipe Rule Assets + # Image Rule Assets # 征伐队伍选择界面底部阵容上拉 - S_TEAM_SWIPE_UP = RuleSwipe(roi_front=(520,571,93,98), roi_back=(589,180,100,100), mode="default", name="team_swipe_up") + I_TEAM_SWIPE_UP = RuleImage(roi_front=(520,571,93,98), roi_back=(589,180,100,100), threshold=0, method="", file="./tasks/SixRealms/gate1/gate1_team_swipe_up.png") # Image Rule Assets - # 宁息刷新 - I_STORE_REFRESH = RuleImage(roi_front=(545,596,46,47), roi_back=(519,568,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_refresh.png") - # 购买柔风 - I_STORE_SKILL_101 = RuleImage(roi_front=(876,121,47,41), roi_back=(682,100,455,571), threshold=0.9, method="Template matching", file="./tasks/SixRealms/l101/l101_store_skill_101.png") - # description - I_STORE_EXIT = RuleImage(roi_front=(1179,586,59,56), roi_back=(1161,561,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_exit.png") + # 宁息刷新re + I_STORE_REFRESH = RuleImage(roi_front=(594,599,46,47), roi_back=(566,571,100,93), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_refresh.png") + # 购买轰雷re + I_STORE_SKILL_101 = RuleImage(roi_front=(1074,592,47,45), roi_back=(700,94,476,622), threshold=0.9, method="Template matching", file="./tasks/SixRealms/l101/l101_store_skill_101.png") + # 商店退出re + I_STORE_EXIT = RuleImage(roi_front=(1194,610,59,56), roi_back=(1166,593,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_exit.png") # 稳定标志 - I_STORE_STABLE_FLAG = RuleImage(roi_front=(1028,251,28,27), roi_back=(1011,241,63,47), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_stable_flag.png") + I_STORE_STABLE_FLAG = RuleImage(roi_front=(1096,15,60,42), roi_back=(1094,12,63,47), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_stable_flag.png") # Ocr Rule Assets # 刷新次数 - O_STORE_REFRESH_TIME = RuleOcr(roi=(538,661,110,27), area=(538,661,110,27), mode="Single", method="Default", keyword="", name="store_refresh_time") + O_STORE_REFRESH_TIME = RuleOcr(roi=(587,660,110,27), area=(586,659,110,27), mode="Single", method="Default", keyword="", name="store_refresh_time") # Image Rule Assets @@ -176,17 +195,26 @@ class SixRealmsAssets: # Image Rule Assets # description - I_L103_EXIT = RuleImage(roi_front=(1171,587,69,70), roi_back=(1078,538,195,180), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l103/l103_exit.png") + I_L103_EXIT = RuleImage(roi_front=(1156,630,61,58), roi_back=(1078,538,195,180), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l103/l103_l103_exit.png") + # lucky_boxre + I_LUCKY_BOX = RuleImage(roi_front=(625,268,26,107), roi_back=(527,179,257,293), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l103/l103_lucky_box.png") # Image Rule Assets - # description - I_NPC_COMMON = RuleImage(roi_front=(718,232,36,40), roi_back=(684,208,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_common.png") - # 点击挑战 - I_NPC_FIRE = RuleImage(roi_front=(1129,585,100,100), roi_back=(1080,551,174,144), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_fire.png") - # description - I_BATTLE_TEAM_UNLOCK = RuleImage(roi_front=(962,676,21,21), roi_back=(943,655,64,60), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_unlock.png") - # description - I_BATTLE_TEAM_LOCK = RuleImage(roi_front=(961,675,21,23), roi_back=(949,662,48,50), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_lock.png") + # 普通re + I_NPC_COMMON = RuleImage(roi_front=(720,223,36,40), roi_back=(690,202,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_common.png") + # 点击挑战re + I_NPC_FIRE = RuleImage(roi_front=(1124,573,100,100), roi_back=(1080,551,174,144), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_fire.png") + # unlockre + I_BATTLE_TEAM_UNLOCK = RuleImage(roi_front=(956,652,39,39), roi_back=(942,641,64,60), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_unlock.png") + # lockre + I_BATTLE_TEAM_LOCK = RuleImage(roi_front=(957,652,35,36), roi_back=(942,636,65,68), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_lock.png") + # fenghuang + I_FENGHUANG = RuleImage(roi_front=(582,124,412,433), roi_back=(582,124,412,433), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_fenghuang.png") + + + # Image Rule Assets + # 绽放退出 + I_ZHAOFU = RuleImage(roi_front=(1157,628,57,59), roi_back=(1135,603,97,111), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l105/l105_zhaofu.png") diff --git a/tasks/SixRealms/config.py b/tasks/SixRealms/config.py index e0cefd48e..6f5a3bf3e 100644 --- a/tasks/SixRealms/config.py +++ b/tasks/SixRealms/config.py @@ -5,20 +5,27 @@ from tasks.Component.config_scheduler import Scheduler from tasks.Component.config_base import ConfigBase, Time -from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig class SixRealmsGate(BaseModel): + number_enable: bool = Field(default=False, description='只打门票') # 限制时间 limit_time: Time = Field(default=Time(minute=30), description='limit_time_help') # 限制次数 limit_count: int = Field(default=1, description='limit_count_help') +class SwitchSoulConfig(BaseModel): + enable: bool = Field(default=False, description='auto_enable_help') + # 换第一行 + one_switch: str = Field(default='-1,-1', description='换第一行') + # 换第二行 + two_switch: str = Field(default='-1,-1', description='换第二行') + + class SixRealms(ConfigBase): scheduler: Scheduler = Field(default_factory=Scheduler) - switch_soul_config_1: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig) - switch_soul_config_2: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig) + switch_soul_config: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig) six_realms_gate: SixRealmsGate = Field(default_factory=SixRealmsGate) diff --git a/tasks/SixRealms/gate1/boss.json b/tasks/SixRealms/gate1/boss.json index 8b0ba2f9d..77af9b41a 100644 --- a/tasks/SixRealms/gate1/boss.json +++ b/tasks/SixRealms/gate1/boss.json @@ -2,35 +2,35 @@ { "itemName": "boss_fire", "imageName": "gate1_boss_fire.png", - "roiFront": "1128,576,100,100", - "roiBack": "1091,557,156,147", + "roiFront": "1114,582,100,100", + "roiBack": "1084,559,156,147", "method": "Template matching", "threshold": 0.8, - "description": "大boss挑战" + "description": "大boss挑战re" }, { "itemName": "boss_team_lock", "imageName": "gate1_boss_team_lock.png", - "roiFront": "1139,493,21,21", - "roiBack": "1130,487,38,43", + "roiFront": "1122,527,33,32", + "roiBack": "1116,520,43,43", "method": "Template matching", - "threshold": 0.95, - "description": "description" + "threshold": 0.9, + "description": "lockre" }, { "itemName": "boss_team_unlock", "imageName": "gate1_boss_team_unlock.png", - "roiFront": "1138,497,22,21", - "roiBack": "1127,491,40,41", + "roiFront": "1128,529,25,26", + "roiBack": "1120,520,40,41", "method": "Template matching", - "threshold": 0.95, - "description": "description" + "threshold": 0.9, + "description": "unlockre" }, { "itemName": "boss_skip", "imageName": "gate1_boss_skip.png", - "roiFront": "1131,13,100,42", - "roiBack": "1113,5,136,62", + "roiFront": "1140,39,48,27", + "roiBack": "1110,24,136,58", "method": "Template matching", "threshold": 0.8, "description": "description" @@ -56,17 +56,17 @@ { "itemName": "boss_share", "imageName": "gate1_boss_share.png", - "roiFront": "1090,604,70,74", - "roiBack": "1074,587,100,100", + "roiFront": "1158,619,70,74", + "roiBack": "1144,606,100,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "boss_sharere" }, { "itemName": "boss_shutu", "imageName": "gate1_boss_shutu.png", - "roiFront": "108,141,173,122", - "roiBack": "108,141,173,122", + "roiFront": "539,669,173,37", + "roiBack": "526,646,198,73", "method": "Template matching", "threshold": 0.8, "description": "结算的椒图" diff --git a/tasks/SixRealms/gate1/click.json b/tasks/SixRealms/gate1/click.json index ae588982c..4f210e85d 100644 --- a/tasks/SixRealms/gate1/click.json +++ b/tasks/SixRealms/gate1/click.json @@ -1,19 +1,19 @@ [ { "itemName": "npc_fire_left", - "roiFront": "423,203,153,193", - "roiBack": "423,203,153,193", + "roiFront": "423,203,53,193", + "roiBack": "423,203,53,193", "description": "左边的" }, { "itemName": "npc_fire_right", - "roiFront": "740,248,181,180", - "roiBack": "740,248,181,180", + "roiFront": "811,285,72,111", + "roiBack": "737,249,183,180", "description": "description" }, { "itemName": "npc_fire_center", - "roiFront": "620,188,174,217", + "roiFront": "689,199,83,126", "roiBack": "620,188,174,217", "description": "中间的精英" }, diff --git a/tasks/SixRealms/gate1/gate1_back_exit.png b/tasks/SixRealms/gate1/gate1_back_exit.png index 1237847fa..95d4fe2ed 100644 Binary files a/tasks/SixRealms/gate1/gate1_back_exit.png and b/tasks/SixRealms/gate1/gate1_back_exit.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_battle_again.png b/tasks/SixRealms/gate1/gate1_boss_battle_again.png index 754cc5081..08f23e90c 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_battle_again.png and b/tasks/SixRealms/gate1/gate1_boss_battle_again.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_battle_giveup.png b/tasks/SixRealms/gate1/gate1_boss_battle_giveup.png index f14fa0714..e8b50f930 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_battle_giveup.png and b/tasks/SixRealms/gate1/gate1_boss_battle_giveup.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_fire.png b/tasks/SixRealms/gate1/gate1_boss_fire.png index 09a6e7772..839d423d3 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_fire.png and b/tasks/SixRealms/gate1/gate1_boss_fire.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_share.png b/tasks/SixRealms/gate1/gate1_boss_share.png index 21f7995ee..637433ffa 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_share.png and b/tasks/SixRealms/gate1/gate1_boss_share.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_shutu.png b/tasks/SixRealms/gate1/gate1_boss_shutu.png index 1dfc01d09..2ba5c2a20 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_shutu.png and b/tasks/SixRealms/gate1/gate1_boss_shutu.png differ diff --git a/tasks/SixRealms/gate1/gate1_boss_skip.png b/tasks/SixRealms/gate1/gate1_boss_skip.png index 93cc4881b..4558051c3 100644 Binary files a/tasks/SixRealms/gate1/gate1_boss_skip.png and b/tasks/SixRealms/gate1/gate1_boss_skip.png differ diff --git a/tasks/SixRealms/gate1/gate1_coin.png b/tasks/SixRealms/gate1/gate1_coin.png index 4cea90097..54f86a3b5 100644 Binary files a/tasks/SixRealms/gate1/gate1_coin.png and b/tasks/SixRealms/gate1/gate1_coin.png differ diff --git a/tasks/SixRealms/gate1/gate1_exit_sixrealms.png b/tasks/SixRealms/gate1/gate1_exit_sixrealms.png index f30334b12..7f77f27b2 100644 Binary files a/tasks/SixRealms/gate1/gate1_exit_sixrealms.png and b/tasks/SixRealms/gate1/gate1_exit_sixrealms.png differ diff --git a/tasks/SixRealms/gate1/gate1_m_store.png b/tasks/SixRealms/gate1/gate1_m_store.png index 3a9f567f3..3a8464058 100644 Binary files a/tasks/SixRealms/gate1/gate1_m_store.png and b/tasks/SixRealms/gate1/gate1_m_store.png differ diff --git a/tasks/SixRealms/gate1/gate1_m_store_activity.png b/tasks/SixRealms/gate1/gate1_m_store_activity.png index cc5873087..f2f5391c0 100644 Binary files a/tasks/SixRealms/gate1/gate1_m_store_activity.png and b/tasks/SixRealms/gate1/gate1_m_store_activity.png differ diff --git a/tasks/SixRealms/gate1/gate1_mconinue.png b/tasks/SixRealms/gate1/gate1_mconinue.png index 86ece0e50..1ee2f3c7e 100644 Binary files a/tasks/SixRealms/gate1/gate1_mconinue.png and b/tasks/SixRealms/gate1/gate1_mconinue.png differ diff --git a/tasks/SixRealms/gate1/gate1_menter.png b/tasks/SixRealms/gate1/gate1_menter.png index 9a1f4018a..1185ae3cd 100644 Binary files a/tasks/SixRealms/gate1/gate1_menter.png and b/tasks/SixRealms/gate1/gate1_menter.png differ diff --git a/tasks/SixRealms/gate1/gate1_mfirst_skill.png b/tasks/SixRealms/gate1/gate1_mfirst_skill.png index a62d00bd3..b8b4de20d 100644 Binary files a/tasks/SixRealms/gate1/gate1_mfirst_skill.png and b/tasks/SixRealms/gate1/gate1_mfirst_skill.png differ diff --git a/tasks/SixRealms/gate1/gate1_mpeacock_skill.png b/tasks/SixRealms/gate1/gate1_mpeacock_skill.png new file mode 100644 index 000000000..a073afe13 Binary files /dev/null and b/tasks/SixRealms/gate1/gate1_mpeacock_skill.png differ diff --git a/tasks/SixRealms/gate1/gate1_mshouzu.png b/tasks/SixRealms/gate1/gate1_mshouzu.png index 7509023b9..1243af149 100644 Binary files a/tasks/SixRealms/gate1/gate1_mshouzu.png and b/tasks/SixRealms/gate1/gate1_mshouzu.png differ diff --git a/tasks/SixRealms/gate1/gate1_mshouzu_select.png b/tasks/SixRealms/gate1/gate1_mshouzu_select.png index 3d906c41b..824105813 100644 Binary files a/tasks/SixRealms/gate1/gate1_mshouzu_select.png and b/tasks/SixRealms/gate1/gate1_mshouzu_select.png differ diff --git a/tasks/SixRealms/gate1/gate1_mshuten.png b/tasks/SixRealms/gate1/gate1_mshuten.png index 1183b81be..323b7753b 100644 Binary files a/tasks/SixRealms/gate1/gate1_mshuten.png and b/tasks/SixRealms/gate1/gate1_mshuten.png differ diff --git a/tasks/SixRealms/gate1/gate1_mstart.png b/tasks/SixRealms/gate1/gate1_mstart.png index 387c7aeb1..3978c4a9c 100644 Binary files a/tasks/SixRealms/gate1/gate1_mstart.png and b/tasks/SixRealms/gate1/gate1_mstart.png differ diff --git a/tasks/SixRealms/gate1/gate1_mstart_confirm.png b/tasks/SixRealms/gate1/gate1_mstart_confirm.png index fc2f054b9..e08585eb9 100644 Binary files a/tasks/SixRealms/gate1/gate1_mstart_confirm.png and b/tasks/SixRealms/gate1/gate1_mstart_confirm.png differ diff --git a/tasks/SixRealms/gate1/gate1_mstart_confirm2.png b/tasks/SixRealms/gate1/gate1_mstart_confirm2.png index f2e58fa9c..de2816e20 100644 Binary files a/tasks/SixRealms/gate1/gate1_mstart_confirm2.png and b/tasks/SixRealms/gate1/gate1_mstart_confirm2.png differ diff --git a/tasks/SixRealms/gate1/gate1_peacock_skill1.png b/tasks/SixRealms/gate1/gate1_peacock_skill1.png new file mode 100644 index 000000000..fc6b22537 Binary files /dev/null and b/tasks/SixRealms/gate1/gate1_peacock_skill1.png differ diff --git a/tasks/SixRealms/gate1/gate1_peacock_skill2.png b/tasks/SixRealms/gate1/gate1_peacock_skill2.png new file mode 100644 index 000000000..281610a13 Binary files /dev/null and b/tasks/SixRealms/gate1/gate1_peacock_skill2.png differ diff --git a/tasks/SixRealms/gate1/gate1_prepare_battle.png b/tasks/SixRealms/gate1/gate1_prepare_battle.png index 43a8c586d..1a682fdce 100644 Binary files a/tasks/SixRealms/gate1/gate1_prepare_battle.png and b/tasks/SixRealms/gate1/gate1_prepare_battle.png differ diff --git a/tasks/SixRealms/gate1/gate1_select_0.png b/tasks/SixRealms/gate1/gate1_select_0.png index 76f02b9ef..01c74d857 100644 Binary files a/tasks/SixRealms/gate1/gate1_select_0.png and b/tasks/SixRealms/gate1/gate1_select_0.png differ diff --git a/tasks/SixRealms/gate1/gate1_select_1.png b/tasks/SixRealms/gate1/gate1_select_1.png index 7dacba8a5..3fd02912e 100644 Binary files a/tasks/SixRealms/gate1/gate1_select_1.png and b/tasks/SixRealms/gate1/gate1_select_1.png differ diff --git a/tasks/SixRealms/gate1/gate1_select_2.png b/tasks/SixRealms/gate1/gate1_select_2.png index ff0f1ff86..23428bc1a 100644 Binary files a/tasks/SixRealms/gate1/gate1_select_2.png and b/tasks/SixRealms/gate1/gate1_select_2.png differ diff --git a/tasks/SixRealms/gate1/gate1_select_3.png b/tasks/SixRealms/gate1/gate1_select_3.png index 0af69f207..f83ab55c1 100644 Binary files a/tasks/SixRealms/gate1/gate1_select_3.png and b/tasks/SixRealms/gate1/gate1_select_3.png differ diff --git a/tasks/SixRealms/gate1/gate1_skill101.png b/tasks/SixRealms/gate1/gate1_skill101.png index 8354a0564..6a5ac4452 100644 Binary files a/tasks/SixRealms/gate1/gate1_skill101.png and b/tasks/SixRealms/gate1/gate1_skill101.png differ diff --git a/tasks/SixRealms/gate1/gate1_skill_refresh.png b/tasks/SixRealms/gate1/gate1_skill_refresh.png index 2c811e048..28d793707 100644 Binary files a/tasks/SixRealms/gate1/gate1_skill_refresh.png and b/tasks/SixRealms/gate1/gate1_skill_refresh.png differ diff --git a/tasks/SixRealms/gate1/image.json b/tasks/SixRealms/gate1/image.json index a9c88acb8..887be77f2 100644 --- a/tasks/SixRealms/gate1/image.json +++ b/tasks/SixRealms/gate1/image.json @@ -2,11 +2,11 @@ { "itemName": "menter", "imageName": "gate1_menter.png", - "roiFront": "346,167,30,100", - "roiBack": "346,167,30,100", + "roiFront": "346,149,35,118", + "roiBack": "346,149,35,118", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "孔雀国re" }, { "itemName": "mshuten", @@ -15,16 +15,16 @@ "roiBack": "46,609,70,65", "method": "Template matching", "threshold": 0.8, - "description": "酒吞" + "description": "小鹿男re" }, { "itemName": "mshouzu_select", "imageName": "gate1_mshouzu_select.png", - "roiFront": "544,179,199,438", - "roiBack": "544,179,199,438", + "roiFront": "777,180,199,438", + "roiBack": "777,180,199,438", "method": "Template matching", "threshold": 0.8, - "description": "椒图选中" + "description": "觉选中re" }, { "itemName": "mshouzu", @@ -33,25 +33,25 @@ "roiBack": "43,608,73,67", "method": "Template matching", "threshold": 0.8, - "description": "椒图" + "description": "觉re" }, { "itemName": "mstart", "imageName": "gate1_mstart.png", - "roiFront": "1136,575,100,100", + "roiFront": "1121,586,100,100", "roiBack": "1043,527,215,167", "method": "Template matching", "threshold": 0.8, - "description": "开启" + "description": "第一次开启re" }, { "itemName": "mstart_confirm", "imageName": "gate1_mstart_confirm.png", - "roiFront": "1136,575,100,100", + "roiFront": "1124,572,100,100", "roiBack": "1080,548,182,150", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "试炼式神选择re" }, { "itemName": "mstart_uncheck", @@ -60,7 +60,7 @@ "roiBack": "543,340,38,40", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "mstart_uncheckoff" }, { "itemName": "mstart_check", @@ -69,7 +69,7 @@ "roiBack": "542,340,39,41", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "mstart_check_off" }, { "itemName": "mskip", @@ -78,16 +78,16 @@ "roiBack": "1117,28,58,36", "method": "Template matching", "threshold": 0.8, - "description": "" + "description": "mskip_off" }, { "itemName": "prepare_battle", "imageName": "gate1_prepare_battle.png", - "roiFront": "33,640,48,54", - "roiBack": "33,640,48,54", + "roiFront": "29,638,55,66", + "roiBack": "20,630,72,81", "method": "Template matching", "threshold": 0.8, - "description": "左下角备战" + "description": "左下角备战re" }, { "itemName": "mconinue", @@ -96,16 +96,16 @@ "roiBack": "1121,578,100,100", "method": "Template matching", "threshold": 0.8, - "description": "继续执行" + "description": "继续执行re" }, { "itemName": "mfirst_skill", "imageName": "gate1_mfirst_skill.png", - "roiFront": "255,577,141,39", - "roiBack": "206,550,227,100", + "roiFront": "259,554,141,39", + "roiBack": "209,523,227,100", "method": "Template matching", "threshold": 0.8, - "description": "选第一个柔风" + "description": "极道轰炸选择re" }, { "itemName": "m_store", @@ -114,7 +114,7 @@ "roiBack": "1103,576,100,100", "method": "Template matching", "threshold": 0.8, - "description": "唤息" + "description": "唤息re" }, { "itemName": "back_exit", @@ -123,7 +123,7 @@ "roiBack": "0,0,100,100", "method": "Template matching", "threshold": 0.8, - "description": "左上角退出" + "description": "左上角退出re" }, { "itemName": "m_store_activity", @@ -132,16 +132,16 @@ "roiBack": "1107,573,100,100", "method": "Template matching", "threshold": 0.8, - "description": "可以购买的幻息" + "description": "可以购买的幻息off" }, { "itemName": "mstart_confirm2", "imageName": "gate1_mstart_confirm2.png", - "roiFront": "1154,581,74,85", + "roiFront": "1146,570,84,101", "roiBack": "1079,535,196,177", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "式神阵容选择re" }, { "itemName": "island_tag_flag", @@ -150,24 +150,24 @@ "roiBack": "543,601,100,100", "method": "Template matching", "threshold": 0.8, - "description": "动画完了就有这个东西" + "description": "动画完了就有这个东西off" }, { "itemName": "exit_sixrealms", "imageName": "gate1_exit_sixrealms.png", - "roiFront": "507.5,308,100,100", - "roiBack": "507.5,308,100,100", + "roiFront": "503,306,84,75", + "roiBack": "494,297,100,90", "method": "Template matching", "threshold": 0.8, - "description": "暂时离开六道之门" + "description": "暂时离开六道之门re" }, { - "itemName": "select_shikigami_and_confirm", - "imageName": "gate1_select_shikigami_and_confirm.png", - "roiFront": "499,238,151,57", - "roiBack": "479,213,199,113", + "itemName": "mpeacock_skill", + "imageName": "gate1_mpeacock_skill.png", + "roiFront": "219,601,95,43", + "roiBack": "167,584,192,86", "method": "Template matching", "threshold": 0.8, - "description": "选择一个式神加入征伐队伍" + "description": "选择绽放之舞re" } ] \ No newline at end of file diff --git a/tasks/SixRealms/gate1/ocr.json b/tasks/SixRealms/gate1/ocr.json index 1956d22cf..bbb673225 100644 --- a/tasks/SixRealms/gate1/ocr.json +++ b/tasks/SixRealms/gate1/ocr.json @@ -26,6 +26,15 @@ "keyword": "", "description": "有多少钱" }, + { + "itemName": "sixrealms_number", + "roiFront": "1151,23,59,33", + "roiBack": "1151,23,59,33", + "mode": "Digit", + "method": "Default", + "keyword": "", + "description": "六道门票" + }, { "itemName": "skill_refresh", "roiFront": "1172,684,100,31", diff --git a/tasks/SixRealms/gate1/skills.json b/tasks/SixRealms/gate1/skills.json index 8881be942..c4b0da268 100644 --- a/tasks/SixRealms/gate1/skills.json +++ b/tasks/SixRealms/gate1/skills.json @@ -2,11 +2,11 @@ { "itemName": "skill101", "imageName": "gate1_skill101.png", - "roiFront": "440,181,100,69", - "roiBack": "139,167,722,100", + "roiFront": "736,171,64,60", + "roiBack": "156,154,689,100", "method": "Template matching", "threshold": 0.8, - "description": "柔风" + "description": "轰雷选择off" }, { "itemName": "skill102", @@ -38,52 +38,52 @@ { "itemName": "skill_refresh", "imageName": "gate1_skill_refresh.png", - "roiFront": "1196,625,44,39", - "roiBack": "1171,586,100,100", + "roiFront": "1187,625,52,47", + "roiBack": "1169,602,92,82", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "skill_refreshre" }, { "itemName": "select_0", "imageName": "gate1_select_0.png", - "roiFront": "152,572,132,44", - "roiBack": "140,542,163,100", + "roiFront": "155,551,132,44", + "roiBack": "140,528,163,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "select_0re" }, { "itemName": "select_1", "imageName": "gate1_select_1.png", - "roiFront": "424,573,137,46", - "roiBack": "382,544,196,100", + "roiFront": "428,551,137,46", + "roiBack": "394,528,196,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "select_1re" }, { "itemName": "select_2", "imageName": "gate1_select_2.png", - "roiFront": "696,572,140,47", - "roiBack": "666,546,196,100", + "roiFront": "700,552,140,47", + "roiBack": "669,527,196,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "select_2re" }, { "itemName": "select_3", "imageName": "gate1_select_3.png", - "roiFront": "1016,581,145,43", - "roiBack": "1000,550,173,100", + "roiFront": "1018,552,145,43", + "roiBack": "1003,521,173,106", "method": "Template matching", "threshold": 0.8, - "description": "最右边的恢复生命" + "description": "舞技强化re" }, { "itemName": "coin", "imageName": "gate1_coin.png", - "roiFront": "612,345,66,53", + "roiFront": "567,343,66,53", "roiBack": "405,229,561,270", "method": "Template matching", "threshold": 0.8, @@ -91,8 +91,8 @@ }, { "itemName": "coin2", - "imageName": "gate1_coin.png", - "roiFront": "612,345,66,53", + "imageName": "gate1_coin2.png", + "roiFront": "567,343,66,53", "roiBack": "405,229,561,270", "method": "Template matching", "threshold": 0.8, @@ -106,5 +106,23 @@ "method": "Template matching", "threshold": 0.8, "description": "洞察之力" + }, + { + "itemName": "peacock_skill1", + "imageName": "gate1_peacock_skill1.png", + "roiFront": "244,501,95,35", + "roiBack": "223,478,143,73", + "method": "Template matching", + "threshold": 0.8, + "description": "力量强化" + }, + { + "itemName": "peacock_skill2", + "imageName": "gate1_peacock_skill2.png", + "roiFront": "779,501,93,36", + "roiBack": "747,480,163,76", + "method": "Template matching", + "threshold": 0.8, + "description": "技巧强化" } ] \ No newline at end of file diff --git a/tasks/SixRealms/gate1/swipe.json b/tasks/SixRealms/gate1/swipe.json index 62972f211..26cd73248 100644 --- a/tasks/SixRealms/gate1/swipe.json +++ b/tasks/SixRealms/gate1/swipe.json @@ -1,9 +1,11 @@ [ { "itemName": "team_swipe_up", + "imageName": "gate1_team_swipe_up.png", "roiFront": "520,571,93,98", "roiBack": "589,180,100,100", - "mode": "default", + "method": "", + "threshold": 0, "description": "征伐队伍选择界面底部阵容上拉" } ] \ No newline at end of file diff --git a/tasks/SixRealms/l101/image.json b/tasks/SixRealms/l101/image.json index d2aebf4fb..e7a6c9065 100644 --- a/tasks/SixRealms/l101/image.json +++ b/tasks/SixRealms/l101/image.json @@ -2,35 +2,35 @@ { "itemName": "store_refresh", "imageName": "l101_store_refresh.png", - "roiFront": "545,596,46,47", - "roiBack": "519,568,100,100", + "roiFront": "594,599,46,47", + "roiBack": "566,571,100,93", "method": "Template matching", "threshold": 0.8, - "description": "宁息刷新" + "description": "宁息刷新re" }, { "itemName": "store_skill_101", "imageName": "l101_store_skill_101.png", - "roiFront": "876,121,47,41", - "roiBack": "682,100,455,571", + "roiFront": "1074,592,47,45", + "roiBack": "700,94,476,622", "method": "Template matching", "threshold": 0.9, - "description": "购买柔风" + "description": "购买轰雷re" }, { "itemName": "store_exit", "imageName": "l101_store_exit.png", - "roiFront": "1179,586,59,56", - "roiBack": "1161,561,100,100", + "roiFront": "1194,610,59,56", + "roiBack": "1166,593,100,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "商店退出re" }, { "itemName": "store_stable_flag", "imageName": "l101_store_stable_flag.png", - "roiFront": "1028,251,28,27", - "roiBack": "1011,241,63,47", + "roiFront": "1096,15,60,42", + "roiBack": "1094,12,63,47", "method": "Template matching", "threshold": 0.8, "description": "稳定标志" diff --git a/tasks/SixRealms/l101/l101_store_exit.png b/tasks/SixRealms/l101/l101_store_exit.png index 781e80367..9a8df2805 100644 Binary files a/tasks/SixRealms/l101/l101_store_exit.png and b/tasks/SixRealms/l101/l101_store_exit.png differ diff --git a/tasks/SixRealms/l101/l101_store_refresh.png b/tasks/SixRealms/l101/l101_store_refresh.png index 598a36de2..bcc4017a8 100644 Binary files a/tasks/SixRealms/l101/l101_store_refresh.png and b/tasks/SixRealms/l101/l101_store_refresh.png differ diff --git a/tasks/SixRealms/l101/l101_store_skill_101.png b/tasks/SixRealms/l101/l101_store_skill_101.png index cb8f51a05..9a95f0e93 100644 Binary files a/tasks/SixRealms/l101/l101_store_skill_101.png and b/tasks/SixRealms/l101/l101_store_skill_101.png differ diff --git a/tasks/SixRealms/l101/l101_store_stable_flag.png b/tasks/SixRealms/l101/l101_store_stable_flag.png index e871bfa85..b01fce9e6 100644 Binary files a/tasks/SixRealms/l101/l101_store_stable_flag.png and b/tasks/SixRealms/l101/l101_store_stable_flag.png differ diff --git a/tasks/SixRealms/l101/ocr.json b/tasks/SixRealms/l101/ocr.json index c787b5a2b..b55328124 100644 --- a/tasks/SixRealms/l101/ocr.json +++ b/tasks/SixRealms/l101/ocr.json @@ -1,8 +1,8 @@ [ { "itemName": "store_refresh_time", - "roiFront": "538,661,110,27", - "roiBack": "538,661,110,27", + "roiFront": "587,660,110,27", + "roiBack": "586,659,110,27", "mode": "Single", "method": "Default", "keyword": "", diff --git a/tasks/SixRealms/l103/image.json b/tasks/SixRealms/l103/image.json index 08ce7a62d..2c0cb12eb 100644 --- a/tasks/SixRealms/l103/image.json +++ b/tasks/SixRealms/l103/image.json @@ -1,11 +1,20 @@ [ { "itemName": "l103_exit", - "imageName": "l103_exit.png", - "roiFront": "1171,587,69,70", + "imageName": "l103_l103_exit.png", + "roiFront": "1156,630,61,58", "roiBack": "1078,538,195,180", "method": "Template matching", "threshold": 0.8, "description": "description" + }, + { + "itemName": "lucky_box", + "imageName": "l103_lucky_box.png", + "roiFront": "625,268,26,107", + "roiBack": "527,179,257,293", + "method": "Template matching", + "threshold": 0.8, + "description": "lucky_boxre" } ] \ No newline at end of file diff --git a/tasks/SixRealms/l103/l103_l103_exit.png b/tasks/SixRealms/l103/l103_l103_exit.png new file mode 100644 index 000000000..d30ed6897 Binary files /dev/null and b/tasks/SixRealms/l103/l103_l103_exit.png differ diff --git a/tasks/SixRealms/l103/l103_lucky_box.png b/tasks/SixRealms/l103/l103_lucky_box.png new file mode 100644 index 000000000..752102fc4 Binary files /dev/null and b/tasks/SixRealms/l103/l103_lucky_box.png differ diff --git a/tasks/SixRealms/l103/lucky_box.png b/tasks/SixRealms/l103/lucky_box.png new file mode 100644 index 000000000..bf8ae5990 Binary files /dev/null and b/tasks/SixRealms/l103/lucky_box.png differ diff --git a/tasks/SixRealms/l104/image.json b/tasks/SixRealms/l104/image.json index f06a1bba5..678b01394 100644 --- a/tasks/SixRealms/l104/image.json +++ b/tasks/SixRealms/l104/image.json @@ -2,37 +2,46 @@ { "itemName": "npc_common", "imageName": "l104_npc_common.png", - "roiFront": "718,232,36,40", - "roiBack": "684,208,100,100", + "roiFront": "720,223,36,40", + "roiBack": "690,202,100,100", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "普通re" }, { "itemName": "npc_fire", "imageName": "l104_npc_fire.png", - "roiFront": "1129,585,100,100", + "roiFront": "1124,573,100,100", "roiBack": "1080,551,174,144", "method": "Template matching", "threshold": 0.8, - "description": "点击挑战" + "description": "点击挑战re" }, { "itemName": "battle_team_unlock", "imageName": "l104_battle_team_unlock.png", - "roiFront": "962,676,21,21", - "roiBack": "943,655,64,60", + "roiFront": "956,652,39,39", + "roiBack": "942,641,64,60", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "unlockre" }, { "itemName": "battle_team_lock", "imageName": "l104_battle_team_lock.png", - "roiFront": "961,675,21,23", - "roiBack": "949,662,48,50", + "roiFront": "957,652,35,36", + "roiBack": "942,636,65,68", "method": "Template matching", "threshold": 0.8, - "description": "description" + "description": "lockre" + }, + { + "itemName": "fenghuang", + "imageName": "l104_fenghuang.png", + "roiFront": "582,124,412,433", + "roiBack": "582,124,412,433", + "method": "Template matching", + "threshold": 0.8, + "description": "fenghuang" } ] \ No newline at end of file diff --git a/tasks/SixRealms/l104/l104_battle_team_lock.png b/tasks/SixRealms/l104/l104_battle_team_lock.png index 3189cae20..b4acceb44 100644 Binary files a/tasks/SixRealms/l104/l104_battle_team_lock.png and b/tasks/SixRealms/l104/l104_battle_team_lock.png differ diff --git a/tasks/SixRealms/l104/l104_battle_team_unlock.png b/tasks/SixRealms/l104/l104_battle_team_unlock.png index eba672d4f..f5af1544c 100644 Binary files a/tasks/SixRealms/l104/l104_battle_team_unlock.png and b/tasks/SixRealms/l104/l104_battle_team_unlock.png differ diff --git a/tasks/SixRealms/l104/l104_npc_common.png b/tasks/SixRealms/l104/l104_npc_common.png new file mode 100644 index 000000000..23f746602 Binary files /dev/null and b/tasks/SixRealms/l104/l104_npc_common.png differ diff --git a/tasks/SixRealms/l104/l104_npc_fire.png b/tasks/SixRealms/l104/l104_npc_fire.png index b09f9febe..b5a1a1364 100644 Binary files a/tasks/SixRealms/l104/l104_npc_fire.png and b/tasks/SixRealms/l104/l104_npc_fire.png differ diff --git a/tasks/SixRealms/l105/image.json b/tasks/SixRealms/l105/image.json new file mode 100644 index 000000000..58be1617d --- /dev/null +++ b/tasks/SixRealms/l105/image.json @@ -0,0 +1,11 @@ +[ + { + "itemName": "zhaofu", + "imageName": "l105_zhaofu.png", + "roiFront": "1157,628,57,59", + "roiBack": "1135,603,97,111", + "method": "Template matching", + "threshold": 0.8, + "description": "绽放退出" + } +] \ No newline at end of file diff --git a/tasks/SixRealms/l105/l105_zhaofu.png b/tasks/SixRealms/l105/l105_zhaofu.png new file mode 100644 index 000000000..9f03c3175 Binary files /dev/null and b/tasks/SixRealms/l105/l105_zhaofu.png differ diff --git a/tasks/SixRealms/moon_sea/l101.py b/tasks/SixRealms/moon_sea/l101.py index 3f2428be6..0530055d7 100644 --- a/tasks/SixRealms/moon_sea/l101.py +++ b/tasks/SixRealms/moon_sea/l101.py @@ -73,10 +73,10 @@ def run_l101(self): while 1: self.screenshot() coin = self.O_COIN_NUM.ocr(self.device.image) - if coin < 300: + if coin < 200: logger.info('Not enough coin') break - if self.cnt_skill101 >= 5: + if self.cnt_skill101 >= 1: logger.info('Skill 101 level is max') break @@ -84,7 +84,7 @@ def run_l101(self): self.ui_click_until_disappear(self.I_UI_CONFIRM, interval=1) if self.appear(self.I_STORE_SKILL_101): self.buy_skill_101() - elif coin < 400: + elif coin < 300: break elif not self.refresh_store(): break @@ -102,11 +102,9 @@ def run_l101(self): if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - c = Config('oas1') - d = Device(c) - t = MoonSeaL101(c, d) + c = Config('du') + t = MoonSeaL101(c) t.screenshot() t.run_l101() diff --git a/tasks/SixRealms/moon_sea/l102.py b/tasks/SixRealms/moon_sea/l102.py index 130ee46a5..c781ce635 100644 --- a/tasks/SixRealms/moon_sea/l102.py +++ b/tasks/SixRealms/moon_sea/l102.py @@ -7,9 +7,12 @@ class MoonSeaL102(MoonSeaSkills): def run_l102(self): logger.hr('Start Island battle') logger.info('Island 102') - is_imitation = None + ##is_imitation = None while 1: self.screenshot() + if self.appear_then_click(self.I_BACK_EXIT, interval=1): + break + ''' if self.appear(self.I_COIN_RIGHT_TOP): is_imitation = False break @@ -33,7 +36,9 @@ def run_l102(self): continue logger.info('Finish Island 102') return + self.imitate() + ''' def imitate(self): # 仿造 @@ -43,6 +48,9 @@ def imitate(self): self.screenshot() if self.in_main(): break + if self.cnt_skill101 >= 5: + if self.appear_then_click(self.I_BACK_EXIT, interval=2): + continue if self.appear_then_click(self.I_IMITATE_1, interval=2.5): continue if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1): @@ -69,11 +77,9 @@ def imitate(self): if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - c = Config('oas1') - d = Device(c) - t = MoonSeaL102(c, d) + c = Config('du') + t = MoonSeaL102(c) t.screenshot() t.run_l102() diff --git a/tasks/SixRealms/moon_sea/l103.py b/tasks/SixRealms/moon_sea/l103.py index 3d2e97f96..c9dd6ef59 100644 --- a/tasks/SixRealms/moon_sea/l103.py +++ b/tasks/SixRealms/moon_sea/l103.py @@ -7,13 +7,12 @@ class MoonSeaL103(MoonSeaSkills): def run_103(self): # 宝箱还是精英 logger.hr('Island 103') - self.wait_until_appear(self.I_ISLAND_TAG_FLAG, wait_time=2) is_box: bool = self.appear(self.I_L103_EXIT) if is_box: logger.info('Access to Box') while 1: self.screenshot() - if self.appear(self.I_M_STORE): + if self.appear(self.I_M_STORE) or self.appear(self.I_BOSS_FIRE): logger.info('Not punched the treasure box') return if self.appear_then_click(self.I_UI_UNCHECK, interval=0.5): @@ -37,18 +36,15 @@ def battle_l103(self): self.battle_lock_team() self.island_battle() logger.info('Island battle finished') - self.select_skill(refresh=True) if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - c = Config('oas1') - d = Device(c) - t = MoonSeaL103(c, d) + c = Config('du') + t = MoonSeaL103(c) t.screenshot() t.run_103() diff --git a/tasks/SixRealms/moon_sea/l104.py b/tasks/SixRealms/moon_sea/l104.py index a67c90484..c85d7c85c 100644 --- a/tasks/SixRealms/moon_sea/l104.py +++ b/tasks/SixRealms/moon_sea/l104.py @@ -11,21 +11,18 @@ def run_l104(self): self.screenshot() if self.appear(self.I_NPC_FIRE): break - if self.click(self.C_NPC_FIRE_RIGHT, interval=4): + if self.click(self.C_NPC_FIRE_RIGHT, interval=2): continue self.battle_lock_team() self.island_battle() logger.info('Island battle finished') - self.select_skill(refresh=True) if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - c = Config('oas1') - d = Device(c) - t = MoonSeaL104(c, d) + c = Config('du') + t = MoonSeaL104(c) t.screenshot() t.run_l104() diff --git a/tasks/SixRealms/moon_sea/l105.py b/tasks/SixRealms/moon_sea/l105.py index 30896a02c..7ba5e575f 100644 --- a/tasks/SixRealms/moon_sea/l105.py +++ b/tasks/SixRealms/moon_sea/l105.py @@ -11,11 +11,20 @@ def run_l105(self): """ logger.hr('Start Island battle') logger.info('Island 105') + while 1: + self.screenshot() + if self.appear_then_click(self.I_ZHAOFU, interval=1): + break + ''' + if not self.wait_until_appear(self.I_ZHAOFU, wait_time=1): + self.save_image(task_name="Island 105", image_type=True, wait_time=1) + self.appear_then_click(self.I_BACK_EXIT, interval=1) + return False while 1: self.screenshot() if self.appear(self.I_NPC_FIRE): break - if self.click(self.C_NPC_FIRE_LEFT): + if self.appear_then_click(self.I_ZHAOFU): continue self.battle_lock_team() self.island_battle() @@ -26,15 +35,15 @@ def run_l105(self): break if self.appear_then_click(self.I_COIN, action=self.C_UI_REWARD, interval=0.8): continue + ''' + return True if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - c = Config('oas1') - d = Device(c) - t = MoonSeaL105(c, d) + c = Config('du') + t = MoonSeaL105(c) t.screenshot() t.run_l105() diff --git a/tasks/SixRealms/moon_sea/map.py b/tasks/SixRealms/moon_sea/map.py index 3b95803d1..b26d99782 100644 --- a/tasks/SixRealms/moon_sea/map.py +++ b/tasks/SixRealms/moon_sea/map.py @@ -1,129 +1,63 @@ -import cv2 -import re -import numpy as np -from numpy import uint8, fromfile from module.logger import logger - -from tasks.base_task import BaseTask from tasks.SixRealms.moon_sea.skills import MoonSeaSkills -from tasks.SixRealms.assets import SixRealmsAssets -from tasks.SixRealms.common import MoonSeaType -from tasks.SixRealms.oas_ocr import StoneOcr - +from cached_property import cached_property class MoonSeaMap(MoonSeaSkills): - map_ocr = StoneOcr( - roi=(0, 0, 1280, 720), - area=(0, 0, 1280, 720), - mode="Full", - method="Default", - keyword="", - name="map_ocr") - - @staticmethod - def contains_any_char(string, chars): - return not set(string).isdisjoint(set(chars)) - - def decide(self) -> tuple: - """ - 这个玩意,检测不是很准 - @return: 岛屿的类型,剩余多少回合, (x,y, w, h) - """ + priority_queue=[[0,3,1,5,4,2],[0,1,5,3,4,2]] # 两种优先级方案 + @cached_property + def island_list(self): + return [ + self.I_UI_CANCEL, + self.I_SHENMI, + self.I_HUNDUN, + self.I_ZHAN, + self.I_XING, + self.I_NINGXI + ] + + def enter_island(self): self.screenshot() - if self.appear(self.I_BOSS_FIRE): - # 最后的boss - return MoonSeaType.island106, 0, (0, 0, 0, 0) - isl_type = MoonSeaType.island100 - isl_roi = (0, 0, 0, 0) - isl_num = 0 - results = self.map_ocr.detect_and_ocr(image=self.device.image) - rx1, ry1, rw, rh = self.O_OCR_MAP.roi - rx2, ry2 = rx1 + rw, ry1 + rh - for result in results: - # box 是四个点坐标 左上, 右上, 右下, 左下 - x1, y1, x2, y2 = result.box[0][0], result.box[0][1], result.box[2][0], result.box[2][1] - w, h = x2 - x1, y2 - y1 - text = result.ocr_text - - if self.contains_any_char(result.ocr_text, chars='回合国') and \ - (x1 > 1000 and y1 + h < 300): - # if text[1].isdigit(): - # isl_num = int(text[:2]) - # elif text[0].isdigit(): - # isl_num = int(text[0]) - match = re.search(r'\d{1,2}', text) - if match: - isl_num = int(match.group()) - if x1 < rx1 or x2 > rx2 or y1 < ry1 or y2 > ry2: - continue - if isl_type == MoonSeaType.island100 and self.contains_any_char(result.ocr_text, chars='宁息'): - # 如果身上没有达到300块钱就不去了 - if self.appear(self.I_M_STORE): - continue - isl_type = MoonSeaType.island101 - isl_roi = x1, y1, w, h - elif isl_type == MoonSeaType.island100 and self.contains_any_char(result.ocr_text, chars='神秘'): - isl_type = MoonSeaType.island102 - isl_roi = x1, y1, w, h - elif isl_type == MoonSeaType.island100 and self.contains_any_char(result.ocr_text, chars='回混范'): - isl_type = MoonSeaType.island103 - isl_roi = x1, y1, w, h - elif isl_type == MoonSeaType.island100 and self.contains_any_char(result.ocr_text, chars='蜜馨屡战'): - isl_type = MoonSeaType.island104 - isl_roi = x1, y1, w, h - elif isl_type == MoonSeaType.island100 and self.contains_any_char(result.ocr_text, chars='星之'): - isl_type = MoonSeaType.island105 - isl_roi = x1, y1, w, h - logger.info('Island type: {}, Residue: {}, ROI: {}'.format(isl_type, isl_num, isl_roi)) - return isl_type, isl_num, isl_roi - - def enter_island(self, isl_type, isl_roi): - if isl_type == MoonSeaType.island100: - logger.warning('The island type was not recognized') - logger.warning('Pick one at random, starting from the right') - while 1: - self.screenshot() - if not self.in_main() and self.appear(self.I_BACK_EXIT): - break - if self.appear_then_click(self.I_UI_CANCEL, interval=1): - continue - if self.click(self.C_ISLAND_ENTER_1, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_2, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_3, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_4, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_5, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_6, interval=2): - continue - logger.info('Entering island randomly') - return - isl_roi = [isl_roi[0]-40, isl_roi[1] + 70, isl_roi[2] + 40, isl_roi[3]+40] - self.C_ISLAND_ENTER.roi_front = isl_roi - while 1: - self.screenshot() - if not self.in_main() and self.appear(self.I_BACK_EXIT): - break - if self.click(self.C_ISLAND_ENTER, interval=2.5): - continue + logger.info(f'Entering island self.cnt_skill101={self.cnt_skill101}, self.cnt_skillpower={self.cnt_skillpower}') + if self.cnt_skill101 < 1 and self.cnt_skillpower < 4: + i=0 + for i in range(6): + if self.appear_then_click(self.island_list[self.priority_queue[0][i]], interval=1): + return True + else: + i=0 + for i in range(6): + if self.appear_then_click(self.island_list[self.priority_queue[1][i]], interval=1): + return True + ''' + if self.appear_then_click(self.I_UI_CANCEL, interval=1): + return True + if self.appear_then_click(self.I_SHENMI, interval=1): + return True + if self.appear_then_click(self.I_HUNDUN, interval=1): + return True + if self.appear_then_click(self.I_ZHAN, interval=1): + return True + if self.appear_then_click(self.I_XING, interval=1): + return True + if self.appear_then_click(self.I_NINGXI, interval=1): + return True + ''' logger.info('Entering island') - return + return None def activate_store(self) -> bool: """ 最后打boss前面激活一次商店买东西 @return: 有钱够就是True """ - logger.info('Activating store') + if self.cnt_skill101 >= 1: + # 如果柔风满级就不召唤 + return False self.screenshot() - if self.appear(self.I_M_STORE) and not self.appear(self.I_M_STORE_ACTIVITY): - logger.warning('Now you have not money to buy items') - logger.warning('Store is not active') + if not self.appear_rgb(self.I_M_STORE_ACTIVITY): return False cnt_act = 0 + logger.info('Activating store') while 1: self.screenshot() if self.appear(self.I_UI_CONFIRM): @@ -135,41 +69,18 @@ def activate_store(self) -> bool: if self.appear_then_click(self.I_M_STORE_ACTIVITY, interval=1.5): cnt_act += 1 continue - - def entry_island_random(self, area: list = None): - """ - - :param area: 搁置 - :return: - """ - # if not isinstance(area, list): - # area = list(area) - logger.info('Entry island randomly') - while 1: - self.screenshot() - if not self.in_main() and self.appear(self.I_BACK_EXIT): - break - if self.click(self.C_ISLAND_ENTER_4, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_5, interval=2): - continue - if self.click(self.C_ISLAND_ENTER_6, interval=2): - continue - return + return True if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - from module.base.utils import load_image - - c = Config('oas1') - d = Device(c) - t = MoonSeaMap(c, d) - t.device.image = load_image(r'C:\Users\Ryland\Desktop\Desktop\34.png') - match = re.search(r'\d{1,2}', '<17回合后迎战月读') - if match: - isl_num = int(match.group()) - print(isl_num) + c = Config('du') + t = MoonSeaMap(c) + # t.screenshot() + # t.device.image = load_image(r'C:\Users\Ryland\Desktop\Desktop\34.png') + # match = re.search(r'\d{1,2}', '<17回合后迎战月读') + # if match: + # isl_num = int(match.group()) + # print(isl_num) diff --git a/tasks/SixRealms/moon_sea/moon_sea.py b/tasks/SixRealms/moon_sea/moon_sea.py index 7b6f103a2..1da800f19 100644 --- a/tasks/SixRealms/moon_sea/moon_sea.py +++ b/tasks/SixRealms/moon_sea/moon_sea.py @@ -1,7 +1,6 @@ import time from module.logger import logger - from cached_property import cached_property from datetime import datetime, timedelta @@ -16,16 +15,6 @@ class MoonSea(MoonSeaMap, MoonSeaL101, MoonSeaL102, MoonSeaL103, MoonSeaL104, MoonSeaL105): - @cached_property - def island_func(self) -> dict: - return { - MoonSeaType.island101: self.run_l101(), - MoonSeaType.island102: self.run_l102(), - MoonSeaType.island103: self.run_103(), - MoonSeaType.island104: self.run_l104(), - MoonSeaType.island105: self.run_l105(), - } - @property def _conf(self): return self.config.model.six_realms.six_realms_gate @@ -41,60 +30,50 @@ def _run_moon_sea(self): ) cnt = 0 while 1: + #self._check_first_priority_task() if cnt >= max_cont: logger.info('Run out of count, exit') break if datetime.now() - self.start_time >= max_time: logger.info('Run out of time, exit') break - self.one() - cnt += 1 + if self.one(): + cnt += 1 + logger.info(f'Run {cnt} times,avg time: {timedelta(seconds=int((datetime.now() - self.start_time).total_seconds() / cnt))}, total time: {timedelta(seconds=int((datetime.now() - self.start_time).total_seconds()))}') + else: + break + self.push_notify(content=f'任务已完成{cnt}次,用时: {timedelta(seconds=int((datetime.now() - self.start_time).total_seconds()))}') logger.info('Exit Moon Sea') - def one(self): - self.cnt_skill101 = 1 - self._start() + self.cnt_skill101 = 0 + self.cnt_skillpower = 1 + if not self._start(): + return False while 1: - self.screenshot() - if not self.in_main(): - continue - isl_type, isl_num, isl_roi = self.decide() - if isl_num == 1 and isl_type != MoonSeaType.island106: - # 如果前一个,召唤一次宁息 - if self.cnt_skill101 >= 5: - # 如果柔风满级就不召唤 - pass - elif self.appear(self.I_M_STORE): - # 如果没有三百块就不能召唤 - logger.info('There have no money to active store at the last island') - pass - else: - self.activate_store() - self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=3) - isl_type, isl_num, isl_roi = self.decide() - # 文字检测不一定发现到宁息 - if isl_type != MoonSeaType.island101: - logger.warning('OCR not found island101') - logger.warning('Try to entry the island in the right randomly order') - self.entry_island_random() - - # 如果是boss - if isl_type == MoonSeaType.island106: - self.boss_team_lock() - if self.boss_battle(): - break - else: - continue - - self.enter_island(isl_type=isl_type, isl_roi=isl_roi) + self.screenshot() + + if self.select_skill(refresh=True): + continue + + if self.enter_island(): + continue isl_type = self.island_name() + if not isl_type: + continue match isl_type: case MoonSeaType.island101: self.run_l101() case MoonSeaType.island102: self.run_l102() case MoonSeaType.island103: self.run_103() case MoonSeaType.island104: self.run_l104() case MoonSeaType.island105: self.run_l105() + case MoonSeaType.island106: + logger.info('Is boss island') + self.boss_team_lock() + if self.boss_battle(): + return True + else: + continue self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=3) continue @@ -104,9 +83,6 @@ def _continue(self): self.screenshot() if self.in_main(): break - if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM): - self.select_shikigami_and_confirm() - continue if self.appear_then_click(self.I_MCONINUE, interval=1): continue @@ -114,14 +90,20 @@ def _start(self): logger.hr('Moon Sea', 1) while 1: self.screenshot() - if self.appear(self.I_MSTART): + if self.appear(self.I_MSTART,interval=1): + if self._conf.number_enable: + cu = self.O_SIXREALMS_NUMBER.ocr(self.device.image) + logger.info(f"六道门票数量:{cu}") + if not cu > 0: + self.push_notify("六道门票数量不足, 退出!") + return False break if self.appear_then_click(self.I_MENTER, interval=1): continue if self.appear(self.I_MCONINUE): # 继续上一把的 - self._continue() - return + self.ui_click_until_disappear(self.I_MCONINUE) + return True logger.info("Ensure select ShouZu") while 1: self.screenshot() @@ -152,10 +134,8 @@ def _start(self): continue if self.appear_then_click(self.I_MCONINUE, interval=3): continue - # Hook: select one shikigami and confirm before starting - if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM): - self.select_shikigami_and_confirm() - + if self.appear_then_click(self.I_MPEACOCK_SKILL, interval=3): + continue logger.info("Start Roguelike") while 1: self.screenshot() @@ -165,14 +145,15 @@ def _start(self): continue # 选中第一个柔风 logger.info("Select first skill") + return True - def island_name(self) -> MoonSeaType: + def island_name(self): while 1: self.screenshot() text = self.O_ISLAND_NAME.ocr(self.device.image) - if '星' in text: + if '绽放' in text: return MoonSeaType.island105 - if '战' in text: + if '战之' in text: return MoonSeaType.island104 if '混' in text: return MoonSeaType.island103 @@ -180,6 +161,10 @@ def island_name(self) -> MoonSeaType: return MoonSeaType.island102 if '宁息' in text: return MoonSeaType.island101 + if '恋色' in text: + return MoonSeaType.island106 + else: + return False def boss_team_lock(self): while 1: @@ -219,34 +204,22 @@ def boss_battle(self) -> bool: continue if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1): continue - if self.appear_then_click(self.I_BOSS_SKIP, interval=1): + if self.appear(self.I_BOSS_SKIP, interval=1): # 第二个boss self.device.stuck_record_clear() self.device.stuck_record_add('BATTLE_STATUS_S') continue logger.info('Boss battle end') + self.save_image() if self.wait_until_appear(self.I_BOSS_SHUTU, wait_time=20): self.ui_click(self.I_BOSS_SHUTU, stop=self.I_MSTART) return True - def select_shikigami_and_confirm(self): - """Select shikigami and confirm to start battle.""" - while True: - self.screenshot() - if not self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM): - break - self.swipe(self.S_TEAM_SWIPE_UP) - self.appear_then_click(self.I_MSTART_CONFIRM, interval=2) - self.appear_then_click(self.I_COIN2, interval=2) - if __name__ == '__main__': from module.config.config import Config - from module.device.device import Device - - c = Config('oas1') - d = Device(c) - t = MoonSea(c, d) - t.screenshot() + c = Config('du') + t = MoonSea(c) t.one() + # t.select_skill() diff --git a/tasks/SixRealms/moon_sea/skills.py b/tasks/SixRealms/moon_sea/skills.py index d836600e3..10f694225 100644 --- a/tasks/SixRealms/moon_sea/skills.py +++ b/tasks/SixRealms/moon_sea/skills.py @@ -12,6 +12,7 @@ class MoonSeaSkills(BaseTask, SixRealmsAssets): cnt_skill101 = 0 + cnt_skillpower = 1 def in_main(self, screenshot: bool = False): if screenshot: @@ -37,9 +38,6 @@ def island_battle(self): break if self.appear(self.I_COIN): break - if self.appear(self.I_SELECT_SHIKIGAMI_AND_CONFIRM): - self.select_shikigami_and_confirm() - continue if self.appear_then_click(self.I_NPC_FIRE, interval=1): self.device.stuck_record_clear() self.device.stuck_record_add('BATTLE_STATUS_S') @@ -71,9 +69,11 @@ def _select_skill(self) -> int: # button = self.I_SKILL103 # elif button is None and self.appear(self.I_SKILL104): # button = self.I_SKILL104 - elif button is None and self.appear(self.I_SKILL105): + ''' + elif button is None and self.appear(self.I_SKILL105): logger.info(f'Skill 105 level: {self.cnt_skill101}') button = self.I_SKILL105 + ''' if button is not None: x, y = button.front_center() if x < 360: @@ -105,31 +105,46 @@ def check_refresh() -> bool: else: return True return False - # 战斗结束后选技能 - logger.info('Start select skill') - - while 1: - self.screenshot() - if self.in_main(): - break - if self.appear(self.I_UI_CONFIRM): - self.ui_click_until_disappear(self.I_UI_CONFIRM) + if self.appear(self.I_UI_CONFIRM): + self.ui_click_until_disappear(self.I_UI_CONFIRM) + return True - if self.appear(self.I_SKILL_REFRESH) and self.appear(self.I_SELECT_3) and not self.appear(self.I_COIN2): + if self.appear(self.I_SKILL_REFRESH) and self.appear(self.I_SELECT_3) and not self.appear(self.I_COIN): + # 战斗结束后选技能 + logger.info('Start select skill') + select = self._select_skill() + # 如果没有柔风并且钱够并且还有刷新次数 + while self.cnt_skill101 < 1 and self.cnt_skillpower>=4 and refresh and select == 3 and check_coin_skill() and check_refresh() : + logger.info('Refresh skill') + self.appear_then_click(self.I_SKILL_REFRESH) + #self.wait_until_stable(self.I_UI_CONFIRM, timeout=Timer(2)) + #self.appear_then_click(self.I_UI_CONFIRM) + self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=1) select = self._select_skill() - # 如果没有柔风并且钱够并且还有刷新次数 - if refresh and select == 3 and check_coin_skill() and check_refresh() and self.cnt_skill101 < 5: - logger.info('Refresh skill') - self.appear_then_click(self.I_SKILL_REFRESH) - self.wait_until_stable(self.I_UI_CONFIRM, timeout=Timer(2)) - self.appear_then_click(self.I_UI_CONFIRM) - self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=1) - continue - if self.appear_then_click(self.selects_button[select]): - self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=2) - continue - if self.appear_then_click(self.I_COIN, action=self.C_UI_REWARD, interval=1.5): - continue + ''' + if self.cnt_skill101 < 1 and self.cnt_skillpower>=4 and refresh and select == 3 and check_coin_skill() and check_refresh() : + logger.info('Refresh skill') + self.appear_then_click(self.I_SKILL_REFRESH) + self.wait_until_stable(self.I_UI_CONFIRM, timeout=Timer(2)) + self.appear_then_click(self.I_UI_CONFIRM) + self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=1) + return True + ''' + if self.appear_then_click(self.selects_button[select],interval=1): + if select==3: + self.wait_until_stable(self.I_PEACOCK_SKILL1, timeout=Timer(3)) + if self.appear_then_click(self.I_PEACOCK_SKILL1,interval=1): + self.cnt_skillpower+=1 + logger.info(f'Skill power level: {self.cnt_skillpower}') + if self.appear_then_click(self.I_PEACOCK_SKILL2,interval=1): + logger.info(f'Skill level +1 ') + self.wait_animate_stable(self.C_MAIN_ANIMATE_KEEP, timeout=2) + + return True + + if self.appear_then_click(self.I_COIN, action=self.C_UI_REWARD, interval=1.5): + return True + return None diff --git a/tasks/SixRealms/oas_ocr.py b/tasks/SixRealms/oas_ocr.py index 3a58c81f5..c33fc3fb6 100644 --- a/tasks/SixRealms/oas_ocr.py +++ b/tasks/SixRealms/oas_ocr.py @@ -1,5 +1,3 @@ -import functools - import cv2 import numpy as np @@ -32,31 +30,31 @@ def rotate_image(image): return image return image - def detect_and_ocr(self, *args, **kwargs): - # Try hard to lower TextSystem.box_thresh - backup = self.model.text_detector.box_thresh - # Patch text_recognizer - text_recognizer = self.model.text_recognizer - # Lower drop_score - lower_score = functools.partial(self.model.detect_and_ocr, drop_score=0.1) - detect_and_ocr = self.model.detect_and_ocr - - def vertical_text_recognizer(img_crop_list): - img_crop_list = [VerticalText.rotate_image(i) for i in img_crop_list] - result = text_recognizer(img_crop_list) - return result - - self.model.text_detector.box_thresh = 0.2 - self.model.text_recognizer = vertical_text_recognizer - self.model.detect_and_ocr = lower_score - - try: - result = super().detect_and_ocr(*args, **kwargs) - finally: - self.model.text_detector.box_thresh = backup - self.model.text_recognizer = text_recognizer - self.model.detect_and_ocr = detect_and_ocr - return result + # def detect_and_ocr(self, *args, **kwargs): + # # Try hard to lower TextSystem.box_thresh + # backup = self.model.text_detector.box_thresh + # # Patch text_recognizer + # text_recognizer = self.model.text_recognizer + # # Lower drop_score + # lower_score = functools.partial(self.model.detect_and_ocr, drop_score=0.1) + # detect_and_ocr = self.model.detect_and_ocr + # + # def vertical_text_recognizer(img_crop_list): + # img_crop_list = [VerticalText.rotate_image(i) for i in img_crop_list] + # result = text_recognizer(img_crop_list) + # return result + # + # self.model.text_detector.box_thresh = 0.2 + # self.model.text_recognizer = vertical_text_recognizer + # self.model.detect_and_ocr = lower_score + # + # try: + # result = super().detect_and_ocr(*args, **kwargs) + # finally: + # self.model.text_detector.box_thresh = backup + # self.model.text_recognizer = text_recognizer + # self.model.detect_and_ocr = detect_and_ocr + # return result class StoneOcr(VerticalText): @@ -82,7 +80,6 @@ def pre_process(self, image): if __name__ == '__main__': - from tasks.SixRealms.assets import SixRealmsAssets file = r'C:\Users\Ryland\Desktop\Desktop\20.png' image = load_image(file) ocr = StoneOcr(roi=(0,0,1280,720), area=(0,0,1280,720), mode="Full", method="Default", keyword="", name="ocr_map") diff --git a/tasks/SixRealms/script_task.py b/tasks/SixRealms/script_task.py index d8a3c7172..5f69c6009 100644 --- a/tasks/SixRealms/script_task.py +++ b/tasks/SixRealms/script_task.py @@ -1,61 +1,31 @@ # This Python file uses the following encoding: utf-8 # @author runhey # github https://github.com/runhey -from cached_property import cached_property - - -from tasks.GameUi.game_ui import GameUi -from tasks.GameUi.page import page_main, page_soul_zones, page_shikigami_records -from module.logger import logger from module.exception import TaskEnd - -from time import sleep -from datetime import time, datetime, timedelta - -from tasks.Sougenbi.assets import SougenbiAssets -from tasks.Sougenbi.config import SougenbiConfig, SougenbiClass - from tasks.Component.SwitchSoul.switch_soul import SwitchSoul from tasks.GameUi.game_ui import GameUi -from tasks.GameUi.page import page_main, page_six_gates +from tasks.GameUi.page import page_shikigami_records,page_six_gates from tasks.SixRealms.moon_sea.moon_sea import MoonSea -from module.logger import logger - -class ScriptTask(GameUi, SwitchSoul, MoonSea): +class ScriptTask(SwitchSoul, MoonSea, GameUi): + """ 六道之门 """ @property def _config(self): return self.config.model.six_realms def run(self): - if self._config.switch_soul_config_1.enable: - self.ui_get_current_page() - self.ui_goto(page_shikigami_records) - self.run_switch_soul(self._config.switch_soul_config_1.switch_group_team) - if self._config.switch_soul_config_1.enable_switch_by_name: + if self._config.switch_soul_config.enable: self.ui_get_current_page() self.ui_goto(page_shikigami_records) - self.run_switch_soul_by_name( - self._config.switch_soul_config_1.group_name, - self._config.switch_soul_config_1.team_name - ) - if self._config.switch_soul_config_2.enable: + self.run_switch_soul(self._config.switch_soul_config.one_switch) self.ui_get_current_page() self.ui_goto(page_shikigami_records) - self.run_switch_soul(self._config.switch_soul_config_2.switch_group_team) - if self._config.switch_soul_config_2.enable_switch_by_name: - self.ui_get_current_page() - self.ui_goto(page_shikigami_records) - self.run_switch_soul_by_name( - self._config.switch_soul_config_2.group_name, - self._config.switch_soul_config_2.team_name - ) + self.run_switch_soul(self._config.switch_soul_config.two_switch) self.ui_get_current_page() - self.ui_goto(page_six_gates) - + self.ui_goto_page(page_six_gates) self.run_moon_sea() # 退出六道 @@ -65,8 +35,9 @@ def run(self): break if self.appear_then_click(self.I_BACK_EXIT, interval=2): continue - - self.set_next_run('SixRealms', success=True, finish=True) + # 设置下一次运行时间是周一 + #self.next_run_week(1) + self.set_next_run('SixRealms', success=True, finish=False) raise TaskEnd def run_moon_sea(self): @@ -74,16 +45,11 @@ def run_moon_sea(self): self.ui_click(self.I_BACK_EXIT, self.I_CHECK_SIX_GATES) - - - - 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() + + c = Config('du') + t = ScriptTask(c) + # t.screenshot() t.run() diff --git a/tasks/base_task.py b/tasks/base_task.py index 2974929b7..fe53d3ea8 100644 --- a/tasks/base_task.py +++ b/tasks/base_task.py @@ -1,7 +1,7 @@ # This Python file uses the following encoding: utf-8 # @author runhey # github https://github.com/runhey - +import cv2 from time import sleep, time import random @@ -720,3 +720,45 @@ def push_notify(self, content='', title=None, level=3): def save_image(self, task_name=None, content=None, wait_time=2, image_type=False, push_flag=False, level=3): logger.info(f'Save image: {task_name}') + def appear_rgb(self, target, image=None, difference: int = 10): + """ + 判断目标的平均颜色是否与图像中的颜色匹配。 + 参数: + - target: 目标对象,包含目标的文件路径和区域信息。 + - image: 输入图像,如果未提供,则使用设备捕获的图像。 + - difference: 颜色差异阈值,默认为10。 + 返回: + - 如果目标颜色与图像颜色匹配,则返回True,否则返回False。 + """ + # 如果未提供图像,则使用设备捕获的图像 + # logger.info(f"target [{target}], image [{image}]") + if not self.appear(target): + logger.warning(f"[{target.name}]未匹配到") + return False + + if image is None: + image = self.device.image + + # 加载图像并计算其平均颜色 + img = cv2.imread(target.file) + img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) + average_color = cv2.mean(img_rgb) + # logger.info(f"[{target.name}]average_color: {average_color}") + + # 提取目标区域的坐标和尺寸,并确保它们为整数 + x, y, w, h = target.roi_front + x, y, w, h = int(x), int(y), int(w), int(h) + # 从输入图像中提取目标区域 + img = image[y:y + h, x:x + w] + # 计算目标区域的平均颜色 + color = cv2.mean(img) + # logger.info(f"[{target.name}] color: {color}") + + # 比较目标图像和目标区域的颜色差异 + for i in range(3): + if abs(average_color[i] - color[i]) > difference: + logger.warning(f" [{target.name}] 颜色匹配失败") + return False + + logger.info(f"[{target.name}] 颜色匹配成功") + return True