Skip to content

Commit

Permalink
fix: not localized purchase ap notice detection and month card
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Jul 14, 2024
1 parent 0d6e5c6 commit bbfde1c
Show file tree
Hide file tree
Showing 27 changed files with 115 additions and 155 deletions.
1 change: 1 addition & 0 deletions core/Baas_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def quick_method_to_main_page(self, skip_first_screenshot=False):
'normal_task_skip-sweep-complete': (643, 506),
"normal_task_charge-challenge-counts": (887, 164),
"purchase_ap_notice": (919, 165),
"purchase_ap_notice-localized": (919, 165),
"normal_task_task-operating-feature": (1000, 660),
'normal_task_mission-operating-task-info': (1000, 664),
'normal_task_mission-operating-task-info-notice': (416, 595),
Expand Down
3 changes: 2 additions & 1 deletion core/picture.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def deal_with_pop_ups(self, rgb_pop_ups, img_pop_ups):
'CN': {
'main_page_news': (1142, 104),
'main_page_news2': (1142, 104),
'main_page_item-expire': (925, 119)
'main_page_item-expire': (925, 119),
'main_page_renewal-month-card': (927, 109),
},
'JP': {
'main_page_news': (1142, 104),
Expand Down
13 changes: 13 additions & 0 deletions develop_tools/ActivityInfomations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
1.活动名称
core/default_config.json
"current_game_activity" 字段, 一般来说以国际服英文名为准, 如果国际服未出这个活动, 自己起一个暂用
英文名应该去掉所有标点,每个单词首字母大写,连在一起

2.一个活动图片数据的储存:
①图片路径:
src/images/(服务器)/activity/(活动名)/
②图片坐标信息路径:
src/images/(服务器)/x_y_range/(活动名).py


3.有活动内容的信息:
13 changes: 7 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,32 @@ def operate_item(self, item):
if __name__ == '__main__':
t = Main(ocr_needed=["NUM", "CN", "Global"])
t.init_static_config()
config = ConfigSet(config_dir="1708232489")
config = ConfigSet(config_dir="1708148000")
tt = Baas_thread(config, None, None, None)
tt.static_config = t.static_config
tt.init_all_data()
tt.ocr = t.ocr
# tt.solve("refresh_uiautomator2")
# tt.solve("explore_activity_challenge")
# tt.solve("activity_sweep")
# tt.solve("explore_activity_mission")
# tt.solve("explore_activity_story")
tt.solve("explore_activity_mission")
tt.solve("explore_activity_story")
# tt.solve("common_shop")
# tt.solve("total_assault")
# tt.solve("cafe_reward")
# tt.solve("momo_talk")
# tt.solve("explore_normal_task")
tt.solve("explore_hard_task")
tt.solve("normal_task")
tt.solve("hard_task")
# tt.solve("explore_hard_task")
# tt.solve("normal_task")
# tt.solve("hard_task")
# tt.solve("arena")
# tt.solve("lesson")
# tt.solve("group")
# tt.solve("mail")
# tt.solve("collect_reward")
# tt.solve("main_story")
# tt.solve("group_story")
# tt.solve("mini_story")
# tt.solve("clear_special_task_power")
# tt.solve("scrimmage")
# tt.solve("rewarded_task")
Expand Down
17 changes: 7 additions & 10 deletions module/activities/AbydosResortRestorationCommittee.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -363,20 +364,16 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
img_possibles = {
"normal_task_task-info": (941, 411)
}
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -351,20 +352,14 @@ def to_formation_edit_i(self, i, lo, skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
13 changes: 4 additions & 9 deletions module/activities/SummerSkysWishes.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -368,20 +369,14 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"activity_task-info": (task_info_x[self.server],141),
Expand Down Expand Up @@ -362,22 +363,16 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
'purchase_ap_notice',
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {
"activity_task-info": (941, 411),
}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
'activity_fight-success-confirm': (640, 663),
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
"purchase_ap_notice": (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -370,20 +371,14 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self,None,None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
13 changes: 4 additions & 9 deletions module/activities/anUnconcealedHeart.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -356,20 +357,14 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "purchase_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
13 changes: 4 additions & 9 deletions module/activities/bunnyChaserOnTheShip.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -386,20 +387,14 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "buy_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
20 changes: 6 additions & 14 deletions module/activities/iveAlive.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
'activity_fight-success-confirm': (640, 663),
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
"purchase_ap_notice": (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"activity_task-info": (task_info_x[self.server],141),
Expand Down Expand Up @@ -365,23 +366,14 @@ def to_formation_edit_i(self, i, lo=(0, 0), skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {
"normal_task_task-info": (941, 411),
"activity_task-info": (941, 411),
}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "buy_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand Down
16 changes: 6 additions & 10 deletions module/activities/livelyAndJoyfulWalkingTour.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def to_activity(self, region, skip_first_screenshot=False, need_swipe=False):
'activity_fight-success-confirm': (640, 663),
"plot_menu": (1205, 34),
"plot_skip-plot-button": (1213, 116),
'purchase_ap_notice': (919, 168),
"purchase_ap_notice": (919, 168),
'purchase_ap_notice-localized': (919, 168),
"plot_skip-plot-notice": (766, 520),
"normal_task_help": (1017, 131),
"normal_task_task-info": task_info[self.server],
Expand Down Expand Up @@ -360,20 +361,14 @@ def to_formation_edit_i(self, i, lo, skip_first_screenshot=False):


def start_sweep(self, skip_first_screenshot=False):
rgb_ends = [
"purchase_ap_notice",
"start_sweep_notice",
]
rgb_possibles = {
"mission_info": (941, 411),
}
img_ends = [
"purchase_ap_notice",
"purchase_ap_notice-localized",
"normal_task_start-sweep-notice",
]
img_possibles = {"normal_task_task-info": (941, 411)}
res = picture.co_detect(self, rgb_ends, rgb_possibles, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice" or res == "buy_ap_notice":
res = picture.co_detect(self, None, None, img_ends, img_possibles, skip_first_screenshot)
if res == "purchase_ap_notice-localized" or res == "buy_ap_notice":
return "inadequate_ap"
rgb_ends = [
"skip_sweep_complete",
Expand All @@ -389,6 +384,7 @@ def start_sweep(self, skip_first_screenshot=False):
return "sweep_complete"



def calc_need_fight_stage(self):
for i in range(1, 6):
if image.compare_image(self, 'normal_task_SUB'):
Expand Down
Loading

0 comments on commit bbfde1c

Please sign in to comment.