阴阳师后台全平台(使用网易 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
简讯
简讯
A high performance implementation of HDBSCAN clustering. http://hdbscan.readthedocs.io/en/latest/

HDBSCAN Now a part of scikit-learn-contrib HDBSCAN - Hierarchical Density-Based Spatial Clustering of Applications with Noise. Performs DBSCAN over va

Leland McInnes 91 Dec 29, 2022
YOPO is an interactive dashboard which generates various standard plots.

YOPO is an interactive dashboard which generates various standard plots.you can create various graphs and charts with a click of a button. This tool uses Dash and Flask in backend.

ADARSH C 38 Dec 20, 2022
Machine learning beginner to Kaggle competitor in 30 days. Non-coders welcome. The program starts Monday, August 2, and lasts four weeks. It's designed for people who want to learn machine learning.

30-Days-of-ML-Kaggle 🔥 About the Hands On Program 💻 Machine learning beginner → Kaggle competitor in 30 days. Non-coders welcome The program starts

Roja Achary 145 Jan 01, 2023
University of Missouri - Kansas City: CS451R: Capstone

CS451RC University of Missouri - Kansas City: CS451R: Capstone Installation cd git clone https://github.com/ala2q6/CS451RC.git cd CS451RC pip3 instal

Alex Arbuckle 1 Nov 17, 2021
NumPy and Pandas interface to Big Data

Blaze translates a subset of modified NumPy and Pandas-like syntax to databases and other computing systems. Blaze allows Python users a familiar inte

Blaze 3.1k Jan 01, 2023
An intuitive library to add plotting functionality to scikit-learn objects.

Welcome to Scikit-plot Single line functions for detailed visualizations The quickest and easiest way to go from analysis... ...to this. Scikit-plot i

Reiichiro Nakano 2.3k Dec 31, 2022
Rick and Morty Data Visualization with python

Rick and Morty Data Visualization For this project I looked at data for the TV show Rick and Morty Number of Episodes at a Certain Location Here is th

7 Aug 29, 2022
Make visual music sheets for thatskygame (graphical representations of the Sky keyboard)

sky-python-music-sheet-maker This program lets you make visual music sheets for Sky: Children of the Light. It will ask you a few questions, and does

21 Aug 26, 2022
Bokeh Plotting Backend for Pandas and GeoPandas

Pandas-Bokeh provides a Bokeh plotting backend for Pandas, GeoPandas and Pyspark DataFrames, similar to the already existing Visualization feature of

Patrik Hlobil 822 Jan 07, 2023
Python package that generates hardware pinout diagrams as SVG images

PinOut A Python package that generates hardware pinout diagrams as SVG images. The package is designed to be quite flexible and works well for general

336 Dec 20, 2022
Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain amount of time.

Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain

Bohdan Ruban 5 Nov 08, 2022
Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner

streamlit-dashboards Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner Tutorial Video https://ww

122 Dec 21, 2022
CLAHE Contrast Limited Adaptive Histogram Equalization

A simple code to process images using contrast limited adaptive histogram equalization. Image processing is becoming a major part of data processig.

Happy N. Monday 4 May 18, 2022
Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies

py-self-organizing-map Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies. A SOM is a simple unsuperv

Jonas Grebe 1 Feb 10, 2022
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
A Python library created to assist programmers with complex mathematical functions

libmaths was created not only as a learning experience for me, but as a way to make mathematical models in seconds for Python users using mat

Simple 73 Oct 02, 2022
Visualizations for machine learning datasets

Introduction The facets project contains two visualizations for understanding and analyzing machine learning datasets: Facets Overview and Facets Dive

PAIR code 7.1k Jan 07, 2023
This is a small program that prints a user friendly, visual representation, of your current bsp tree

bspcq, q for query A bspc analyzer (utility for bspwm) This is a small program that prints a user friendly, visual representation, of your current bsp

nedia 9 Apr 24, 2022
Render tokei's output to interactive sunburst chart.

Render tokei's output to interactive sunburst chart.

134 Dec 15, 2022
Generate visualizations of GitHub user and repository statistics using GitHub Actions.

GitHub Stats Visualization Generate visualizations of GitHub user and repository statistics using GitHub Actions. This project is currently a work-in-

Aditya Thakekar 1 Jan 11, 2022