微信小游戏跳一跳简单手动外挂(基于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 ...
随机推荐
- MySQL 8 中新的复制功能
MySQL 8 中新的复制功能使得操作更加方便,并帮助用户更好地观察复制过程中内部发生的情况. 使用 MySQL 5.7.17 获取 MySQL 组复制插件是一项巨大的工作.组复制是一个新的插件,通过 ...
- adb shell am broadcast 手动发送广播及adb shell am/pm其他命令
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/zi_zhe/article/details/72229201 在命令行可用adb shell am ...
- ld: library not found for -lstdc++.6
ld: library not found for -lstdc++.6 Xcode10 删除 libstdc++.6.tbd libstdc++.6.0.9.tbd 用 libc++.tbd lib ...
- Analyzing the Go runtime scheduler from source code perspective
http://www.cs.columbia.edu/~aho/cs6998/reports/12-12-11_DeshpandeSponslerWeiss_GO.pdf http://www.cs. ...
- [转]decorator(HTML装饰器)
原文地址:https://blog.csdn.net/jzh440/article/details/7770013 1>:每当遇到一个新的技术,首先我会问自己,这个技术是做神马的?用这个技术有神 ...
- 【Python】 Numpy极简寻路
[Numpy] 先感叹下最近挖坑越来越多了.. 最近想不自量力地挑战下ML甚至DL.然而我也知道对于我这种半路出家,大学数学也只学了两个学期,只学了点最基本的高数还都忘光了的渣滓来说,难度估计有点大. ...
- 【RPC】手撸一个简单的RPC框架实现
涉及技术 序列化.Socket通信.Java动态代理技术,反射机制 角色 1.服务提供者:运行在服务端,是真实的服务实现类 2.服务发布监听者:运行在RPC服务端,1将服务端提供的 ...
- Direct3D 11 Tutorial 5: 3D Transformation_Direct3D 11 教程5:3D转型
概述 在上一个教程中,我们从模型空间到屏幕渲染了一个立方体. 在本教程中,我们将扩展转换的概念并演示可以通过这些转换实现的简单动画. 本教程的结果将是围绕另一个轨道运行的对象. 展示转换以及如何将它们 ...
- Cesium打包命令
package.json中 (1) npm run build Source/Cesium.js 仅是把Cesium源码中一千两百多个js文件做了一下引用,并不会进行打包 所以这个Cesium.js也 ...
- 网络编程 -- RPC实现原理 -- 目录
-- 啦啦啦 -- 网络编程 -- RPC实现原理 -- NIO单线程 网络编程 -- RPC实现原理 -- NIO多线程 -- 迭代版本V1 网络编程 -- RPC实现原理 -- NIO多线程 -- ...