阴阳师后台全平台(使用网易 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
简讯
简讯
Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Péter Ferenc Gyarmati 1 Jan 17, 2022
Focus on Algorithm Design, Not on Data Wrangling

The dataTap Python library is the primary interface for using dataTap's rich data management tools. Create datasets, stream annotations, and analyze model performance all with one library.

Zensors 37 Nov 25, 2022
I'm doing Genuary, an aritifiacilly generated month to build code that make beautiful things

Genuary 2022 I'm doing Genuary, an aritifiacilly generated month to build code that make beautiful things. Every day there is a new prompt for making

Joaquín Feltes 1 Jan 10, 2022
Extract and visualize information from Gurobi log files

GRBlogtools Extract information from Gurobi log files and generate pandas DataFrames or Excel worksheets for further processing. Also includes a wrapp

Gurobi Optimization 56 Nov 17, 2022
A Python library for plotting hockey rinks with Matplotlib.

Hockey Rink A Python library for plotting hockey rinks with Matplotlib. Installation pip install hockey_rink Current Rinks The following shows the cus

24 Jan 02, 2023
Gallery of applications built using bqplot and widget libraries like ipywidgets, ipydatagrid etc.

bqplot Gallery This is a gallery of bqplot examples. View the gallery at https://bqplot.github.io/bqplot-gallery. Contributing new examples Clone this

8 Aug 23, 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
Typical: Fast, simple, & correct data-validation using Python 3 typing.

typical: Python's Typing Toolkit Introduction Typical is a library devoted to runtime analysis, inference, validation, and enforcement of Python types

Sean 171 Jan 02, 2023
https://there.oughta.be/a/macro-keyboard

inkkeys Details and instructions can be found on https://there.oughta.be/a/macro-keyboard In contrast to most of my other projects, I decided to put t

Sebastian Staacks 209 Dec 21, 2022
Create matplotlib visualizations from the command-line

MatplotCLI Create matplotlib visualizations from the command-line MatplotCLI is a simple utility to quickly create plots from the command-line, levera

Daniel Moura 46 Dec 16, 2022
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

3 Jul 15, 2022
A python wrapper for creating and viewing effects for Matt Parker's christmas tree.

Christmas Tree Visualizer A python wrapper for creating and viewing effects for Matt Parker's christmas tree. Displays py or csv effect files and allo

4 Nov 22, 2022
Debugging, monitoring and visualization for Python Machine Learning and Data Science

Welcome to TensorWatch TensorWatch is a debugging and visualization tool designed for data science, deep learning and reinforcement learning from Micr

Microsoft 3.3k Dec 27, 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
This package creates clean and beautiful matplotlib plots that work on light and dark backgrounds

This package creates clean and beautiful matplotlib plots that work on light and dark backgrounds. Inspired by the work of Edward Tufte.

Nico Schlömer 205 Jan 07, 2023
This component provides a wrapper to display SHAP plots in Streamlit.

streamlit-shap This component provides a wrapper to display SHAP plots in Streamlit.

Snehan Kekre 30 Dec 10, 2022
Visualize the bitcoin blockchain from your local node

Project Overview A new feature in Bitcoin Core 0.20 allows users to dump the state of the blockchain (the UTXO set) using the command dumptxoutset. I'

18 Sep 11, 2022
Implementation of SOMs (Self-Organizing Maps) with neighborhood-based map topologies.

py-self-organizing-maps Simple implementation of self-organizing maps (SOMs) A SOM is an unsupervised method for learning a mapping from a discrete ne

Jonas Grebe 6 Nov 22, 2022
Pretty Confusion Matrix

Pretty Confusion Matrix Why pretty confusion matrix? We can make confusion matrix by using matplotlib. However it is not so pretty. I want to make con

Junseo Ko 5 Nov 22, 2022
kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. 📈 🐶 ❤️

Kyle Verhoog 2 Nov 21, 2021