diff --git a/cclive/js/downloads.js b/cclive/js/downloads.js index 31ecf4c..aa19170 100644 --- a/cclive/js/downloads.js +++ b/cclive/js/downloads.js @@ -1,5 +1,10 @@ -const CURSEFORGE = 'https://api.curse.tools/v1/cf/mods/946253'; +const CF_KEY = '$2a$10$Sfn.ovCOUBg24FD1sBI/fe2cuWc2p/o6o7tVpWtNcnfDcyfjaqxTC'; +// this api key is provided by @Josh and is for public use +// no worries if it is leaked + +const CURSEFORGE = 'https://api.curseforge.com/v1/mods/946253'; +const CURSEFORGE_2 = 'https://api.curse.tools/v1/cf/mods/946253'; const MODRINTH = 'https://api.modrinth.com/v2/project/clickcrystals'; const GITHUB = 'https://api.github.com/repos/clickcrystals-development/ClickCrystals/releases'; const PLANETMC = 'https://www.planetminecraft.com/mod/clickcrystal'; @@ -24,6 +29,22 @@ function getDownloads() { } async function getCurseForge(done) { + fetch(CURSEFORGE, { + method: 'GET', + headers: { + Accept: 'application/json', + 'X-API-Key': CF_KEY + } + }) + .then(res => res.json()) + .then(res => { + dlsCurseForge = res.data.downloadCount; + console.log(dlsCurseForge); + done(); + }) +} + +async function getCurseForge2(done) { fetch(CURSEFORGE, headers) .then(res => res.json()) .then(res => { diff --git a/clickcrystals/bulletin.html b/clickcrystals/bulletin.html index 7972ab9..7d7aa8e 100644 --- a/clickcrystals/bulletin.html +++ b/clickcrystals/bulletin.html @@ -18,7 +18,8 @@ {"title": "Release 1.2.5", "desc": "1.21 SUPPORT! New UPDATE!", "fields": [{"title": "Fresh Animations!", "desc": "GUI now animates in and out, along with many other widgets."}, {"title": "New Module", "desc": "SelfGlow by I-No-One"}, {"title": "Scripting Syntax", "desc": "Added new scripts, hotbar hotkeys now possible! Also key inputs and detections are also now possible!"}, {"title": "And much more!", "desc": "Download 1.2.5 for Minecraft Versions 1.20-1.21 NOW!"}]}, {"title": "&bRelease 1.2.6", "desc": "Script entity referencing!", "fields": [{"title": "WIKI HAS BEEN UPDATED", "desc": "Tons of conditions and a few commands to make script experience smoother."}, {"title": "&fEntity referencing!", "desc": "You can now check other player's or entity's armor or held items, and a lot more!"}]}, {"title":"Release 1.2.7","desc":"New Modules, New Script Commands, Script Patches! Find better bypasses with on pre_tick, on post_tick, and on tick!","fields":[{"title":"Patches","desc":"Patched entity_in_range not working and block ID selections with commas not working properly"},{"title":"Scripting","desc":"added script command if entity pos, increased the range for entity selection from 32 to 128, added on post_tick and on pre_tick"},{"title":"New Modules","desc":"Modules Teams, Freelook, and AutoDisconnect by I-No-One!"}]}, - {"title":"ClickCrystals Updater Is Out!","desc":"The ClickCrystals team has just launched a new repository for updating ClickCrystals. Check it out at the link below.","fields":[{"title":"&bRepository Info","desc":"This repository is dedicated to managing updates for ClickCrystals. The project is open-source, and everything just in one class! You can find all the necessary files, including the latest updates and patches, in the repository."},{"title":"&rCool Mod that:","desc":"Automated update checks and download (if needed) ClickCrystals"},{"title":"&bDownload Today!","desc":"https://github.com/clickcrystals-development/ClickCrystals-Updater"}]} + {"title":"ClickCrystals Updater Is Out!","desc":"The ClickCrystals team has just launched a new repository for updating ClickCrystals. Check it out at the link below.","fields":[{"title":"&bRepository Info","desc":"This repository is dedicated to managing updates for ClickCrystals. The project is open-source, and everything just in one class! You can find all the necessary files, including the latest updates and patches, in the repository."},{"title":"&rCool Mod that:","desc":"Automated update checks and download (if needed) ClickCrystals"},{"title":"&bDownload Today!","desc":"https://github.com/clickcrystals-development/ClickCrystals-Updater"}]}, + {"title":"Release 1.2.8","desc":"Check out the new release 1.2.8!","fields":[{"title":"Scripting","desc":"if hunger, if jumping"},{"title":"Patches","desc":"fix while cmd not working when scheduled under wait cmd, fix online scripts and online configs downtime, fix hand swing on team detector module # i no one, fix auto disconnect players in render distance check # i no one"},{"title":"GUI","desc":"new online scripts screen"},{"title":"Add","desc":"setting to disable loading screen, setting to disable modules from printing in chat, mod menu integration and an option to disable it in advanced settings # i no one"}]} ] } diff --git a/clickcrystals/info.html b/clickcrystals/info.html index 0543440..ab73eb8 100644 --- a/clickcrystals/info.html +++ b/clickcrystals/info.html @@ -1,6 +1,6 @@ { - "latest": "1.2.7", - "motd": "Update 1.2.7, New Modules, New Script Commands, Script Patches! Find better bypasses with on pre_tick, on post_tick, and on tick!", + "latest": "1.2.8", + "motd": "&bCheck out the new update 1.2.8, new online script screen. Custom loading screen disabler, and mod menu integration!", "versionMappings": { "1.21": "1.21", diff --git a/clickcrystals/tools/bulletin2.html b/clickcrystals/tools/bulletin2.html new file mode 100644 index 0000000..88ee94f --- /dev/null +++ b/clickcrystals/tools/bulletin2.html @@ -0,0 +1,26 @@ + + + + + + ClickCrystals | Bulletin2 + + + + + + +

