Пример #1
0
 def runBattleFieldScript(self):
     self.switchPlayerBattleFieldStatus()
     if self.player_battle_filed_status in [
             PlayerBattleFieldStatus.new_to_hall,
             PlayerBattleFieldStatus.queueing_in_hall
     ]:
         print(f'大厅很安逸,交交牌子排排队,当前状态为{self.player_battle_filed_status}')
         self.run_json_list(self.join_queue_scripts)
         longRest(18)  # 延迟30秒,本轮结束
     else:
         print('哟,在战场呢')
         self.playInBattlefield()
         self.player_battle_filed_status = PlayerBattleFieldStatus.play_in_battlefield
Пример #2
0
 def playInBattlefield(self):
     alive = self.player.checkAlive()
     if alive:
         print('运气不错,活着')
         if self.player_battle_filed_status == PlayerBattleFieldStatus.new_to_battlefield:
             print('新场,等一下')
             self.run_json_list(self.script_json['standby_scripts'])
         else:
             print('执行战场挂机跑动')
             self.run_json_list(self.script_json['main_scripts'])
     else:
         print('死鬼别动,小心灵魂被风吹散')
         keybdAct.press("spacebar")
         longRest(15)
Пример #3
0
 def openDoor(self):
     (x, y) = self.window.getBtnPos('gnomeregan_door')
     keybdAct.press('`')
     longRest(3)
     keybdAct.press('s', 0.15)
     win32api.SetCursorPos((x, y))
     shortRest(2)
     win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN, x, y, 0,
                          0)  # 鼠标左键按下
     shortRest(0.05)
     win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTUP, x, y, 0,
                          0)  # 鼠标左键弹起
     shortRest(5)
     win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN, x, y, 0,
                          0)  # 鼠标左键按下
     shortRest(0.05)
     win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTUP, x, y, 0,
                          0)  # 鼠标左键弹起
Пример #4
0
 def runWaitBuffScript(self):
     for buff, time_set in self.enableBuffDict.items():
         if time_set[1] == 0:
             if self.player.checkBuff(buff):
                 if time_set[0] == 120:
                     self.cancelAutoRelogon()
                     self.loop_running = False
                     self.player.logout()
                     return
                 else:
                     time_set[1] = time.time() + (120 - time_set[0]) * 60
         else:
             if time.time() > time_set[1]:
                 self.cancelAutoRelogon()
                 self.loop_running = False
                 self.player.logout()
                 return
     # 执行一些无谓的操作,防止掉线
     self.run_json_list(self.script_json['main_scripts'])
     longRest(60)
Пример #5
0
    def postHonormark(self, battlefield):
        # 需要提供战场名称,alx or warsong。
        btn_name = None
        if battlefield == "arathi" or battlefield == "ALX":
            btn_name = "arathi_honormark_btn"
        elif battlefield == "warsong" or battlefield == "ZG":
            btn_name = "warsong_honormark_btn"
        elif battlefield == "alteric" or battlefield == "AS":
            btn_name = "alteric_honormark_btn"
        else:
            raise Exception("战场名称不对")

        # 选择要交的章
        (x1, y1) = self.window.getBtnPos(btn_name)
        win32api.SetCursorPos((x1, y1))
        shortRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x1, y1, 0,
                             0)  # 鼠标左键按下
        shortRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x1, y1, 0,
                             0)  # 鼠标左键弹起
        longRest()

        # 交章
        (x2, y2) = self.window.getBtnPos('post_honormark_btn')
        win32api.SetCursorPos((x2, y2))
        shortRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x2, y2, 0,
                             0)  # 鼠标左键按下
        shortRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x2, y2, 0,
                             0)  # 鼠标左键弹起
        longRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x2, y2, 0,
                             0)  # 鼠标左键按下
        shortRest()
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x2, y2, 0,
                             0)  # 鼠标左键弹起
        shortRest()
Пример #6
0
    def reLogon(self):
        # 先离线关闭
        is_wow_window_alive = True
        while is_wow_window_alive:
            self.window.focus_on_window()
            longRest()
            keybdAct.pressHoldRelease('alt', 'F4')
            longRest()
            self.window.getWowWindow()
            is_wow_window_alive = self.window.window != None

        print("关闭所有wow窗口")

        # 再登陆
        while not is_wow_window_alive:
            laucher = self.window.getLaucherWindow()
            self.window.focus_on_window(laucher)
            longRest()
            keybdAct.press('enter')
            print("从登陆器执行了登录")

            longRest(30)
            self.window.getWowWindow()
            is_wow_window_alive = self.window.window != None
        # 检查是否登录到了人物选择页面,如果没有就等待,可能是排队了
        # 取消掉是否登录到游戏人物界面检验,因为是断线重连
        # is_in_player_select = self.checkInPlaySelectStatus()
        # _time = 30
        # while not is_in_player_select:
        #     longRest(_time)
        #     if _time < 60*5:
        #         _time += 30
        #     is_in_player_select = self.checkInPlaySelectStatus()

        keybdAct.press('enter')
        print("登录游戏")
        longRest(20)
Пример #7
0
 def joinQueueIfNewEnterHall(self):
     if self.player_battle_filed_status == PlayerBattleFieldStatus.new_to_hall:
         keybdAct.press(self.player.tarQueueNpc)
         longRest()
         keybdAct.press(self.player.tarQueueNpc)
         longRest()
Пример #8
0
 def postHonormarkIfNewEnterHall(self):
     if self.player_battle_filed_status == PlayerBattleFieldStatus.new_to_hall:
         self.player.postHonormark(self.battlefield)
         longRest()
Пример #9
0
 def refresh(self):
     self.player.refreshWindow()
     longRest()
     self.player.reSelectBtnBar()
Пример #10
0
 def avoid_afk(self):
     # 防止掉线
     r = random.randint(0, 7)
     keybdAct.press("spacebar")
     print('嗯,跳一跳,地好烫')
     longRest()
Пример #11
0
    def jump_continue(self, t=10):
        keybdAct.pressAndHold('w', 'a')
        shortRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.press('spacebar')
        shortRest()
        keybdAct.release('w', 'a')

        longRest()

        keybdAct.pressAndHold('w', 'd')
        shortRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.press('spacebar')
        shortRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.press('spacebar')
        longRest()
        keybdAct.release('w', 'd')
Пример #12
0
 def clickReloadBtn(self):
     keybdAct.press(self.reloadBtn)
     longRest(10)