代码拉取完成,页面将自动刷新
同步操作将从 Q/WoW_Fishing_Bot 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import psutil
from pywinauto.application import Application
def check_process(process_names_list):
''' Searches for match in provided list against currently running processes.
ARGS: process_names_list (list)
RETURNS: running (Boolean) '''
print('[+] Checking for matching processes..')
running = False
# Check for process name match in wow_process_names
for pid in psutil.pids():
p = psutil.Process(pid)
#print(p.name())
if any(p.name() in s for s in process_names_list):
print(f'Found Instance: {p.name()}')
running = True
return running
def connect_app(path_to_app):
''' Connects to World of Warcraft instance at file location.
ARGS: path_to_app (Path to application on file system)
RETURNS: app (pywinauto.Application object) or None '''
try:
# Attach Python to World of Warcraft instance
app = Application().connect(path=path_to_app)
print(f'[+] Connected to application at:\n\t{path_to_app}')
except Exception as err: #(ProcessNotFound, AppNotConnected)
print(f'[!] Could not establish connection to \
{path_to_app}:\n\t{err}')
# If connection is successful, return app object
return app if app else None
def get_app_pos(app_object):
''' Retrieve the app left, top, right, and bottom edge coordinates.
ARGS: app_object (pywinauto.Application Object)
RETURNS: tuple(LEFT, TOP, RIGHT, BOTTOM) '''
position = app_object['魔兽世界'].rectangle()
return position
def press_key(app_object, hotkey):
''' Press desired hotkey(s) within an app instance.
ARGS: app_object (pywinauto.Application Object)
hotkey (string) '''
app_object.WorldOfWarcraft.type_keys(hotkey)
print(f'[+] Key(s) Pressed: "{hotkey}"')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。