微信小游戏跳一跳简单手动外挂(基于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 ...
随机推荐
- Ubuntu apt-get彻底卸载软件包【转】
原文地址:https://blog.csdn.net/get_set/article/details/51276609 最近对ubuntu卸载参数的详细程度了解不够:转载已了解查用. 如果你关注搜索到 ...
- linux驱动(续)
网络通信 --> IO多路复用之select.poll.epoll详解 IO多路复用之select.poll.epoll详解 目前支持I/O多路复用的系统调用有 select,psel ...
- Effective Java 第三版——79. 避免过度同步
Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...
- lsb_release command not found
Linux里的lsb_release命令用来查看当前系统的发行版信 息(prints certain LSB (Linux Standard Base) and Distribution inform ...
- (7) MySQL数据库备份详解
对于任何数据库来说,备份都是非常重要的 数据库复制不能取代备份的作用 比如我们由于误操作,在主数据库上删除了一些数据,由于主从复制的时间很短,在发现时,从数据库上的数据可能也已经被删除了, 我们不能使 ...
- Vue父子组件双向数据绑定
[本文出自天外归云的博客园] 简介 Vue版本:2.9.6 Element版本:2.4.8 问题描述:子组件对Element中el-select进行封装,父组件中把选中的值selected和所有选项o ...
- DTO转DOMAIN动态转换类。
package dtotransfer.util; import dtotransfer.annotation.DomainField; import java.lang.annotation.Ann ...
- 【Leetcode】收集
万事总要有个开头,来吧. 问题原题看情况,如果我能用中文准确地表述出来的话那就用中文说一下.也有可能完全不说… ■ twoSum 问题: 参数是一个数组nums和一个目标数target,寻找nums中 ...
- C# 获取对象 大小 Marshal.SizeOf (sizeof 只能在不安全的上下文中使用)
C# 能否获取一个对象所占内存的大小? 今日,在项目重构的时候忽然想到一个问题,一个类哪些成员的增加,会影响一个类所占内存的大小?C#有没有办法知道一个对象占多少内存呢? 第一个问题:很快想到是类的非 ...
- LeetCode 51 N-Queens II
Follow up for N-Queens problem. Now, instead outputting board configurations, return the total numbe ...