微信小游戏跳一跳简单手动外挂(基于adb 和 python)
只有两个python文件,代码很简单。
shell.py:
#coding:utf-8
import subprocess
import math
import os def execute_command(cmd):
print('start executing cmd...')
s = subprocess.Popen(str(cmd), stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
stderrinfo, stdoutinfo = s.communicate()
# print('stderrinfo is -------> %s and stdoutinfo is -------> %s' % (stderrinfo, stdoutinfo))
# print('finish executing cmd....')
return s.returncode def jump(time):
execute_command("adb shell input touchscreen swipe 170 187 170 187 " + str(time)) def screen():
execute_command('adb shell screencap -p /sdcard/jump.png')
execute_command('adb pull /sdcard/jump.png ./jump.png') def calcDistance(x1,x2,y1,y2):
return math.sqrt((x1 - x2) * (x1 - x2) + (y1-y2) * (y1-y2))
gui.py:
#coding:utf-8
import os
from time import sleep from shell import calcDistance, jump, screen try:
# for Python2
import Tkinter as tk ## notice capitalized T in Tkinter
except ImportError:
# for Python3
import tkinter as tk ## notice lowercase 't' in tkinter here
from PIL import Image, ImageTk isFirst=True
preX=0
preY=0 def callBack(event):
global isFirst,preX,preY,label,tk_image
# print(event.x_root, event.y_root)
if isFirst:
preX = event.x_root
preY = event.y_root
isFirst= False
else:
print(event.x_root,preX,event.y_root,preY)
distance = calcDistance(event.x_root,preX,event.y_root,preY) time = (int)(distance / 0.35)
jump(time)
isFirst = True
print("distance:" + str(distance) + ",time:" + str(time))
try:
sleep(1)
except Exception as e:
print(e)
screen()
pil_image = Image.open("./jump.png")
# 获取图像的原始大小
w, h = pil_image.size
# 缩放图像让它保持比例,同时限制在一个矩形框范围内
pil_image_resized = resize(w, h, w_box, h_box, pil_image) # 也可以显示缩放后的图像信息,获取大小
wr, hr = pil_image_resized.size
# convert PIL image object to Tkinter PhotoImage object
# 把PIL图像对象转变为Tkinter的PhotoImage对象
tk_image = ImageTk.PhotoImage(pil_image_resized)
label.configure(image=tk_image,width=w_box, height=h_box)
# label = tk.Label(root, image=tk_image, width=w_box, height=h_box) # padx,pady是图像与窗口边缘的距离
# label.pack(padx=5, pady=5) def resize(w, h, w_box, h_box, pil_image):
'''''
resize a pil_image object so it will fit into
a box of size w_box times h_box, but retain aspect ratio
对一个pil_image对象进行缩放,让它在一个矩形框内,还能保持比例
''' f1 = 1.0 * w_box / w # 1.0 forces float division in Python2
f2 = 1.0 * h_box / h
factor = min([f1, f2])
# print(f1, f2, factor) # test
# use best down-sizing filter
width = int(w * factor)
height = int(h * factor)
return pil_image.resize((width, height), Image.ANTIALIAS) root = tk.Tk()
root.title("跳一跳游戏辅助")
# size of image display box you want
# 期望图像显示的大小 screen()#截屏
pil_image = Image.open("./jump.png")
# 获取图像的原始大小
w, h = pil_image.size
w_box = w/2
h_box = h/2
# 缩放图像让它保持比例,同时限制在一个矩形框范围内
pil_image_resized = resize(w, h, w_box, h_box, pil_image) # 也可以显示缩放后的图像信息,获取大小
wr, hr = pil_image_resized.size
# convert PIL image object to Tkinter PhotoImage object
# 把PIL图像对象转变为Tkinter的PhotoImage对象
tk_image = ImageTk.PhotoImage(pil_image_resized)
# put the image on a widget the size of the specified display box
# Label: 这个小工具,就是个显示框,小窗口,把图像大小显示到指定的显示框
label = tk.Label(root, image=tk_image, width=w_box, height=h_box) # padx,pady是图像与窗口边缘的距离
# label.pack(padx=5, pady=5) label.pack()
label.bind("<Button-1>",callBack) root.mainloop()
代码一看就能懂,请使用python3,有可能需要
pip3 install pillow
电脑需要配置adb环境变量到path中,支持mac linux windows等
运行
python3 gui.py
使用方法:
在电脑上先点击自己的位置,再点击目标位置。
(仅供学习参考,微信目前刷分好像不怎么好使了,很多提交不了分数)
原版在https://github.com/qiyeboy/LuLunZi/blob/master/WxJmp/,只支持windows,本文修改后的代码支持其他平台了。
微信小游戏跳一跳简单手动外挂(基于adb 和 python)的更多相关文章
- 用Kotlin破解Android版微信小游戏-跳一跳
前言 微信又更新了,从更新日志上来看,似乎只是一次不痛不痒的小更新.不过,很快就有人发现,原来微信这次搞了个大动作——在小程序里加入了小游戏.今天也是朋友圈被刷爆的缘故. 看到网上 有人弄了一个破解版 ...
- 微信小游戏“跳一跳”,Python“外挂”已上线
微信又一次不声不响地搞了个大事情: “小游戏”上线了! 于是,在这辞旧迎新的时刻,毫无意外的又火了. 今天有多少人刷了,让我看到你们的双手! 喏,我已经尽力了…… 不过没关系,你们跳的再好,在毫无心理 ...
- 微信小程序 跳一跳 外挂 C# winform源码
昨天微信更新了,出现了一个小游戏“跳一跳”,玩了一下 赶紧还蛮有意思的 但纯粹是拼手感的,玩了好久,终于搞了个135分拿了个第一名,没想到过一会就被朋友刷下去了,最高的也就200来分把,于是就想着要是 ...
- 手把手教你玩微信小程序跳一跳
最近微信小程序火的半边天都红了,虽然不会写,但是至少也可以仿照网上大神开发外挂吧!下面手把手教妹纸们(汉纸们请自觉的眼观耳听)怎么愉快的在微信小游戏中获得高分. 废话不多说,咱们这就发车了!呸!咱们这 ...
- 微信小程序跳一跳辅助程序(手动版)
最近,微信官方推出了demo小程序游戏<跳一跳>,这个游戏操作简单,容易上手,却又不容易获得高分,受到很多人的喜爱(emm...这游戏有毒).自己也尝试了玩了几次,作为一个手残+脑残的资深 ...
- 利用python实现微信小程序游戏跳一跳详细教程
利用python实现微信小程序游戏跳一跳详细教程 1 先安装python 然后再安装pip <a href="http://newmiracle.cn/wp-content/uploa ...
- python--微信小程序“跳一跳‘外挂
参考网站:http://blog.csdn.net/LittleBeautiful/article/details/78955792 0x00:准备工具: Windows 10: 一个安卓真机 pyt ...
- Egret白鹭开发微信小游戏程序跳转功能(由一个小游戏跳转到另一个小游戏)
假设我们要实现的功能是从小游戏A跳转到小游戏B 对于小游戏A: (1)在platform.ts中添加代码如下: /** * 平台数据接口. * 由于每款游戏通常需要发布到多个平台上,所以提取出一个统一 ...
- 微信小游戏 Three.js UI 2D text 简单方案
在微信小游戏中使用 THREE.js 引擎,没有合适的 UI 库可用,只能自己动手.图片啥的都还好,text 不好弄.text 要计算 width 和 height,不然事件响应范围不对. funct ...
随机推荐
- 分析轮子(一)-ArrayList.java
前言:之前也看过一些JDK源码,不过没有留下痕迹,经久年月就淡忘了,现在的时机也差不多了,想再看一次,并且记录下来自己的感想,于是从自己使用最多最熟悉的地方开始!并且看的过程中,我希望自己思考一下如下 ...
- v2ray和ss的安装资料整理
v2ray: 1. https://yuan.ga/v2ray-complete-tutorial/ 2. https://toutyrater.github.io/ 推荐使用:v2ray,会比ss快 ...
- eclipse工具中使用Data Source Explorer连接数据库(MySQL)
1.进入Eclipse工具,打开Data Source Explorer.Window==>Show View==>Data Source Explorer(注:如果找不到请选择Other ...
- 用xcode9编译出ios越狱机程序使用的dylib
因为xcode9默认不能创建dylib工程,所以 选择 静态库 工程后,修改编译选项使得变成dylib工程. 步骤: 一.xcode9 -> File -> New -> Proje ...
- Vue父子组件双向数据绑定
[本文出自天外归云的博客园] 简介 Vue版本:2.9.6 Element版本:2.4.8 问题描述:子组件对Element中el-select进行封装,父组件中把选中的值selected和所有选项o ...
- 【iCore4 双核心板_uC/OS-II】例程八:消息邮箱
一.实验说明: 消息邮箱是uC/OS-II中的另一种通信机制,可以使一个任务或者中断服务子程序向另一个任务发送一个指针型的变量.通常该指针指向一个包含了“消息”的特定数据结构. 二.实验截图: ...
- [Java并发编程(二)] 线程池 FixedThreadPool、CachedThreadPool、ForkJoinPool?为后台任务选择合适的 Java executors
[Java并发编程(二)] 线程池 FixedThreadPool.CachedThreadPool.ForkJoinPool?为后台任务选择合适的 Java executors ... 摘要 Jav ...
- linux搭建FTP服务器并整合Nginx
操作系统:Centos7 1.1.服务器配置 # 关闭SELINUX,把SELINUX=enforcing改为SELINUX=disabled,reboot重启服务器生效 vim /etc/sysco ...
- plsql 通过修改配置文件的方式实现数据库的连接
查看oracle的安装位置: XP系统: 开始>>所有程序>>>Oracle-OraDb10g_home1>>>配置和移植工具>>>右 ...
- 深度讲解 .net session 过期机制
[参考]net session过期 原理及解决办法 [参考]深入理解session过期机制