update workflow and readme

This commit is contained in:
StageGuard
2021-07-06 16:21:45 +08:00
parent 0bafed9c23
commit 18d1c8e670
3 changed files with 83 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
name: Auto update commit and sync to gitee name: Sync
on: [ push ] on: [ push ]

View File

@@ -27,25 +27,48 @@ There are many features in SkyAutoPlayerScript compared to other auto player scr
```javascript ```javascript
"ui"; "ui";
"use strict"; "use strict";
var emitter = events.emitter(threads.currentThread()); /*
threads.start(function() { SkyAutoPlayer (Auto.js script)
emitter.emit("evaluate", (function(){ Copyright © 2020-2021 StageGuard
var resp = http.get("https://gitee.com/stageguard/SkyAutoPlayerScript/raw/master/source/SkyAutoplayer.js");
if(resp.statusCode >= 200 && resp.statusCode < 300) { This library is free software; you can redistribute it and/or
return resp.body.string(); modify it under the terms of the GNU Lesser General Public
} else { License as published by the Free Software Foundation; either
resp = http.get("https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript@" + http.get("https://gitee.com/stageguard/SkyAutoPlayerScript/raw/master/gitVersion").body.string() + "/source/SkyAutoplayer.js"); version 2.1 of the License, or (at your option) any later version.
if(resp.statusCode >= 200 && resp.statusCode < 300) {
return resp.body.string(); This library is distributed in the hope that it will be useful,
} else { but WITHOUT ANY WARRANTY; without even the implied warranty of
return "console.show();console.log(\"Failed to load script\")"; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
(function(emitter) {
threads.start(function () {
emitter.emit("evaluate", (function () {
//Many sources
let sources = [
"http://cdn.stagex.top:8090/StageGuard/SkyAutoPlayerScript/raw/master/source/SkyAutoplayer.js",
"https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript/source/SkyAutoplayer.js",
"https://dl.skyautoplayerscript.stageguard.top/source/SkyAutoplayer.js",
"https://raw.githubusercontent.com/StageGuard/SkyAutoPlayerScript/master/source/SkyAutoplayer.js"
];
for (let i in sources) {
let resp = http.get(sources[i]);
if (resp.statusCode >= 200 && resp.statusCode < 300) {
return resp.body.string();
}
} }
} return "console.show();console.log(\"Failed to load script\")";
}())); }()));
}); });
emitter.on('evaluate', function(s){ emitter.on('evaluate', function (s) {
eval(s); eval(s);
}); });
}(events.emitter(threads.currentThread())));
``` ```
## Clear data ## Clear data

View File

@@ -31,25 +31,48 @@ English: [README-en.md](README-en.md)
```javascript ```javascript
"ui"; "ui";
"use strict"; "use strict";
var emitter = events.emitter(threads.currentThread()); /*
threads.start(function() { SkyAutoPlayer (Auto.js script)
emitter.emit("evaluate", (function(){ Copyright © 2020-2021 StageGuard
var resp = http.get("https://gitee.com/stageguard/SkyAutoPlayerScript/raw/master/source/SkyAutoplayer.js");
if(resp.statusCode >= 200 && resp.statusCode < 300) { This library is free software; you can redistribute it and/or
return resp.body.string(); modify it under the terms of the GNU Lesser General Public
} else { License as published by the Free Software Foundation; either
resp = http.get("https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript@" + http.get("https://gitee.com/stageguard/SkyAutoPlayerScript/raw/master/gitVersion").body.string() + "/source/SkyAutoplayer.js"); version 2.1 of the License, or (at your option) any later version.
if(resp.statusCode >= 200 && resp.statusCode < 300) {
return resp.body.string(); This library is distributed in the hope that it will be useful,
} else { but WITHOUT ANY WARRANTY; without even the implied warranty of
return "console.show();console.log(\"Failed to load script\")"; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
(function(emitter) {
threads.start(function () {
emitter.emit("evaluate", (function () {
//Many sources
let sources = [
"http://cdn.stagex.top:8090/StageGuard/SkyAutoPlayerScript/raw/master/source/SkyAutoplayer.js",
"https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript/source/SkyAutoplayer.js",
"https://dl.skyautoplayerscript.stageguard.top/source/SkyAutoplayer.js",
"https://raw.githubusercontent.com/StageGuard/SkyAutoPlayerScript/master/source/SkyAutoplayer.js"
];
for (let i in sources) {
let resp = http.get(sources[i]);
if (resp.statusCode >= 200 && resp.statusCode < 300) {
return resp.body.string();
}
} }
} return "console.show();console.log(\"Failed to load script\")";
}())); }()));
}); });
emitter.on('evaluate', function(s){ emitter.on('evaluate', function (s) {
eval(s); eval(s);
}); });
}(events.emitter(threads.currentThread())));
``` ```
在Auto.js版本 `4.1.1 Alpha2 (461)` 中测试通过,**不保证其他版本的兼容性**(取决于其他版本相对于此版本的API是否有`breaking changes`) 在Auto.js版本 `4.1.1 Alpha2 (461)` 中测试通过,**不保证其他版本的兼容性**(取决于其他版本相对于此版本的API是否有`breaking changes`)