diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-05 10:00:20 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-05 10:00:20 +0800 |
commit | e2f1ef15eff6433b1afacf5f79b1fc97218fc290 (patch) | |
tree | 59ab045541097074ff6f6f0031534e0f0df1368e /src/features/changeLogGUI | |
parent | bb3f4a4c373fef85a087848f1658e949e7a0af4e (diff) | |
download | SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.gz SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.tar.bz2 SoopyV2-e2f1ef15eff6433b1afacf5f79b1fc97218fc290.zip |
bettermap download command!
Diffstat (limited to 'src/features/changeLogGUI')
-rw-r--r-- | src/features/changeLogGUI/index.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/features/changeLogGUI/index.js b/src/features/changeLogGUI/index.js index d8287ea..43e34c8 100644 --- a/src/features/changeLogGUI/index.js +++ b/src/features/changeLogGUI/index.js @@ -33,6 +33,50 @@ class ChangeLogGui extends Feature { this.registerStep(false, 60 * 5, () => { this.ChangelogPage.loadChangeLog() }) + + this.registerCommand("downloadbettermap", () => { + new Thread(() => { + ChatLib.chat("Downloading...") + + let url = FileLib.getUrlContent("http://soopy.dev/api/bettermap/downloadurl") + + new File("./config/ChatTriggers/modules/BetterMapTempDownload").mkdir() + + this.ChangelogPage.urlToFile(url, "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", 10000, 20000) + + FileLib.unzip("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/") + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMap")) + + new File("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/BetterMap").renameTo(new File("./config/ChatTriggers/modules/BetterMap")) + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMapTempDownload")) + + ChatLib.command("ct load", true) + }).start() + }) + + this.registerCommand("updatebettermap", () => { + new Thread(() => { + ChatLib.chat("Updating...") + + let url = FileLib.getUrlContent("http://soopy.dev/api/bettermap/downloadurl") + + new File("./config/ChatTriggers/modules/BetterMapTempDownload").mkdir() + + this.ChangelogPage.urlToFile(url, "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", 10000, 20000) + + FileLib.unzip("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap.zip", "./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/") + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMap")) + + new File("./config/ChatTriggers/modules/BetterMapTempDownload/BetterMap/BetterMap").renameTo(new File("./config/ChatTriggers/modules/BetterMap")) + + FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/BetterMapTempDownload")) + + ChatLib.command("ct load", true) + }).start() + }) } worldLoad() { |