chucklqsun / WxJumpHelper

wechat game helper(jump) 微信小游戏:跳一跳 辅助程序
MIT License
16 stars 15 forks source link
wechat-game wechat-mini-program

WxJumpHelper

How To Use

setup below variable in code:

for i in range(0, 5):   # default jump 5 rounds
    learning_seq.append(random.randint(50, 110))

default is 5 rounds and jump times (random int) between 50 to 110。You properly get your score over 700. User should use lower jump times and increase them later to form a learning curve.

make sure adb is ready for any path

  1. Install matplotlib:
    • for Python 2: pip install matplotlib
    • for Python 3: pip3 install matplotlib
  2. Install OpenCV
  3. Connect your Android phone to your computer and select 'USB for file transfer'.
  4. Open the game and be ready to jump.
  5. Run the main.py and a screenshot will popup shortly.

alt text

  1. The character will jump automatically.
  2. Enjoy!

How It Works

The script uses adb to get the screenshot and calculate the coordination (start point and stop point) and give a proper jumping

Machine Learning

  1. Use train.py to training your CNN neural network.
  2. Use predictor.py to predict delay value.

EasterEgg: Use JS script to modify score directly

original source

Windows User before "npm install sleep", please install windows-build-tools first(which is sometimes not useful)

npm install --global --production windows-build-tools

You can also delete "sleep" related code(but have big risk if server verifies timestamp)

install nodejs, execute below steps in wx_t1t_hack.js dir

  1. npm init --y
  2. npm install crypto-js request-promise sleep

replace session id with yours modify score_you_want (session id could be fetched by fiddle or charles)

Run & Enjoy

node wx_t1t_hack.js

Update:

data format

Warning

(微信小游戏:跳一跳) 辅助程序

如何使用

在使用前确保adb程序已经安装并且能在任何路径下执行adb命令 在一下代码里配置跳跃的参数:

for i in range(0, 5):   # default jump 5 rounds
    learning_seq.append(random.randint(50, 110))

默认是跳五轮,每轮跳跃次数在50,110之间的随机整数,分数大概会有七百分的样子。用户可以先降低 随机的范围,比如说(20,50)来模拟新手,然后逐步提高,形成学习曲线。

  1. 安装matplotlib库:
    • Python 2: pip install matplotlib
    • Python 3: pip3 install matplotlib
  2. 安装opencv
  3. 连接你的安卓手机到你电脑上,选择USB文件传送
  4. 启动游戏,进入起跳画面
  5. 运行main.py,游戏截图会自动出现

alt text

  1. 自动开始起跳
  2. 玩的开心!

工作原理

脚本用adb获取屏幕截图并计算瓶子和目标物体中心的距离,换算成起跳时间

机器学习模式

机器学习(CNN)版已经可以开始训练了。

  1. 使用training.py训练
  2. 使用predictor.py进行预测

彩蛋:使用脚本直接修改分数

原始代码

安装nodejs,在脚本wx_t1t_hack.js目录下执行

  1. npm init --y
  2. npm install crypto-js request-promise sleep

Windows用户 npm install sleep 在windows需要额外安装编译套件并且不保证成功

npm install --global --production windows-build-tools

也可以删除sleep相关代码(如果服务器校验timestamp,风险会很大)。

修改脚本wx_t1t_hack.js的senssion_id为你自己的session id 分数score_you_want (session id可以通过fiddle或者charles得到)

运行 & 玩的开心

node wx_t1t_hack.js

注意

更新:

数据格式

又一个彩蛋(大家来找茬腾讯版)

这个游戏暂时没有开发出特别好用的辅助,就先放这个项目下,供大家参考研究。

头脑王者辅助(敬请期待)

抓取题库和答案的脚本brain/main.py会被封号。