コード例 #1
0
ファイル: XinHai.py プロジェクト: tobin4j/tScripts
    def task_process(self):
        game = self.game_win
        level = self.level
        pre_val = 0
        count = 0
        complete_count = 0
        # 前置点击
        game.click(820, 563)
        sleep(Sleep.SHORT.value)
        game.click(967, 285)
        sleep(Sleep.SHORT.value)

        if level in range(1, 10, 2):
            level_pos_x = 200
        else:
            level_pos_x = 471

        if level in (1, 2):
            level_pos_y = 192
        elif level in (3, 4):
            level_pos_y = 283
        elif level in (5, 6):
            level_pos_y = 372
        else:
            level_pos_y = 463

        if level in (9, 10):
            game.draw(204, 451, 204, 90)
        game.click(level_pos_x, level_pos_y)
        sleep(Sleep.SHORT.value)
        game.click(882, 493)
        sleep(Sleep.LONG.value)
        game.continue_click()
        # 开始循环
        while complete_count < self.loop_count:
            img = game.screen_img(749, 155, 852, 230)
            origin_img = Image.open('origin_qianchen.png')
            same_value = image_same_val(img, origin_img)
            if pre_val == same_value:
                count += 1
            else:
                count = 0
            pre_val = same_value
            if count > 3:
                game.continue_click()
            if same_value < 5:
                complete_count += 1
                print(self.task_name, "--已刷:", complete_count, "次")
                game.continue_click()
                if complete_count == self.loop_count:
                    return

                sleep(Sleep.MIDDLE.value)
                game.continue_click()
                sleep(Sleep.MIDDLE_LONG.value)
                game.continue_click()
                sleep(Sleep.MIDDLE_LONG.value)
                game.continue_click()
                sleep(Sleep.MIDDLE.value)
            sleep(Sleep.LONG.value)
コード例 #2
0
 def task_process(self):
     game = self.game_win
     role_type = self.role_type
     pre_val = 0
     count = 0
     complete_count = 0
     # 前置点击
     game.click(820, 563)
     sleep(Sleep.SHORT.value)
     game.draw(963, 265, 10, 265)
     game.click(830, 280)
     if role_type in (1, 2, 3):
         role_pos_x = 280
     else:
         role_pos_x = 640
     if role_type in (1, 4):
         role_pos_y = 200
     elif role_type in (2, 5):
         role_pos_y = 334
     else:
         role_pos_y = 453
     sleep(Sleep.SHORT.value)
     game.click(role_pos_x, role_pos_y)
     sleep(Sleep.MIDDLE.value)
     game.draw(727, 450, 727, 30)
     sleep(Sleep.MIDDLE.value)
     if role_type == 1:
         game.click(727, 315)
     else:
         game.click(727, 430)
     game.click(800, 550)
     sleep(Sleep.LONG.value)
     game.continue_click()
     # 开始循环
     while complete_count < self.loop_count:
         img = game.screen_img(749, 155, 852, 230)
         origin_img = Image.open('origin_qianchen.png')
         same_value = image_same_val(img, origin_img)
         if pre_val == same_value:
             count += 1
         else:
             count = 0
         pre_val = same_value
         if count > 3:
             game.continue_click()
         if same_value < 5:
             complete_count += 1
             print("--前尘幻境--已刷:", complete_count, "次")
             game.continue_click()
             if complete_count == self.loop_count:
                 return
             sleep(Sleep.MIDDLE.value)
             game.continue_click()
             sleep(Sleep.MIDDLE_LONG.value)
             game.continue_click()
             sleep(Sleep.MIDDLE_LONG.value)
             game.continue_click()
             sleep(Sleep.MIDDLE.value)
         sleep(Sleep.LONG.value)
