阴阳师后台全平台(使用网易 MuMu 模拟器)辅助。支持御魂,觉醒,御灵,结界突破,秘闻副本,地域鬼王。

Overview

阴阳师后台全平台辅助

screen

  • Python 版本:Python 3.8.3
  • 模拟器:网易 MuMu雷电模拟器
  • 模拟器分辨率:1024*576
  • 显卡渲染模式:兼容(OpenGL)
  • 兼容 Windows 系统和 MacOS 系统

思路:

利用 adb 截图后,使用 opencv 找图找色,模拟点击。使用 adb 操作模拟器,相当于后台操作。

我主要为了刷勾玉,所以此工具更侧重地域鬼王,结界突破和秘闻副本,御魂是用来刷突破券的。

为了防止收到鬼使黑的来信,所以增加随机等待的时间比较多,每次随机等待 2-3 秒,导致整体运行速度稍微慢了一些。

此工具适合放在后台干其他工作的同学使用。也比较符合我个人的使用。


地域鬼王需要先把姑获鸟,以津真天和山童收藏。

收藏

结界突破主要是把九宫格的坐标保存到列表,使用 shuffle 方法随机打乱,然后循环执行。

第一次进入突破会主动失败一次,失败的话难度不会增加,方便刷排名和勾玉使用。

每突破三次会领取一次奖励,等待九次全部完成后,会把右上角突破剩余数量截图上传到腾讯 OCR 识别接口,如果剩余次数大于等于九次,递归执行,否则停止执行。

腾讯 OCR 每月有一千次免费次数。如果只是识别结界券使用,应该是够用了,如果不够用可以按需付费或者自建字典识别。

突破剩余数量

这一步需要申请 腾讯云文字识别 OCR 的 secretId 和 secretKey。

然后新建文件 tencentcloudKeys.py,写入:

secretId = "AKI***********************aYHDtmaOw"
secretKey = "Sg**************************QdZ7X"

模拟器版

部分操作参考 网易 MuMu 开发者必备说明书【雷神命令】常用adb命令整理贴

建议直接看雷神模拟器社区的命令整理,比较详细。

运行阴阳师

如果不清楚应用的启动命令,可以先手动运行该程序,然后使用命令:

adb shell dumpsys window | findstr mCurrentFocus

查找正在运行的应用。

启动阴阳师的命令为:

adb shell am start -n com.netease.onmyoji.netease_simulator/com.netease.onmyoji.Client

因为我是 iOS,只能扫码登录,所以启动命令对我来说并不实用。

模拟点击

例如我们需要点击 500, 266 这个坐标:

adb shell input tap 500 266

模拟滑动

0, 0 滑动到 200, 200,耗时 0.5 秒:

adb shell input swipe 0 0 200 200 500

截图

需要先运行此命令:

adb shell screencap /data/screen.png

再将截图推送到电脑:

adb pull /data/screen.png .

注意:示例中的命令将图片保存到当前路径下。

找图

这里借助 opencv 库实现。

import cv2

def p():
    capture_img = ""  # 程序运行时的截图
    temp_img = ""  # 已经保存好的图片
    
    img1 = cv2.imread(capture_img)
    img2 = cv2.imread(temp_img)
    result = cv2.matchTemplate(img1, img2, cv2.TM_CCOEFF_NORMED)
    
    if result.max() > 0.9:
        return True

找色

如何在截图中获取某坐标的像素值?

import cv2

def p(x, y):
    capture_img = ""
    _img = cv2.imread(capture_img)
    img = cv2.cvtColor(_img, cv2.COLOR_BGR2RGB)
    r, g, b = img[y, x]  # 注意这里的坐标是相反的
    return r, g, b

裁剪图片

我们截图完成以后,如何从截图中获取剩余结界突破数量?

import cv2

capture_img = ""
img = cv2.imread(capture_img)
cv2.imwrite("new.png", img[12:30, 705:750])  # 裁剪坐标为 [y0:y1, x0:x1]

需要注意的是坐标都是 y, x。

双开应用切换

由于多开改版后(2.2.2x86/x64 版本之后)所有的多开应用和原应用都是同一个包名,所以需要通过 UserId 来控制多开的应用。

这里以网易云游戏为例,多开后分别获取包名,使用命令:

adb shell dumpsys window | findstr mCurrentFocus

全部都是 com.netease.android.cloudgame/com.netease.android.cloudgame.MainActivity

所以需要通过切换 UserId 来切换应用。

通过包名来获取对应 UserId:

adb shell ps|findstr com.netease.android.cloudgame

返回如下内容:

对应用户ID

可以看到原端应用的进程 id 是 u0_a36 ,看 _ 前面的 u0 就行,即 UserId=0; 在 MuMu 上一般原端的 UserId=0,多开端 #N1 的 UserId=10,如此类推 #N2 的 UserId=11,#N3 的 UserId=12,#N4 的 UserId=13

