python实现微信跳一跳辅助工具步骤详解

说明

1.windows上安装安卓模拟器,安卓版本5.1以上

2.模拟器里下载安装最新的微信6.6.1

3.最好使用python2.7,python3的pyhook包有bug,解决比较麻烦

步骤

1.windows上安装python2.7,配置好环境变量和pip

2.到这个网站下载对应版本的pyHook和pywin32

http://www.lfd.uci.edu/~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.桌面新建jump.py文件,复制以下内容

import pymouse, time, pyHook, pythoncom, math, random
m = pymouse.PyMouse()
global start_pos, end_pos
start_pos = None
end_pos = None
def onKeyboardEvent(event):
 global start_pos, end_pos
 if event.Key == 'Q':
  start_pos = m.position()
  print(start_pos)
 if event.Key == 'W':
  end_pos = m.position()
  print(end_pos)
 if event.Key == 'Space':
  if start_pos and end_pos:
   dis = int(math.sqrt(math.pow(start_pos[0]-end_pos[0],2)+math.pow(start_pos[1]-end_pos[1],2)))
   times = round((dis / 0.3) / 1000 , 3) 
   if dis < 500:
    print '>> ', dis, times
    x = random.randint(50, 400)
    y = random.randint(400, 700)
    m.press(x,y)
    time.sleep(times)
    m.release(x,y)
    start_pos = None
    end_pos = None
 return True
def main():
 hm = pyHook.HookManager()
 hm.KeyDown = onKeyboardEvent
 try:
  hm.HookKeyboard()
 except Exception as e:
  pass
 pythoncom.PumpMessages()
if __name__ == "__main__":
 main()

4.运行jump.py

python desktop\jump.py

5.使用说明

a.模拟器打开微信并进入跳一跳游戏界面
b.把模拟器放到桌面最左端
c.把鼠标放到紫色小人最下端中间点,按下Q键
d.把鼠标放到目标图形中心点,按下W键
e.按下空格键会自动跳到目标点
f.反复Q、W、空格键

如果空格点的坐标不准,自行调整一下代码里的坐标范围

ps:下面看下使用python进行微信跳一跳

1、Python2.79
2、安装pip
3、大家下载的时候把github上面的master zip全部下载下来。
4、下载adb,并添加到系统变量path里面
5、手机连接电脑,打开usb调试
6、打开cmd 运行auto.py

总结

相关推荐