コード例 #1
0
    def alchemy(self):
        if langrisser.is_alchemy() == 1:
            print('in alchemy')
            for n5 in range(5):
                for i in range(5):
                    for j in range(4):
                        langrisser.click(520 + j * 90, 240 + i * 90)
                        langrisser.wait_rand(0.2)

                langrisser.drag(520, 600, 520, 340)
                langrisser.drag(520, 600, 520, 340)
                langrisser.wait_rand(1.0)

        self.b_alchemy.config(state=tk.NORMAL)
コード例 #2
0
    def buy_voucher(self):
        if langrisser.is_store() == 1:
            langrisser.click(500, 130)
            for i in range(self.intv_num_f_voucher.get()):
                langrisser.wait_rand(1.0)
                langrisser.click(200, 250)
                langrisser.wait_rand(1.0)
                langrisser.click(479, 492)
                langrisser.wait_rand(1.0)
                langrisser.click(500, 700)

        self.b_buy_f_voucher.config(state=tk.NORMAL)
コード例 #3
0
    def buy_middle(self):
        if langrisser.is_store() == 1:
            langrisser.click(640, 130)
            x_middle = [280, 395, 510, 625, 740]
            y_middle = [330, 440, 550]
            xxm1 = x_middle[self.c_special_enhancement_type.current() % 5]
            yym1 = y_middle[int(self.c_special_enhancement_type.current() / 5)]

            for i in range(self.intv_num_f_voucher.get()):
                langrisser.wait_rand(1.0)
                langrisser.click(765, 240)
                langrisser.wait_rand(1.0)
                langrisser.click(xxm1, yym1)
                langrisser.wait_rand(1.0)
                langrisser.click(515, 480)
                langrisser.wait_rand(1.0)
                langrisser.click(750, 250)

        self.b_buy_middle.config(state=tk.NORMAL)
コード例 #4
0
    def main_loop(self, task_in_mainloop, level_in_mainloop):
        time.sleep(1)
        print('while begin')
        self.run_sign = 1
        if self.close_sign == 1:
            self.log_message.set('忠告:你点击了停止按钮, 这波分析完就停')
            print('stop button pressed, stop')
            self.run_sign = 0
            self.b_start.config(state=tk.NORMAL)
            langrisser.cancel_top_most()
            return -1

        t1 = time.time()
        self.stage = langrisser.cdll_determine_stage()
        t2 = time.time()
        print('time determine: ', t2 - t1)

        self.text_stage.set('当前状态:' + str(self.stage))
        self.text_currentham.set('汉堡数目,当前/目标总数:' + str(self.num_ham) + '/' +
                                 str(self.intv_max_ham.get()))

        if self.stage == 100:
            langrisser.click(970, 286)

        elif self.stage in [351, 352, 353, 451, 452, 453, 551, 552, 553]:
            langrisser.click(645, 355)

        elif self.stage == 1:
            print('event map')
            if self.intv_solo_var.get() == 1:
                # langrisser.solo_event(self.c_project.current(), self.c_level.current())
                langrisser.solo_event(self.c_project.current(),
                                      int(self.strv_level.get()))

            elif self.intv_solo_var.get() == 0:
                langrisser.click(965, 715)  # enter team play

        elif self.stage == 91 or self.stage == 92 or self.stage == 93 or self.stage == 95:
            if self.c_is_event.current() == 1:
                langrisser.click(965, 715)  # enter team play
            else:
                gym_all = ['剑士', '弓手', '枪兵', '飞水', '骑兵', '魔法']
                if self.intv_solo_var.get() == 1:
                    y_gym = [220, 300, 380, 460, 540, 620]
                    langrisser.click(
                        200, y_gym[gym_all.index(self.strv_project.get())])
                    langrisser.drag(440, 660, 440, 300)
                    langrisser.wait_rand(0.5)
                    langrisser.drag(440, 660, 440, 300)
                    langrisser.wait_rand(0.5)
                    x_solo = 850
                    y_solo = [680, 540, 400, 260, 120]
                    langrisser.click(x_solo, y_solo[self.c_level.current()])
                else:
                    langrisser.click(965, 715)  # enter team play
        elif self.stage == 94:  # 宝藏
            langrisser.click(966, 670)
            langrisser.wait_rand(0.5)

        elif self.stage == 90:  # 组队
            print('index project, level:', self.c_project.current(),
                  self.c_level.current())
            if self.c_is_event.current() == 1:
                langrisser.event_training(task_in_mainloop,
                                          int(self.strv_level.get()))
            if self.c_is_event.current() == 0:
                langrisser.training(task_in_mainloop, level_in_mainloop)
            self.current_task = [
                self.c_project.current(),
                self.c_level.current()
            ]
            langrisser.wait_rand(4)
        elif self.stage == 2:  # press "出击"
            langrisser.click(955, 705)
            langrisser.wait_rand(1)
        elif self.stage == 3:
            print('stage3, checking c_crystal_buy_stamina.current: %d' %
                  self.c_crystal_buy_stamina.current())
            if self.c_crystal_buy_stamina.current() >= 1:
                if langrisser.is_40_crystal_buy() == 1:
                    langrisser.click(608, 466)
                    return 0
            if self.c_crystal_buy_stamina.current() >= 2:
                if langrisser.is_60_crystal_buy() == 1:
                    langrisser.click(608, 466)
                    return 0
            if self.c_crystal_buy_stamina.current() >= 3:
                if langrisser.is_100_crystal_buy() == 1:
                    langrisser.click(608, 466)
                    return 0

            if self.num_ham >= self.intv_max_ham.get():
                self.log_message.set('忠告:' + '够数啦,停了')
                self.b_start.config(state=tk.NORMAL)
                return 3

            langrisser.click(418, 462)  # eat a hamberger
            langrisser.wait_rand(1)
            if langrisser.is_imfull() == 1:
                langrisser.click(889, 312)  # click to close the "full" stage
                langrisser.wait_rand(2.2)
                self.num_ham += 1
                langrisser.auto_team()  # click auto team
                langrisser.wait_rand(3)
        elif self.stage == 4:  # fighting
            langrisser.wait_rand(10)
        elif self.stage == 5:  # victory
            langrisser.click(1000, 57)
            langrisser.wait_rand(1)
            langrisser.window_capture(langrisser.dir_tmp_pic + '43_tmp.bmp',
                                      31, 567, 144, 608)
            rms_dd = langrisser.rms_difference(
                langrisser.dir_tmp_pic + '43_tmp.bmp',
                langrisser.dir_solid_pic + '43_redo.bmp')
            if rms_dd < 20:
                tt_str = datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S')
                langrisser.window_capture(
                    langrisser.dir_harvest + tt_str + r'.bmp', 0, 0, 1024, 768)
                langrisser.wait_rand(1)
                langrisser.click(90, 586)
                return 0

            langrisser.click(1000, 57)
            langrisser.wait_rand(2)
            tt_str = datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S')
            langrisser.window_capture(
                langrisser.dir_harvest + tt_str + r'.bmp', 0, 0, 1024, 768)
            langrisser.wait_rand(1)
            for i in range(4):
                langrisser.click(1000, 57)
                langrisser.wait_rand(2)
            return 5

        elif self.stage == 6:
            for i in range(3 + int(random.random() * 5)):
                langrisser.click(967, 233)
                langrisser.wait_rand(1)
        elif self.stage == 7:
            langrisser.click(140, 300)
        elif self.stage == 11:
            langrisser.click(500, 150)
        elif self.stage == 12:
            langrisser.wait_rand(3)
        elif self.stage == 15:
            for i in range(7):
                langrisser.wait_rand(2)
                langrisser.click(1000, 407)
        elif self.stage == 17:
            langrisser.click(430, 471)
        elif self.stage == 18:
            langrisser.click(174, 584)

        if self.stage == 0:
            self.num_debug += 1
            if self.num_debug > 20:
                self.num_debug = 0
                langrisser.wait_rand(1)
                langrisser.click(1000, 407)

        if langrisser.is_cancel_team() == 1:
            langrisser.click(429, 470)

        langrisser.wait_rand(1)
        return 0
