migrate to AutoX

This commit is contained in:
StageGuard
2023-02-25 10:39:56 +08:00
parent 2ea865cb52
commit e8334effc2
6 changed files with 34 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
# SkyAutoPlayerScript
A script to play Sheets generated by [SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio) automatically in game Sky with accessibility services using Auto.js
A script to play Sheets generated by [SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio) automatically in game Sky with accessibility services using AutoX
[![shared sheet](https://badgen.net/badge/shared%20sheets/175%20in%20total/green)](shared_sheets/) [![sheet contributors](https://badgen.net/badge/sheet%20contributors/36/pink)](#shared-sheets) [![Hosted in](https://badgen.net/badge/CDN/jsDelivr?icon=jsdelivr)](https://www.jsdelivr.com/)
@@ -20,17 +20,19 @@ There are many features in SkyAutoPlayerScript compared to other auto player scr
## Usage
1. Download release `4.1.1 Alpha2 (461) -> armeabi-v7a` in [`Ericwyn/Auto.js/releases@V4.1.1.Alpha2`](https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2)
1. Download AutoX at [Releases · kkevsekk1/AutoX](https://github.com/kkevsekk1/AutoX/releases)
2. Turn on **Accessibility service** and allow **Display pop-up window** permission for Auto.js
> Warning: Please notice that you should check your device arch in advance, or select `universal`。
3. Create a new script file in Auto.js. Copy the code below and run!
2. Turn on **Accessibility service** and allow **Display pop-up window** permission for AutoX
3. Create a new script file in AutoX. Copy the code below and run!
```javascript
"ui";
"use strict";
/*
SkyAutoPlayer (Auto.js script)
SkyAutoPlayer (AutoX script)
Copyright © 2020-2021 StageGuard
This library is free software; you can redistribute it and/or
@@ -74,7 +76,7 @@ There are many features in SkyAutoPlayerScript compared to other auto player scr
```
## Clear data
`SkyAutoPlayerScript` will store data while running, if you want to delete all data, please run the code below in Auto.js
`SkyAutoPlayerScript` will store data while running, if you want to delete all data, please run the code below in AutoX
```
storages.remove("StageGuard:SkyAutoPlayer:Config");
@@ -192,7 +194,7 @@ Welcome everyone to contribute this project, including pull request, issue, new
### ⚠WARNING
CodeFactor Evaluation: [![CodeFactor](https://www.codefactor.io/repository/github/stageguard/skyautoplayerscript/badge)](https://www.codefactor.io/repository/github/stageguard/skyautoplayerscript)
Because of the limitation of Auto.js, it is impossible to extract functions and method so all functions are defined in a single file. Also, my coding skill is poor, so it is `a little hard` to understand source code.
This program is a single-file project which means all modules are in a single file. Also, my coding skill is poor, so it is `a little hard` to understand source code.
## Contributor
@@ -260,7 +262,7 @@ None
# LICENSE
```
SkyAutoPlayer (Auto.js script)
SkyAutoPlayer (AutoX script)
Copyright © 2020-2021 StageGuard
This library is free software; you can redistribute it and/or

View File

@@ -2,7 +2,7 @@
English: [README-en.md](README-en.md)
使用 Auto.js 提供的无障碍权限实现在 Sky光遇 中自动弹奏 [SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio) 导出的曲谱
使用 [AutoX](https://github.com/kkevsekk1/AutoX) 提供的无障碍权限实现在 Sky光遇 中自动弹奏 [SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio) 导出的曲谱
[![shared sheet](https://badgen.net/badge/shared%20sheets/175%20in%20total/green)](shared_sheets/) [![sheet contributors](https://badgen.net/badge/sheet%20contributors/36/pink)](#共享乐谱) [![Hosted in](https://badgen.net/badge/CDN/jsDelivr?icon=jsdelivr)](https://www.jsdelivr.com/)
@@ -24,11 +24,13 @@ English: [README-en.md](README-en.md)
## 使用
1. Auto.js `4.1.1 Alpha2 (461) -> armeabi-v7a` 版本下载: [`Ericwyn/Auto.js/releases@V4.1.1.Alpha2`](https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2)
1. 在 [Releases · kkevsekk1/AutoX](https://github.com/kkevsekk1/AutoX/releases) 中下载 AutoX。
2. 为 Auto.js 开启**无障碍服务**和**悬浮窗权限**
> 注意:请提前悉知设备架构选择 `arm64-v8a` 或 `armeabi-v7a`,否则选择 `universal`
3. Auto.js 中新建一个脚本并粘贴以下代码并运行:
2. AutoX 开启**无障碍服务**和**悬浮窗权限**。
3. 在 AutoX 中新建一个脚本并粘贴以下代码并运行:
```javascript
"ui";
@@ -68,11 +70,13 @@ const okhttp3 = Packages["okhttp3"];
}(events.emitter(threads.currentThread())));
```
在 Auto.js 版本 `4.1.1 Alpha2 (461)` 中测试通过,**不保证其他版本的兼容性**(取决于其他版本相对于此版本的API是否有 `breaking changes`)
## 兼容性
在 AutoX 版本 `6.3.6` 中测试通过。
## 清除数据
`SkyAutoPlayerScript` 在使用过程中会产生本地数据存储,若想全部删除,请使用 Auto.js 执行以下代码
`SkyAutoPlayerScript` 在使用过程中会产生本地数据存储,若想全部删除,请使用 AutoX 执行以下代码
```
storages.remove("StageGuard:SkyAutoPlayer:Config");
@@ -188,7 +192,7 @@ Gitee 用户[嗨游圈(@vipssp)](https://gitee.com/vipssp)在**未经乐谱上
### ⚠️警告
CodeFactor 代码评估: [![CodeFactor](https://www.codefactor.io/repository/github/stageguard/skyautoplayerscript/badge)](https://www.codefactor.io/repository/github/stageguard/skyautoplayerscript)
由于 Auto.js 的限制,无法将不同的功能分离,所以所有功能在一个文件实现;再加上我糟糕的代码技能,源码会非常难读。
由于项目为单脚本文件,未将不同模块分离至文件,即所有功能在一个文件实现;再加上我糟糕的代码技能,源码会非常难读。
## 贡献者
@@ -256,7 +260,7 @@ SkyAutoplayerScript 在版本 21 已支持多语言并可以在线获取语言
# 许可证协议
```
SkyAutoPlayer (Auto.js script)
SkyAutoPlayer (AutoX script)
Copyright © 2020-2021 StageGuard
This library is free software; you can redistribute it and/or

View File

@@ -3,7 +3,7 @@
"code": "en_US",
"version": 5,
"content": {
"launch_tip_in_content": "If you can't see a diamond popup dialog,<br>make sure that Auto.js is allowed to <u><b>display pop-up window</u></b><br><br><br>Version <b>4.1.1 Alpha2</b> is recommended.<br><b>4.1.1 Alpha2</b> Download: <a href=https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2>https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2</a>",
"launch_tip_in_content": "If you can't see a diamond popup dialog,<br>make sure that AutoX is allowed to <u><b>display pop-up window</u></b>",
"launch_tip_force_exit": "FORCE EXIT",
"launch_tip_storage_on_android11": "In Android R, access private data folder of other apps is forbidden, sheet folder has set to {0}",

View File

@@ -3,7 +3,7 @@
"code": "zh_CN",
"version": 5,
"content": {
"launch_tip_in_content": "当你发现什么事情都没有发生时<br>也许你应该看看是否授予了Auto.js<u><b>悬浮窗权限</u></b><br><br><br>建议使用 <b>4.1.1 Alpha2</b> 版本!<br><b>4.1.1 Alpha2</b> 版本下载: <a href=https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2>https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2</a>",
"launch_tip_in_content": "当你发现什么事情都没有发生时<br>也许你应该看看是否授予了 AutoX<u><b>悬浮窗权限</u></b>",
"launch_tip_force_exit": "强制退出",
"launch_tip_storage_on_android11": "安卓11不允许外部应用读取应用私有文件夹乐谱文件夹移至 {0}",

View File

@@ -1,7 +1,7 @@
"ui";
"use strict";
/*
SkyAutoPlayer (Auto.js script)
SkyAutoPlayer (AutoX script)
Copyright © 2020-2021 StageGuard
Contact :
(QQ: 1355416608)
@@ -29,13 +29,13 @@
const user_agreements =
"请仔细阅读以下使用须知!\n\n" +
"1. 未充分测试若遇到BUG请酷安私信@StageGuard或新建Issue来反馈BUG\n\n" +
"2. SkyAutoplayerScript是完全免费且开源的软件/脚本(https://github.com/StageGuard/SkyAutoPlayerScript),使用 SkyAutoplayerScript 盈利的同时请标注源项目链接。\n\n" +
"3. 共享乐谱不遵守LGPL-2.1协议如您想在SkyAutoPlayer以外使用这些乐谱请自行找乐谱作者授权\n\n" +
"4. 本脚本仅可用作娱乐用途,请不要在正规场合使用本脚本(请自行体会\"正规场合\"是什么意思)若因使用本脚本所出现了一些不友好的问题与脚本作者StageGuard无关。\n\n" +
"1. 未充分测试,若遇到 BUG请酷安私信 @StageGuard 或新建 Issue 来反馈 BUG\n\n" +
"2. SkyAutoplayerScript 是完全免费且开源的软件/脚本(https://github.com/StageGuard/SkyAutoPlayerScript),使用 SkyAutoplayerScript 盈利的同时请标注源项目链接。\n\n" +
"3. 共享乐谱不遵守 LGPL-2.1 协议如您想在SkyAutoPlayer以外使用这些乐谱请自行找乐谱作者授权\n\n" +
"4. 本脚本仅可用作娱乐用途,请不要在正规场合使用本脚本(请自行体会\"正规场合\"是什么意思),若因使用本脚本所出现了一些不友好的问题,与脚本作者 StageGuard 无关。\n\n" +
"5. 脚本只能给你一时满足感而不能使你进步,请适当使用,只有真正的技术才是王道,才能使你感到快乐。\n\n" +
"6. 本脚本只是一个\"弹奏机\",并不内置曲谱,请在 GooglePlay 下载 SkyStudio 编谱。\n\n" +
"7. 本脚本的发行遵守LGPL-2.1协议,若你不了解协议内容,请访问 https://www.gnu.org/licenses 查看"
"7. 本脚本的发行遵守 LGPL-2.1 协议,若你不了解协议内容,请访问 https://www.gnu.org/licenses 查看"
;
//Script global scope
@@ -58,7 +58,7 @@ scope.dp = context.getResources().getDisplayMetrics().density;
//show error;
const error = function(text) {
console.show();
console.error("SkyAutoPlayer发生了一个错误请酷安私信@StageGuard或在github中的StageGuard/SkyAutoPlayerScript新建Issue来反馈这个BUG\n详细信息" + text);
console.error("SkyAutoPlayer发生了一个错误请酷安私信 @StageGuard 或在 Github 中的 StageGuard/SkyAutoPlayerScript 新建 Issue 来反馈这个 BUG\n详细信息" + text);
};
String.format = function() {
@@ -409,7 +409,7 @@ config = {
languages: {
zh_CN: {
launch_tip_in_content: "当你发现什么事情都没有发生时<br>也许你应该看看是否授予了Auto.js<u><b>悬浮窗权限</u></b><br><br><br>建议使用 <b>4.1.1 Alpha2</b> 版本!<br><b>4.1.1 Alpha2</b> 版本下载: <a href=https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2>https://github.com/Ericwyn/Auto.js/releases/tag/V4.1.1.Alpha2</a>",
launch_tip_in_content: "当你发现什么事情都没有发生时<br>也许你应该看看是否授予了 AutoX <u><b>悬浮窗权限</u></b>",
launch_tip_force_exit: "强制退出",
launch_tip_storage_on_android11: "安卓11不允许外部应用读取应用私有文件夹乐谱文件夹移至 {0}",

View File

@@ -2,10 +2,10 @@
"list": [{
"code": "zh_CN",
"name": "简体中文",
"version": 5
"version": 6
}, {
"code": "en_US",
"name": "English (US)",
"version": 5
"version": 6
}]
}