python版微信跳一跳游戏辅助


Posted in Python onJanuary 11, 2018

本文实例为大家分享了微信跳一跳游戏辅助python代码,供大家参考,具体内容如下

import os
import PIL
import numpy
import matplotlib

matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
import time

from matplotlib.animation import FuncAnimation

# 是否需要进行图片更新
need_update = True

def get_screen_image():
 # 截取手机当前图片
 os.system('adb shell screencap -p /sdcard/screen.png')
 # 拉取到PC端
 os.system('adb pull /sdcard/screen.png')
 # 将图像转成数组返回
 return numpy.array(PIL.Image.open('screen.png'))


def jump_to_next(point1, point2):
 x1, y1 = point1;
 x2, y2 = point2
 distance = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
 # 计算按压指令和按压时长
 os.system("adb shell input touchscreen swipe 320 410 320 410 %d" % (distance * 1.35))


def on_clack(event, coor=[]):
 global need_update
 coor.append((event.xdata, event.ydata))
 if len(coor) == 2:
 # 执行跳步指令
 jump_to_next(coor.pop(), coor.pop())
 # 进行图片刷新
 need_update = True


def update_screen(frame):
 global need_update
 if need_update:
 time.sleep(2)
 axes_image.set_array(get_screen_image())
 # 已刷新,设置为false
 need_update = False
 return axes_image,


figure = plt.figure()
axes_image = plt.imshow(get_screen_image(), animated=True)
figure.canvas.mpl_connect('button_press_event', on_clack)
# 定时更新
ani = FuncAnimation(figure, update_screen, interval=50, blit=True)
plt.show()

python版微信跳一跳游戏辅助

更多内容大家可以参考专题《微信跳一跳》进行学习。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Python 相关文章推荐
Python中自定义函数的教程
Apr 27 Python
python微信公众号开发简单流程
Mar 23 Python
在python中只选取列表中某一纵列的方法
Nov 28 Python
Django管理员账号和密码忘记的完美解决方法
Dec 06 Python
搞定这套Python爬虫面试题(面试会so easy)
Apr 03 Python
Python获取好友地区分布及好友性别分布情况代码详解
Jul 10 Python
Flask框架学习笔记之表单基础介绍与表单提交方式
Aug 12 Python
Python人工智能之路 之PyAudio 实现录音 自动化交互实现问答
Aug 13 Python
python中下标和切片的使用方法解析
Aug 27 Python
Pytorch模型转onnx模型实例
Jan 15 Python
解决tensorflow打印tensor有省略号的问题
Feb 04 Python
Python多线程操作之互斥锁、递归锁、信号量、事件实例详解
Mar 24 Python
微信跳一跳python辅助脚本(总结)
Jan 11 #Python
Python用sndhdr模块识别音频格式详解
Jan 11 #Python
Python用imghdr模块识别图片格式实例解析
Jan 11 #Python
Python实现可设置持续运行时间、线程数及时间间隔的多线程异步post请求功能
Jan 11 #Python
Python基于ThreadingTCPServer创建多线程代理的方法示例
Jan 11 #Python
python实现员工管理系统
Jan 11 #Python
Python使用base64模块进行二进制数据编码详解
Jan 11 #Python
You might like
php实现的简单压缩英文字符串的代码
2008/04/24 PHP
php使用number_format函数截取小数的方法分析
2016/05/27 PHP
PHP基于MySQLI函数封装的数据库连接工具类【定义与用法】
2017/08/11 PHP
PHP的mysqli_ssl_set()函数讲解
2019/01/23 PHP
jquery关于图形报表的运用实现代码
2011/01/06 Javascript
jQuery文本框(input textare)事件绑定方法教程
2013/04/24 Javascript
JS判断变量是否为空判断是否null
2014/07/25 Javascript
jQuery响应鼠标事件并隐藏与显示input默认值
2014/08/24 Javascript
angularjs 处理多个异步请求方法汇总
2015/01/06 Javascript
JavaScript通过select动态更换图片的方法
2015/03/23 Javascript
Bootstrap每天必学之按钮
2015/11/26 Javascript
基于jquery编写的放大镜插件
2016/03/23 Javascript
CKEditor无法验证的解决方案(js验证+jQuery Validate验证)
2016/05/09 Javascript
表单input项使用label同时引用Bootstrap库导致input点击效果区增大问题
2016/10/11 Javascript
JS 在数组指定位置插入/删除数据的方法
2017/01/12 Javascript
JavaScript的六种继承方式(推荐)
2017/06/26 Javascript
微信小程序搭建(mpvue+mpvue-weui+fly.js)的详细步骤
2018/09/18 Javascript
nodejs的安装使用与npm的介绍
2019/09/11 NodeJs
vue中的mescroll搜索运用及各种填坑处理
2019/10/30 Javascript
JavaScript indexOf()原理及使用方法详解
2020/07/09 Javascript
vue实现井字棋游戏
2020/09/29 Javascript
swiper4实现移动端导航栏tab滑动切换
2020/10/16 Javascript
[03:57]《不朽》——2015DOTA2国际邀请赛—中国军团出征主题曲MV
2015/07/15 DOTA
详解python单例模式与metaclass
2016/01/15 Python
Python callable()函数用法实例分析
2018/03/17 Python
Python实现的多叉树寻找最短路径算法示例
2018/07/30 Python
Opencv-Python图像透视变换cv2.warpPerspective的示例
2019/04/11 Python
Python Django form 组件动态从数据库取choices数据实例
2020/05/19 Python
俄罗斯旅游网站:Tripadvisor俄罗斯
2017/03/21 全球购物
高中学生干部学习的自我评价
2014/02/21 职场文书
高中竞选班长演讲稿
2014/04/24 职场文书
教师培训学习心得体会
2016/01/21 职场文书
创业计划书之面包店
2019/09/17 职场文书
html粘性页脚的具体使用
2022/01/18 HTML / CSS
Apache Pulsar集群搭建部署详细过程
2022/02/12 Servers
德生2P3收音机开箱评测
2022/04/30 无线电