コード例 #5
0
    def click_50(self):
        for i in range(50):
            langrisser.click(1000, 57)
            langrisser.wait_rand(0.6)

        self.b_click_50.config(state=tk.NORMAL)
コード例 #6
0
    def drill(self):
        if langrisser.is_drill() == 1:
            print('in drill')

            if langrisser.get_complete() == 3:
                langrisser.click(781, 281)  # get 1st
                langrisser.wait_rand(2.0)
                langrisser.click(700, 700)
                langrisser.wait_rand(1.5)
                langrisser.click(781, 437)  # get 2nd
                langrisser.wait_rand(2.0)
                langrisser.click(700, 700)
                langrisser.wait_rand(1.5)
                langrisser.click(781, 590)  # get 3rd
                langrisser.wait_rand(2.0)
                langrisser.click(700, 700)
                langrisser.wait_rand(1.5)
                langrisser.wait_rand(1.5)

            if langrisser.get_empty() == 3:
                print('empty and then drill')
                langrisser.click(781, 281)  # entrust 1st
                langrisser.wait_rand(1.4)
                langrisser.click(833, 511)  # 8 hour
                langrisser.wait_rand(0.8)
                langrisser.click(316, 244)  # click +
                langrisser.wait_rand(0.8)
                langrisser.click(363, 263)  # click 1
                langrisser.wait_rand(0.8)
                langrisser.click(668, 416)  # click 8
                langrisser.wait_rand(0.8)
                langrisser.click(363, 548)  # click 9
                langrisser.wait_rand(0.8)
                langrisser.click(633, 629)  # click ok
                langrisser.wait_rand(0.8)
                langrisser.click(665, 615)  # click ok
                langrisser.wait_rand(3.0)
                # 2
                langrisser.click(781, 437)  # entrust 2nd
                langrisser.wait_rand(0.8)
                langrisser.click(833, 511)  # 8 hour
                langrisser.wait_rand(0.8)
                langrisser.click(316, 244)  # click +
                langrisser.wait_rand(0.8)
                langrisser.click(465, 263)  # click 1
                langrisser.wait_rand(0.8)
                langrisser.click(460, 412)  # click 6
                langrisser.wait_rand(0.8)
                langrisser.click(559, 416)  # click 7
                langrisser.wait_rand(0.8)
                langrisser.click(633, 629)  # click ok
                langrisser.wait_rand(0.8)
                langrisser.click(665, 615)  # click ok
                langrisser.wait_rand(3.0)
                # 3
                langrisser.click(781, 590)  # entrust 3rd
                langrisser.wait_rand(0.8)
                langrisser.click(833, 511)  # 8 hour
                langrisser.wait_rand(0.8)
                langrisser.click(316, 244)  # click +
                langrisser.wait_rand(0.8)
                langrisser.click(560, 263)  # click 3
                langrisser.wait_rand(0.8)
                langrisser.click(659, 263)  # click 4
                langrisser.wait_rand(0.8)
                langrisser.click(367, 412)  # click 5
                langrisser.wait_rand(0.8)
                langrisser.click(633, 629)  # click ok
                langrisser.wait_rand(0.8)
                langrisser.click(665, 615)  # click ok
                langrisser.wait_rand(3.0)
        self.b_drill.config(state=tk.NORMAL)