所以多开操作分为两步:

  1. 切换 UserId
  2. 打开应用

根据上边的截图,UserId 分别是 0 和 10,如果要在两个应用之间切换可以使用:

# 切换原应用
adb shell am start-user 0
adb shell am start --user 0 com.netease.android.cloudgame/com.netease.android.cloudgame.MainActivity

# 切换多开应用
adb shell am start-user 10
adb shell am start --user 10 com.netease.android.cloudgame/com.netease.android.cloudgame.MainActivity

切换之后就可以继续操作了。

赞赏

Owner
简讯
简讯
Keir&'s Visualizing Data on Life Expectancy

Keir's Visualizing Data on Life Expectancy Below is information on life expectancy in the United States from 1900-2017. You will also find information

9 Jun 06, 2022
clock_plot provides a simple way to visualize timeseries data, mapping 24 hours onto the 360 degrees of a polar plot

clock_plot clock_plot provides a simple way to visualize timeseries data mapping 24 hours onto the 360 degrees of a polar plot. For usage, please see

12 Aug 24, 2022
GitHub Stats Visualizations : Transparent

GitHub Stats Visualizations : Transparent Generate visualizations of GitHub user and repository statistics using GitHub Actions. ⚠️ Disclaimer The pro

YuanYap 7 Apr 05, 2022
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

3.4k Dec 30, 2022
A pandas extension that solves all problems of Jalai/Iraninan/Shamsi dates

Jalali Pandas Extentsion A pandas extension that solves all problems of Jalai/Iraninan/Shamsi dates Features Series Extenstion Convert string to Jalal

51 Jan 02, 2023
flask extension for integration with the awesome pydantic package

Flask-Pydantic Flask extension for integration of the awesome pydantic package with Flask. Installation python3 -m pip install Flask-Pydantic Basics v

249 Jan 06, 2023
Drug design and development team HackBio internship is a virtual bioinformatics program that introduces students and professional to advanced practical bioinformatics and its applications globally.

-Nyokong. Drug design and development team HackBio internship is a virtual bioinformatics program that introduces students and professional to advance

4 Aug 04, 2022
Calendar heatmaps from Pandas time series data

Note: See MarvinT/calmap for the maintained version of the project. That is also the version that gets published to PyPI and it has received several f

Martijn Vermaat 195 Dec 22, 2022
UNMAINTAINED! Renders beautiful SVG maps in Python.

Kartograph is not maintained anymore As you probably already guessed from the commit history in this repo, Kartograph.py is not maintained, which mean

1k Dec 09, 2022
Because trello only have payed options to generate a RunUp chart, this solves that!

Trello Runup Chart Generator The basic concept of the project is that Corello is pay-to-use and want to use Trello To-Do/Doing/Done automation with gi

Rômulo Schiavon 1 Dec 21, 2021
This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and much more using Kibana Dashboard with Elasticsearch.

System Stats Visualizer This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and m

Vishal Teotia 5 Feb 06, 2022
Here are my graphs for hw_02

Let's Have A Look At Some Graphs! Graph 1: State Mentions in Congressperson's Tweets on 10/01/2017 The graph below uses this data set to demonstrate h

7 Sep 02, 2022
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 1.6k Jan 08, 2023
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 697 Jan 06, 2023
Flipper Zero documentation repo

Flipper Zero Docs Participation To fix a bug or add something new to this repository, you need to open a pull-request. Also, on every page of the site

Flipper Zero (All Repositories will be public soon) 114 Dec 30, 2022
A D3.js plugin that produces flame graphs from hierarchical data.

d3-flame-graph A D3.js plugin that produces flame graphs from hierarchical data. If you don't know what flame graphs are, check Brendan Gregg's post.

Martin Spier 740 Dec 29, 2022
Curvipy - The Python package for visualizing curves and linear transformations in a super simple way

Curvipy - The Python package for visualizing curves and linear transformations in a super simple way

Dylan Tintenfich 55 Dec 28, 2022
:small_red_triangle: Ternary plotting library for python with matplotlib

python-ternary This is a plotting library for use with matplotlib to make ternary plots plots in the two dimensional simplex projected onto a two dime

Marc 611 Dec 29, 2022
Set of matplotlib operations that are not trivial

Matplotlib Snippets This repository contains a set of matplotlib operations that are not trivial. Histograms Histogram with bins adapted to log scale

Raphael Meudec 1 Nov 15, 2021
A python script and steps to display locations of peers connected to qbittorrent

A python script (along with instructions) to display the locations of all the peers your qBittorrent client is connected to in a Grafana worldmap dash

62 Dec 07, 2022