1 Star 0 Fork 4

spitman/WoW_Fishing_Bot

forked from Q/WoW_Fishing_Bot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
wow_hijack.py 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
Q 提交于 2020-05-05 08:17 . init
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}"')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/spitman/WoW_Fishing_Bot.git
git@gitee.com:spitman/WoW_Fishing_Bot.git
spitman
WoW_Fishing_Bot
WoW_Fishing_Bot
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385