安装

手动安装

环境要求

硬件
  • CPU i5

  • 内存 8G

  • 显卡 无要求

系统
  • Windows 10

  • Ubuntu 20.04

  • MacOS 10.11

  • IOS 13.6.1

以上是经过测试操作系统, 向上兼容无压力,向下兼容需要测试

软件
  • Conda 23

  • Python 3.9+

  • WireShark 4.0

  • iTunes

下载安装包

Conda

https://docs.conda.io/en/latest/miniconda.html

WireShark

https://www.wireshark.org/download.html

iTunes

https://support.apple.com/downloads/itunes

备注

  1. WireShark安装路径要记住, 后面配置文件需要

  2. 在Windows下控制iPhone、iPad挂机需要安装iTunes,否则无需安装

环境配置

  1. conda环境建立

# 修改源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --set show_channel_urls yes

# 建立环境
conda create --name ZBot python=3.9.16

# 激活环境
conda activate ZBot
  1. ZBot 安装

下载ZBot (需要授权账号)

git clone https://e.coding.net/bigcomic/zbot/Windows.git ZBot
  1. 安装依赖库

cd ZBot

# Windows环境执行
pip install -r requirements_win.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# 非Windows环境执行
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  1. 修改配置文件

copy config.py.example config.py
vi config.py

# 修改WireShark的安装路径。

# Windows
tshark_path = 'C:\\Program Files\\Wireshark\\tshark.exe'

# 非Windows
tshark_path = "/Applications/Wireshark.app/Contents/MacOS/tshark"

备注

移动设备不支持数据抓包, 即使安装WireShark也无法对数据进行处理

环境验证

python bot.pyc -h

出现如下信息则说明安装成功

usage: bot.py [-h] [-b <script> [<script> ...]] [-g <game> [<game> ...]] [-r] [-m] [-s <system> [<system> ...]] [--sn SN [SN ...]]
              [--quit <Y/M/D H:M:S> [<Y/M/D H:M:S> ...]] [--readme <script> [<script> ...]] [--app <process>] [--loop <numbers>]
              [--sniffer] [--screenshot] [--resize <source> <target> <scale>] [-c] [-d [Filter]] [-l]

ZBot v1.4 Create by Zhang Dong pencat5150@gmail.com

optional arguments:
  -h, --help            show this help message and exit
  -b <script> [<script> ...], --bot <script> [<script> ...]
                        指定脚本
  -g <game> [<game> ...], --game <game> [<game> ...]
                        指定游戏
  -r, --random          随机事件开关
  -m, --man             拟人线程开关
  -s <system> [<system> ...], --system <system> [<system> ...]
                        指定操作系统
  --sn SN [SN ...]      移动设备的序列号
  --quit <Y/M/D H:M:S> [<Y/M/D H:M:S> ...]
                        计划退出时间
  --readme <script> [<script> ...]
                        脚本使用帮助
  --app <process>       完成一次动作后激活的程序界面
  --loop <numbers>      脚本执行次数
  --sniffer             监听RS消息
  --screenshot          每三秒抓图一次
  --resize <source> <target> <scale>
                        转换不同DPI下的模板图像
  -c, --create          创建新游戏模型
  -d [Filter], --debug [Filter]
                        调试开关, 可以过滤显示,关键词用,分割
  -l, --list            列出所有游戏脚本

虚拟化安装

VMware 17下载

ZBot虚拟机下载

ZBot虚拟机已经完成相关配置,更新代码即可运行

代码更新

在ZBot目录下执行update命令, 自动更新代码和相关依赖库

(ZBot) C:\ZBot\update.bat