diff --git a/main.py b/main.py index 25b3b89c2..7e0c90bb2 100644 --- a/main.py +++ b/main.py @@ -459,8 +459,6 @@ def init_ocr(self): self.logger.info("Test ocrCN : " + self.ocrCN.ocr_for_single_line(img_CN)['text']) elif self.server == 'Global': self.ocrEN = CnOcr(det_model_name="en_PP-OCRv3_det", rec_model_name='en_number_mobile_v2.0', - rec_model_fp='src/ocr_models/en_number_mobile_v2.0_rec_infer.onnx', - det_model_fp='src/ocr_models/en_PP-OCRv3_rec_infer.onnx', context='gpu') img_EN = cv2.imread('src/test_ocr/EN.png') self.logger.info("Test ocrEN : " + self.ocrEN.ocr_for_single_line(img_EN)['text']) @@ -598,7 +596,7 @@ def init_package_name(self): # # print(time.time()) t = Main() # t.thread_starter() - t.solve('lesson') + t.solve('scrimmage') t.flag_run = True # t.solve('de_clothes') # t.solve('common_shop') diff --git a/module/arena.py b/module/arena.py index 42aaa8b33..06d2a2241 100644 --- a/module/arena.py +++ b/module/arena.py @@ -39,8 +39,11 @@ def implement(self): ends = [ "attack_team_formation", ] - image.detect(self, 'arena_edit-force', {}, pre_func=color.detect_rgb_one_time, + if self.server == 'CN': + image.detect(self, 'arena_edit-force', {}, pre_func=color.detect_rgb_one_time, pre_argv=(self, click_pos, los, ends)) + elif self.server == 'Global': + color.common_rgb_detect_method(self, click_pos, los, ends) res = check_skip_button(self.latest_img_array, self.server) if res == "OFF": self.logger.info("TURN ON SKIP") diff --git a/module/cafe_reward.py b/module/cafe_reward.py index af1633bd7..55ffcc928 100644 --- a/module/cafe_reward.py +++ b/module/cafe_reward.py @@ -20,6 +20,7 @@ def implement(self): if self.server == "CN": cn_implement(self) elif self.server == "Global": + time.sleep(1) global_implement(self) return True @@ -102,6 +103,7 @@ def cn_implement(self): def global_implement(self): + self.latest_img_array = self.get_screenshot_array() op = np.full(2, False, dtype=bool) op[0] = get_invitation_ticket_status(self) op[1] = get_cafe_earning_status1(self) diff --git a/module/collect_daily_power.py b/module/collect_daily_power.py index 151747352..3c00ca607 100644 --- a/module/collect_daily_power.py +++ b/module/collect_daily_power.py @@ -55,7 +55,8 @@ def to_tasks(self): color.common_rgb_detect_method(self, click_pos, los, ends) elif self.server == "CN": possibles = { - "main_page_home-feature": (70, 232, 3) + "main_page_home-feature": (70, 232), + 'main_page_full-notice': (887, 165), } image.detect(self, "work_task_menu", possibles) diff --git a/module/common_shop.py b/module/common_shop.py index 50a5135d6..88b9d6506 100644 --- a/module/common_shop.py +++ b/module/common_shop.py @@ -64,7 +64,7 @@ def implement(self): if self.server == 'CN': pass elif self.server == 'Global': - self.logger.info("asset_required : ", asset_required) + self.logger.info("asset_required : " + str(asset_required)) if asset_required > creditpoints != -1: self.logger.info("INADEQUATE assets for BUYING") return True diff --git a/module/hard_task.py b/module/hard_task.py index d62a1e31d..e4ff0f785 100644 --- a/module/hard_task.py +++ b/module/hard_task.py @@ -8,7 +8,8 @@ def read_task(self, task_string): try: region = 0 mainline_available_missions = [1, 2, 3] - mainline_available_regions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + mainline_available_regions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, ] for i in range(0, len(task_string)): if task_string[i].isdigit(): region = region * 10 + int(task_string[i]) @@ -140,7 +141,7 @@ def to_hard_event(self): elif self.server == 'Global': click_pos = [ [1077, 98], - [805, 165], + [1186, 165], [1198, 580], [823, 261], [640, 116], @@ -153,7 +154,7 @@ def to_hard_event(self): ] los = [ "sweep_complete", - "event_hard", + "event_normal", "main_page", "campaign", "reward_acquired", @@ -164,7 +165,7 @@ def to_hard_event(self): "unlock_notice", ] ends = [ - "event_normal", + "event_hard", ] color.common_rgb_detect_method(self, click_pos, los, ends) @@ -188,7 +189,7 @@ def to_task_info(self, x, y): [x, y], ] los = [ - "event_normal" + "event_hard" ] ends = [ "mission_info", diff --git a/module/normal_task.py b/module/normal_task.py index 7741a519d..7e0c6e22f 100644 --- a/module/normal_task.py +++ b/module/normal_task.py @@ -37,7 +37,7 @@ def read_task(self, task_string): try: region = 0 mainline_available_missions = [1, 2, 3, 4, 5] - mainline_available_regions = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + mainline_available_regions = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] for i in range(0, len(task_string)): if task_string[i].isdigit(): region = region * 10 + int(task_string[i]) diff --git a/module/rewarded_task.py b/module/rewarded_task.py index 06e6a4cc0..8861007c5 100644 --- a/module/rewarded_task.py +++ b/module/rewarded_task.py @@ -23,7 +23,7 @@ def implement(self): return True if self.server == 'Global': - buy_ticket_times = min(0, self.config['purchase_bounty_ticket_times']) # ** 购买悬赏委托券的次数 + buy_ticket_times = min(0, self.config['purchase_rewarded_task_ticket_times']) # ** 购买悬赏委托券的次数 if buy_ticket_times > 0: to_choose_bounty(self) purchase_bounty_ticket(self, buy_ticket_times) diff --git a/module/scrimmage.py b/module/scrimmage.py index 5538de72a..2cc613905 100644 --- a/module/scrimmage.py +++ b/module/scrimmage.py @@ -56,7 +56,7 @@ def scrimmage_common_operation(self, a, b): click_pos[0][1] = los[i] color.common_rgb_detect_method(self, click_pos, pd_los, ends) t = color.check_sweep_availability(self.latest_img_array, server=self.server) - if t == "AVAILABLE": + if t == "sss": if b == "max": self.click(1085, 300) time.sleep(1) @@ -69,7 +69,7 @@ def scrimmage_common_operation(self, a, b): return "sweep_complete" if res == "purchase_ap_notice": return "inadequate_ap" - elif t == "UNAVAILABLE": + elif t == "no-pass" or t == "pass": to_scrimmage(self, a) return True diff --git a/module/tactical_challenge_shop.py b/module/tactical_challenge_shop.py index 835064e74..48ea3b3e8 100644 --- a/module/tactical_challenge_shop.py +++ b/module/tactical_challenge_shop.py @@ -14,6 +14,7 @@ def implement(self): [700, 204], [857, 204], [1000, 204], [1162, 204], [700, 461], [857, 461], [1000, 461], [1162, 461] ] + buy_list = np.array(self.config["TacticalChallengeShopList"]) if self.server == 'CN': price = np.array([ 50, 50, 50, 15, @@ -26,7 +27,6 @@ def implement(self): 50, 15, 30, 5, 25, 60, 100, 4, 20, 60, 100], dtype=int) - buy_list = np.array(self.config["TacticalChallengeShopList"]) if buy_list.shape != price.shape: self.logger.error("buy_list and price shape not match") return True @@ -109,7 +109,7 @@ def to_tactical_challenge_shop(self): elif self.server == 'Global': click_pos = [ [796, 653], # main_page - [160, 456], # common shop + [160, 531], # common shop [922, 192], # buy notice bright [922, 192], # buy notice grey [886, 213], # shop refresh guide diff --git a/src/rgb_feature/rgb_feature_Global.json b/src/rgb_feature/rgb_feature_Global.json index 463713e56..a7c835b02 100644 --- a/src/rgb_feature/rgb_feature_Global.json +++ b/src/rgb_feature/rgb_feature_Global.json @@ -26,7 +26,7 @@ "club":[[[1130,668],[64,42],[240,668]],[[109,129,211,231,245,255],[60,80,89,109,142,162],[109,129,211,231,245,255]]], "momotalk2":[[[172, 283], [181, 283], [163, 305]],[[245, 255, 245, 255, 245, 255], [245, 255, 245, 255, 245, 255], [93, 113, 110, 130, 131, 151]]], "momotalk1":[[[170, 195], [197, 201], [142, 197]],[[245, 255, 245, 255, 245, 255], [93, 113, 110, 130, 131, 151], [93, 113, 110, 130, 131, 151]]], - "tactical_challenge_shop":[[[172, 135], [1123,657], [170, 216],[17,456],[641,664]],[[245,255,245,255,245,255], [35,55,60,80,89,109], [245,255,245,255,245,255],[35,55,60,80,89,109],[0,10,117,137,199,219]]], + "tactical_challenge_shop":[[[172, 135], [1123,657], [170, 216],[17,522],[641,664]],[[245,255,245,255,245,255], [35,55,60,80,89,109], [245,255,245,255,245,255],[35,55,60,80,89,109],[0,10,117,137,199,219]]], "common_shop":[[[172, 135], [1123,657], [170, 216],[17,456],[641,664]],[[35,55,60,80,89,109], [35,55,60,80,89,109], [245,255,245,255,245,255],[245,255,245,255,245,255],[0,10,117,137,199,219]]], "shop_buy_notice_bright":[[[691,487],[845,476],[586,381],[733,380],[457,332],[806,329],[607,186],[898,174]],[[235,255,222,242,64,84],[235,255,222,242,64,84],[53,73,73,93,95,115],[53,73,73,93,95,115],[229,249,229,249,229,249],[229,249,229,249,229,249],[35,55,60,80,89,109],[35,55,60,80,89,109]]], "shop_refresh_guide":[[[691, 466], [839, 466], [886,210], [589,373],[712,371],[476,357]],[[235,255,222,242,64,84],[235,255,222,242,64,84],[5,25,23,43,54,74],[55,75,72,92,95,115],[55,75,72,92,95,115],[229,249,229,249,229,249]]],