コード例 #3
0
 def task_process(self):
     game = self.game_win
     game.click(820, 563)
     sleep(Sleep.SHORT.value)
     game.click(412, 272)
     sleep(Sleep.MIDDLE.value)
     game.click(775, 287)
     sleep(Sleep.MIDDLE_LONG.value)
     game.click(775, 287)
     game.draw(761, 479, 750, 47)
     sleep(Sleep.SHORT.value)
     game.draw(761, 479, 750, 47)
     sleep(Sleep.SHORT.value)
     game.draw(761, 479, 750, 47)
     sleep(Sleep.SHORT.value)
     game.click(776, 507)
     sleep(Sleep.LONG.value)
     game.continue_click()
     # 开始循环
     pre_val = 0
     count = 0
     complete_count = 0
     while complete_count < 15:
         img = game.screen_img(425, 182, 600, 197)
         origin_img = Image.open('origin_jidian.png')
         same_value = image_same_val(img, origin_img)
         if pre_val == same_value:
             count += 1
         else:
             count = 0
         pre_val = same_value
         if count > 2:
             game.continue_click()
         if same_value < 5:
             complete_count += 1
             print(self.task_name, "--已刷:", complete_count, "次")
             game.continue_click()
             sleep(Sleep.MIDDLE.value)
             game.continue_click()
             sleep(Sleep.MIDDLE_LONG.value)
             game.continue_click()
             sleep(Sleep.MIDDLE_LONG.value)
             game.continue_click()
             sleep(Sleep.SHORT.value)
             game.continue_click()
             sleep(Sleep.MIDDLE.value)
             game.continue_click()
         sleep(Sleep.LONG.value)
コード例 #4
0
    def task_process(self):
        game = self.game_win
        game.click(820, 563)
        sleep(Sleep.SHORT.value)
        game.click(120, 272)
        sleep(Sleep.MIDDLE.value)
        # 冗余
        game.draw(879, 319, 10, 319)
        sleep(Sleep.SHORT.value)
        game.click(813, 297)

        sleep(Sleep.MIDDLE.value)
        game.draw(707, 435, 707, 50)
        sleep(Sleep.MIDDLE.value)
        game.click(700, 425)
        game.click(750, 533)
        sleep(Sleep.LONG.value)
        game.continue_click()
        # 开始循环
        pre_val = 0
        count = 0
        complete_count = 0
        while complete_count < 3:
            img = game.screen_img(749, 155, 852, 230)
            origin_img = Image.open('origin_qianchen.png')
            same_value = image_same_val(img, origin_img)
            if pre_val == same_value:
                count += 1
            else:
                count = 0
            pre_val = same_value
            if count > 2:
                game.continue_click()
            if same_value < 5:
                complete_count += 1
                print("--疾之境界--已刷:", complete_count, "次")
                game.continue_click()
                sleep(Sleep.MIDDLE.value)
                game.continue_click()
                sleep(Sleep.MIDDLE_LONG.value)
                game.continue_click()
                sleep(Sleep.MIDDLE_LONG.value)
                game.continue_click()
                sleep(Sleep.MIDDLE.value)
            sleep(Sleep.LONG.value)
コード例 #5
0
    def task_process(self):
        game = self.game_win
        print(self.task_name, "start...")
        pre_val = 0
        count = 0
        complete_count = 2
        # 前置点击
        game.click(820, 563)
        sleep(Sleep.SHORT.value)
        game.draw(963, 265, 10, 265)
        game.click(553, 276)
        sleep(Sleep.SHORT.value)
        game.click(880, 537)
        sleep(Sleep.LONG.value)
        game.continue_click()

        while complete_count < 9:
            img = game.screen_img(759, 169, 834, 207)
            origin_img = Image.open('shouchao.png')
            same_value = image_same_val(img, origin_img)
            if pre_val == same_value:
                count += 1
            else:
                count = 0
            pre_val = same_value
            if count > 2:
                game.continue_click()
            if same_value < 5:
                complete_count += 1
                print(self.task_name, "--已刷:", complete_count, "次")
                game.continue_click()
                sleep(Sleep.SHORT.value)
                game.continue_click()
                sleep(Sleep.MIDDLE.value)
                if complete_count % 3 == 0:
                    game.click(458, 327)
                    sleep(Sleep.SHORT.value)
                game.click(882, 538)
                sleep(Sleep.MIDDLE_LONG.value)
                game.continue_click()
            sleep(Sleep.LONG.value)