ClickCrystals Bulletin Generator v2

+
+
+

Input: Markdown

+ +
+
+

Output: JSON

+ +
+
+ + + diff --git a/clickcrystals/tools/bulletin2/css/bulletin2.css b/clickcrystals/tools/bulletin2/css/bulletin2.css new file mode 100644 index 0000000..0ab0cff --- /dev/null +++ b/clickcrystals/tools/bulletin2/css/bulletin2.css @@ -0,0 +1,46 @@ +body { + background-color: black; + margin: 0; + padding: 0; + + color: white; + + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +h1 { + text-align: center; + margin-top: 50px; +} + +.textareas { + width: fit-content; + margin: auto; + margin-top: 20px; +} +#output { + background-color: rgb(45, 44, 44); + color: white; + font-family: 'Courier New', Courier, monospace; +} +#input { + background-color: rgb(215, 209, 209); + color: black; + font-size: 17px; +} + +textarea { + padding: 10px; + border: none; + resize: none; + background-color: darkgray; + border-radius: 10px; + width: 500px; + height: 400px; + margin: 10px; +} + +.text { + display: inline-block; + text-align: center; +} \ No newline at end of file diff --git a/clickcrystals/tools/bulletin2/js/bulletin2.js b/clickcrystals/tools/bulletin2/js/bulletin2.js new file mode 100644 index 0000000..ab57357 --- /dev/null +++ b/clickcrystals/tools/bulletin2/js/bulletin2.js @@ -0,0 +1,75 @@ + +const input = document.getElementById('input'); +const output = document.getElementById('output'); + +document.addEventListener('keyup', onKeyPress); + +function onKeyPress(e) { + var ann = readMarkdown(input.value); + output.value = JSON.stringify(ann); +} + + +function readMarkdown(str) { + var lines = str.split('\n'); + var title = "Release "; + var desc = "Check out the new release, ClickCrystals v!"; + var fields = []; + + var currentField = null; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + if (line.trim().length == 0) + continue; + if (line.match(/\s*```\w*\s*/gm) != null) + continue; + + if (line.match(/\s*Version:\s*.+\s*/gmi) != null) { + line = line.replace(/\s*Version:\s*/gmi, ''); + title = "Release " + line + desc = "Check out the new release, ClickCrystals v" + line + "!"; + } + else if (line.match(/\s*Desc(ription)?:\s*.+\s*/gmi) != null) { + line = line.replace(/\s*Desc(ription)?:\s*/gmi, ''); + desc = line + } + else if (line.match(/\s*.+:\s*/gm) != null) { + line = line.trim().replace(/:/, ''); + if (currentField != null) + fields.push(currentField); + currentField = new Field(line, ''); + } + else if (line.match(/\s*-\s*.+\s*/gm) != null) { + line = line.trim().replace(/\s*-\s*/, ''); + if (currentField != null) { + currentField.desc += currentField.desc.length == 0 ? '' : ', '; + currentField.desc += line; + } + } + } + + return new Ann(title, desc, fields); +} + +class Ann { + title + desc + fields + + constructor(title, desc, fields) { + this.title = title; + this.desc = desc; + this.fields = fields; + } +} + +class Field { + title + desc + + constructor(title, desc) { + this.title = title; + this.desc = desc; + } +} \ No newline at end of file