说明
上安装安卓模拟器,安卓版本5.1以上
2.模拟器里下载安装最新的微信6.6.1
3.最好使用python2.7,python3的pyhook包有bug,解决比较麻烦
步骤
上安装python2.7,配置好环境变量和pip
2.到这个网站下载对应版本的pyHook和pywin32
/~gohlke/pythonlibs
2.打开cmd,安装下载好的whl文件和其他库
pip install pywin32-221-cp27-cp27m-win_amd64.whl
pip install pyHook-1.5.1-cp27-cp27m-win_amd64.whl
pip install pyuserinput
3.桌面新建文件,复制以下内容
import pymouse, time, pyHook, pythoncom, math, random
m = ()
global start_pos, end_pos
start_pos = None
end_pos = None
def onKeyboardEvent(event):
global start_pos, end_pos
if == 'Q':
start_pos = ()
print(start_pos)
if == 'W':
end_pos = ()
print(end_pos)
if == 'Space':
if start_pos and end_pos:
dis = int(((start_pos[0]-end_pos[0],2)+(start_pos[1]-end_pos[1],2)))
times = round((dis / 0.3) / 1000 , 3)
if dis < 500:
print '>> ', dis, times
x = (50, 400)
y = (400, 700)
(x,y)
(times)
(x,y)
start_pos = None
end_pos = None
return True
def main():
hm = ()
= onKeyboardEvent
try:
()
except Exception as e:
pass
()
if __name__ == "__main__":
main()
4.运行
python desktop\
5.使用说明
a.模拟器打开微信并进入跳一跳游戏界面
b.把模拟器放到桌面最左端
c.把鼠标放到紫色小人最下端中间点,按下Q键
d.把鼠标放到目标图形中心点,按下W键
e.按下空格键会自动跳到目标点
f.反复Q、W、空格键
如果空格点的坐标不准,自行调整一下代码里的坐标范围