├── dnf-script-plugin ├── .gitignore ├── .idea │ ├── .gitignore │ ├── compiler.xml │ ├── deploymentTargetSelector.xml │ ├── gradle.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── migrations.xml │ ├── misc.xml │ └── vcs.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── libs │ │ ├── OpencvLibrary-1.0.0-release.aar │ │ └── Yolov5Library-1.0.0-release.aar │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── info │ │ │ └── xingxingdd │ │ │ └── dnf │ │ │ └── script │ │ │ └── plugin │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── model │ │ │ │ ├── best.ncnn.bin │ │ │ │ ├── best.ncnn.param │ │ │ │ ├── yolov5s.bin │ │ │ │ └── yolov5s.param │ │ │ ├── plugin │ │ │ │ └── index.js │ │ │ └── template │ │ │ │ ├── common │ │ │ │ ├── character-border-empty.jpg │ │ │ │ ├── character-border-new.jpg │ │ │ │ ├── confirm.jpg │ │ │ │ ├── fatigue.jpg │ │ │ │ ├── position.jpg │ │ │ │ ├── repeat.jpg │ │ │ │ ├── rocker.jpg │ │ │ │ ├── setting.jpg │ │ │ │ ├── start-game-btn.jpg │ │ │ │ └── switch-character.jpg │ │ │ │ ├── dungeons │ │ │ │ ├── buwanjia │ │ │ │ │ ├── 1.jpg │ │ │ │ │ ├── 2.jpg │ │ │ │ │ ├── 3.jpg │ │ │ │ │ ├── 4.jpg │ │ │ │ │ ├── 5.jpg │ │ │ │ │ ├── 6.jpg │ │ │ │ │ ├── 7.jpg │ │ │ │ │ ├── 8.jpg │ │ │ │ │ ├── 9.jpg │ │ │ │ │ └── map.jpg │ │ │ │ └── common │ │ │ │ │ ├── bwjxlc.jpg │ │ │ │ │ ├── mxan.jpg │ │ │ │ │ ├── mxjl.jpg │ │ │ │ │ ├── mxjwxz.jpg │ │ │ │ │ ├── mxjxz.jpg │ │ │ │ │ ├── qyyd.jpg │ │ │ │ │ ├── repair.jpg │ │ │ │ │ ├── wnxs.jpg │ │ │ │ │ └── zdks.jpg │ │ │ │ └── role │ │ │ │ └── berserker │ │ │ │ ├── 1.jpg │ │ │ │ ├── 10.jpg │ │ │ │ ├── 11.jpg │ │ │ │ ├── 12.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 4.jpg │ │ │ │ ├── 5.jpg │ │ │ │ ├── 6.jpg │ │ │ │ ├── 7.jpg │ │ │ │ ├── 8.jpg │ │ │ │ └── 9.jpg │ │ ├── java │ │ │ └── info │ │ │ │ └── xingxingdd │ │ │ │ └── dnf │ │ │ │ └── script │ │ │ │ └── plugin │ │ │ │ ├── DnfScriptPlugin.java │ │ │ │ ├── DnfScriptPluginRegistry.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── utils │ │ │ │ └── DnfScriptPluginUtils.java │ │ └── res │ │ │ ├── drawable │ │ │ ├── ic_launcher_background.xml │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── values-night │ │ │ └── themes.xml │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ │ └── xml │ │ │ ├── backup_rules.xml │ │ │ └── data_extraction_rules.xml │ │ └── test │ │ └── java │ │ └── info │ │ └── xingxingdd │ │ └── dnf │ │ └── script │ │ └── plugin │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ ├── libs.versions.toml │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── webpack-autojs-master ├── .babelrc ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .vs └── slnx.sqlite ├── LICENSE ├── README.md ├── advancedEngines.js ├── common ├── common.js └── douyinUtils.js ├── header.txt ├── jsconfig.json ├── package.json ├── scriptConfig.js ├── types ├── adbkit.d.ts ├── auto.d.ts ├── autojs.d.ts └── modules │ ├── app.d.ts │ ├── colors.d.ts │ ├── console.d.ts │ ├── coordinate.d.ts │ ├── device.d.ts │ ├── dialogs.d.ts │ ├── engines.d.ts │ ├── events.d.ts │ ├── files.d.ts │ ├── floaty.d.ts │ ├── global.d.ts │ ├── http.d.ts │ ├── images.d.ts │ ├── keys.d.ts │ ├── media.d.ts │ ├── root.d.ts │ ├── sensors.d.ts │ ├── storages.d.ts │ ├── threads.d.ts │ ├── ui.d.ts │ └── widgets.d.ts ├── webpack.config.js └── work ├── dnf ├── 1.jpg ├── common │ ├── compute.js │ ├── config.js │ ├── debuger.js │ ├── mark.js │ ├── socket.js │ └── utils.js ├── content │ ├── action.js │ ├── boot.js │ └── home.js ├── game │ ├── action │ │ ├── detector.js │ │ ├── matcher.js │ │ ├── ocr.js │ │ └── processor.js │ ├── assistant.js │ ├── config │ │ └── template.js │ ├── core │ │ ├── factory.js │ │ ├── processor │ │ │ ├── game_detect_processor.js │ │ │ └── match_cache_processor.js │ │ └── scheduler.js │ ├── engine.js │ ├── game.js │ ├── object │ │ ├── block.js │ │ ├── coward.js │ │ └── monster.js │ ├── pipeline │ │ ├── keyboard.js │ │ └── pipeline.js │ ├── role │ │ └── berserker.js │ ├── runtime.js │ ├── scene │ │ ├── bwj.js │ │ ├── dungeons.js │ │ └── skill.js │ ├── storategy │ │ └── storategy.js │ └── test.js ├── img │ ├── 分类.png │ ├── 失败.png │ ├── 播放.png │ ├── 播放中.png │ ├── 设置.png │ ├── 退出.png │ └── 首页.png ├── main.js ├── project.json ├── readme.md └── view │ ├── debug.js │ ├── home.js │ ├── loading.js │ └── update.js ├── dy ├── float.js ├── img │ ├── 播放.png │ ├── 播放中.png │ └── 退出.png ├── main.js └── project.json ├── ocr ├── 0.jpg ├── 1.jpg ├── 1.png ├── 2.png ├── binary_image.png ├── main.js ├── models │ ├── ch_PP-OCRv3_det_slim_infer.nb │ ├── ch_PP-OCRv3_rec_slim_infer.nb │ └── ch_ppocr_mobile_v2.0_cls_infer_opt.nb ├── project.json ├── xframe_000245.jpg ├── 开始.png ├── 暂停.png ├── 设置.png └── 退出.png ├── qq消息 ├── main.js └── project.json ├── test ├── runtime.js ├── test.js └── test2.js ├── websocket ├── main.js └── project.json ├── 云控demo ├── project.json └── test.js └── 快捷输入 ├── main.js └── project.json /dnf-script-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /dnf-script-plugin/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /dnf-script-plugin/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.android.application) 3 | } 4 | 5 | android { 6 | namespace 'info.xingxingdd.dnf.script.plugin' 7 | compileSdk 34 8 | 9 | defaultConfig { 10 | applicationId "info.xingxingdd.dnf.script.plugin" 11 | minSdk 24 12 | targetSdk 34 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | } 30 | 31 | dependencies { 32 | 33 | implementation libs.appcompat 34 | implementation libs.material 35 | implementation libs.activity 36 | implementation libs.constraintlayout 37 | testImplementation libs.junit 38 | androidTestImplementation libs.ext.junit 39 | androidTestImplementation libs.espresso.core 40 | implementation libs.auto.js.plugin.sdk 41 | implementation libs.gson 42 | implementation(fileTree("libs")) 43 | } -------------------------------------------------------------------------------- /dnf-script-plugin/app/libs/OpencvLibrary-1.0.0-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/libs/OpencvLibrary-1.0.0-release.aar -------------------------------------------------------------------------------- /dnf-script-plugin/app/libs/Yolov5Library-1.0.0-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/libs/Yolov5Library-1.0.0-release.aar -------------------------------------------------------------------------------- /dnf-script-plugin/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/androidTest/java/info/xingxingdd/dnf/script/plugin/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package info.xingxingdd.dnf.script.plugin; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("info.xingxingdd.dnf.script.plugin", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/model/best.ncnn.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/model/best.ncnn.bin -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/model/yolov5s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/model/yolov5s.bin -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/plugin/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (plugin) { 2 | let runtime = plugin.runtime; 3 | let scope = plugin.topLevelScope; 4 | 5 | function DnfScriptPlugin() { 6 | } 7 | 8 | DnfScriptPlugin.detect = (source, ratioThreshold) => plugin.detect(source, ratioThreshold) 9 | 10 | DnfScriptPlugin.match = (source, template, bounds) => plugin.match(source, template, bounds) 11 | 12 | DnfScriptPlugin.blackScreenDetect = (source) => plugin.blackScreenDetect(source) 13 | 14 | return DnfScriptPlugin; 15 | } -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/character-border-empty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/character-border-empty.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/character-border-new.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/character-border-new.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/confirm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/confirm.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/fatigue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/fatigue.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/position.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/position.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/repeat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/repeat.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/rocker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/rocker.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/setting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/setting.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/start-game-btn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/start-game-btn.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/common/switch-character.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/common/switch-character.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/1.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/2.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/3.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/4.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/5.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/6.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/7.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/8.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/9.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/buwanjia/map.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/bwjxlc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/bwjxlc.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxan.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjl.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjwxz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjwxz.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjxz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/mxjxz.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/qyyd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/qyyd.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/repair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/repair.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/wnxs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/wnxs.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/dungeons/common/zdks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/dungeons/common/zdks.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/1.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/10.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/11.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/12.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/2.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/3.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/4.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/5.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/6.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/7.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/8.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/assets/template/role/berserker/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/assets/template/role/berserker/9.jpg -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/java/info/xingxingdd/dnf/script/plugin/DnfScriptPlugin.java: -------------------------------------------------------------------------------- 1 | package info.xingxingdd.dnf.script.plugin; 2 | 3 | import static org.opencv.android.OpenCVLoader.OPENCV_VERSION; 4 | 5 | import android.content.Context; 6 | import android.graphics.Bitmap; 7 | import android.util.Log; 8 | 9 | import org.autojs.plugin.sdk.Plugin; 10 | import org.opencv.android.InstallCallbackInterface; 11 | import org.opencv.android.LoaderCallbackInterface; 12 | import org.opencv.android.OpenCVLoader; 13 | import org.opencv.matcher.BlackImageMatcher; 14 | import org.opencv.matcher.MatchResult; 15 | import org.opencv.matcher.MatchTemplate; 16 | import org.opencv.matcher.TemplateMatcher; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Arrays; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | import java.util.Map; 23 | import java.util.stream.Collectors; 24 | 25 | import info.xingxingdd.dnf.script.plugin.utils.DnfScriptPluginUtils; 26 | import info.xingxingdd.yolov5.library.YoloV5Ncnn; 27 | 28 | public class DnfScriptPlugin extends Plugin { 29 | 30 | private static YoloV5Ncnn yoloV5Ncnn; 31 | 32 | public DnfScriptPlugin(Context context, Context selfContext, Object runtime, Object topLevelScope) { 33 | super(context, selfContext, runtime, topLevelScope); 34 | //初始化opencv 35 | OpenCVLoader.initDebug(); 36 | } 37 | 38 | @Override 39 | public String getAssetsScriptDir() { 40 | return "plugin"; 41 | } 42 | 43 | public List detect(Bitmap source, float ratioThreshold) { 44 | try { 45 | MatchTemplate sourceTemplate = new MatchTemplate( 46 | source, 47 | (int) (source.getWidth() * 0.35), 48 | (int) (source.getWidth() * 0.65), 49 | (int) (source.getHeight() * 0.35), 50 | (int) (source.getHeight() * 0.65) 51 | ); 52 | boolean blackImgDetectResult = BlackImageMatcher.match(sourceTemplate, 10); 53 | if (blackImgDetectResult) { 54 | YoloV5Ncnn.Obj obj = yoloV5Ncnn.new Obj(); 55 | obj.label = "black-screen"; 56 | obj.w = source.getWidth() * 0.3f; 57 | obj.h = source.getWidth() * 0.3f; 58 | obj.x = source.getWidth() * 0.35f; 59 | obj.w = source.getWidth() * 0.35f; 60 | obj.prob = 1; 61 | return List.of(obj); 62 | } 63 | if (yoloV5Ncnn == null) { 64 | yoloV5Ncnn = YoloV5Ncnn.getInstance(getSelfContext().getAssets(), "model/best.ncnn"); 65 | } 66 | YoloV5Ncnn.Obj[] result = yoloV5Ncnn.detect(source, false); 67 | if (result != null && result.length> 0) { 68 | return Arrays.stream(result).filter(r -> r.prob >= ratioThreshold).collect(Collectors.toList()); 69 | } 70 | return List.of(); 71 | } catch (Throwable e) { 72 | Log.e("检测失败", e.getLocalizedMessage()); 73 | return null; 74 | } 75 | } 76 | 77 | public MatchResult match(Bitmap sourceImg, String[] templates, Double[] bounds) { 78 | try { 79 | Log.i("dnf-script-plugin", "宽:" + sourceImg.getWidth() + ",高" + sourceImg.getHeight()); 80 | MatchTemplate source = new MatchTemplate( 81 | sourceImg, 82 | (int) (sourceImg.getWidth() * bounds[0]), 83 | (int) (sourceImg.getWidth() * bounds[1]), 84 | (int) (sourceImg.getHeight() * bounds[2]), 85 | (int) (sourceImg.getHeight() * bounds[3]) 86 | ); 87 | for (String template: templates) { 88 | Bitmap targetImg = DnfScriptPluginUtils.loadBitmap(getSelfContext(), "template/" + template + ".jpg"); 89 | if (targetImg == null) { 90 | return null; 91 | } 92 | Log.i("dnf-script-plugin", source.getLeft() + "," + source.getRight() + "," + source.getTop() + "," + source.getBottom()); 93 | MatchTemplate target = new MatchTemplate(targetImg); 94 | MatchResult matchResult = TemplateMatcher.match(target, source, 1f); 95 | Log.i("dnf-script-plugin", "匹配结果:" + matchResult); 96 | if (matchResult != null) { 97 | return matchResult; 98 | } 99 | } 100 | } catch (Throwable e) { 101 | Log.e("检测失败", e.getLocalizedMessage()); 102 | } 103 | return null; 104 | } 105 | 106 | public boolean blackScreenDetect(Bitmap source) { 107 | MatchTemplate sourceTemplate = new MatchTemplate( 108 | source, 109 | (int) (source.getWidth() * 0.4), 110 | (int) (source.getWidth() * 0.6), 111 | (int) (source.getHeight() * 0.4), 112 | (int) (source.getHeight() * 0.6) 113 | ); 114 | boolean detectResult = BlackImageMatcher.match(sourceTemplate, 10); 115 | Log.i("dnf-script-plugin", "识别黑屏结果结果:" + detectResult); 116 | return detectResult; 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/java/info/xingxingdd/dnf/script/plugin/DnfScriptPluginRegistry.java: -------------------------------------------------------------------------------- 1 | package info.xingxingdd.dnf.script.plugin; 2 | 3 | import org.autojs.plugin.sdk.PluginRegistry; 4 | import org.opencv.android.InstallCallbackInterface; 5 | import org.opencv.android.LoaderCallbackInterface; 6 | import org.opencv.android.OpenCVLoader; 7 | 8 | public class DnfScriptPluginRegistry extends PluginRegistry { 9 | 10 | static { 11 | // 注册默认插件 12 | registerDefaultPlugin(DnfScriptPlugin::new); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/java/info/xingxingdd/dnf/script/plugin/MainActivity.java: -------------------------------------------------------------------------------- 1 | package info.xingxingdd.dnf.script.plugin; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.activity.EdgeToEdge; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import androidx.core.graphics.Insets; 8 | import androidx.core.view.ViewCompat; 9 | import androidx.core.view.WindowInsetsCompat; 10 | 11 | public class MainActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | EdgeToEdge.enable(this); 17 | setContentView(R.layout.activity_main); 18 | ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { 19 | Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); 20 | v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); 21 | return insets; 22 | }); 23 | } 24 | } -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/java/info/xingxingdd/dnf/script/plugin/utils/DnfScriptPluginUtils.java: -------------------------------------------------------------------------------- 1 | package info.xingxingdd.dnf.script.plugin.utils; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.util.Log; 7 | 8 | import java.io.InputStream; 9 | 10 | public class DnfScriptPluginUtils { 11 | 12 | public static Bitmap loadBitmap(Context context, String path) { 13 | try (InputStream is = context.getAssets().open(path)) { 14 | return BitmapFactory.decodeStream(is); 15 | } catch (Exception e) { 16 | Log.e("dnf-server", "加载错误:" + e.getLocalizedMessage()); 17 | return null; 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xingxing-dd/dnf-script/1b331f3a6d954ddad568907e26a3777b538ffd71/dnf-script-plugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FFFFFFFF 5 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | dnf-script-plugin 3 | -------------------------------------------------------------------------------- /dnf-script-plugin/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |