diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/collectionGui.js | 64 | ||||
-rw-r--r-- | render/cwGui.js | 2 | ||||
-rw-r--r-- | render/downtimeGui.js | 14 | ||||
-rw-r--r-- | render/gemstoneMiningStats.js | 66 | ||||
-rw-r--r-- | render/tabList.js | 39 |
5 files changed, 132 insertions, 53 deletions
diff --git a/render/collectionGui.js b/render/collectionGui.js index 8197b11..4e6deee 100644 --- a/render/collectionGui.js +++ b/render/collectionGui.js @@ -1,43 +1,53 @@ -/*import constants from "../util/constants" +import constants from "../util/constants" +import settings from "../settings" +import { trackerGui } from "../util/helperFunctions" const PREFIX = constants.PREFIX +const collectionMoveGui = new Gui() +const collectionGui = new trackerGui("", "Collection Not set! /cw track", settings.collectionNotation) -let collectionGui = new Gui(), - collection = "" export function trackCollection(arg) { - switch(arg) - { - case "obby": - case "obsidian": - collection = "OBSIDIAN" - break - default: - ChatLib.chat(`${PREFIX}&eThat is not a valid collection! (or is not supported)`) - } + collectionGui.resetVars() + let collections = JSON.parse(FileLib.read("Coleweight", "data/collections.json")) + if(arg == "obby") arg = "obsidian" + if(arg == "cobble") arg = "cobblestone" + if(collections[arg.toLowerCase()] == undefined) return ChatLib.chat(`${PREFIX}&eThat is not a valid collection! (or is not supported)`) + collectionGui.trackedItem = collections[arg].collectionToTrack + collectionGui.itemStringed = collections[arg].collectionStringed + + ChatLib.chat(`${PREFIX}&bSet collection to ${collectionGui.itemStringed}!`) +} + +export function openCollectionGui() +{ + collectionGui.moveGui() } -export function moveCollection() +export function reloadCollection() { - collectionGui.open() + collectionGui.resetVars() } register("dragged", (dx, dy, x, y) => { - if (!collectionGui.isOpen()) return - constants.data.collectionX = x - constants.data.collectionY = y - constants.data.save() + if (!collectionGui.collectionMoveGui.isOpen()) return + constants.collectiondata.x = x + constants.collectiondata.y = y + constants.collectiondata.save() }) register("renderOverlay", () => { - if (cwGui.isOpen()) + collectionGui.renderGui(constants.collectiondata.x, constants.collectiondata.y, settings.collectionNotation, settings.collectionTracker) +}) + +register("step", () => { + let date_ob = new Date(), + seconds = date_ob.getSeconds() + + if(collectionGui.trackingItem == true) + collectionGui.uptimeSeconds += 1 + if(seconds == 0 || seconds == 15 || seconds == 30 || seconds == 45) { - let txt = "Please set your api key with /cw setkey (key)!" - if (constants.data.api_key != undefined) - txt = "Click anywhere to move!" - Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2) - Renderer.drawStringWithShadow(`&aCollection: &b0\n&aCW/hr: &b0\n&aUptime: &b0m\n&aColeweight Gained: &b0`, constants.data.collectionX, constants.data.collectionY) + collectionGui.calcApi(["members", Player.getUUID().replace(/-/g, ""), "collection"], Player.getUUID()) } - if(collection == "") return - coleweight > 1000 ?collectionMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`: coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}` -})*/
\ No newline at end of file +}).setFps(1)
\ No newline at end of file diff --git a/render/cwGui.js b/render/cwGui.js index 5af6773..0695e1c 100644 --- a/render/cwGui.js +++ b/render/cwGui.js @@ -21,7 +21,7 @@ export function openCwGui() } -export function reload() +export function reloadColeweight() { upTimeTrack = false stepsSinceLast = 0 diff --git a/render/downtimeGui.js b/render/downtimeGui.js index 538c590..e11c376 100644 --- a/render/downtimeGui.js +++ b/render/downtimeGui.js @@ -21,9 +21,9 @@ export function openDowntimeGui() register("dragged", (dx, dy, x, y) => { if (!downtimeMoveGui.isOpen()) return - constants.downtimedata.x = x - constants.downtimedata.y = y - constants.downtimedata.save() + constants.collectiondata.x = x + constants.collectiondata.y = y + constants.collectiondata.save() }) register('actionbar', (xp) => { @@ -57,16 +57,16 @@ register("renderOverlay", () => { let txt = "Drag to move." Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2) downtimeGui.guiObject = {leftValues: ["Downtime", "Overall Downtime", "Average Downtime", "Uptime"], rightValues: [0, 0, 0, 0]} - downtimeGui.x = constants.downtimedata.x - downtimeGui.y = constants.downtimedata.y + downtimeGui.x = constants.collectiondata.x + downtimeGui.y = constants.collectiondata.y downtimeGui.renderGui() return } if (downtimeCount == 0 || !trackingDowntime || !settings.downtimeTracker) return let avgDowntime = Math.ceil((overallDowntime/downtimeCount)*100) / 100 downtimeGui.guiObject = {leftValues: ["Downtime", "Overall Downtime", "Average Downtime", "Uptime"], rightValues: [downtime, overallDowntime, avgDowntime, uptime]} - downtimeGui.x = constants.downtimedata.x - downtimeGui.y = constants.downtimedata.y + downtimeGui.x = constants.collectiondata.x + downtimeGui.y = constants.collectiondata.y downtimeGui.renderGui() }) diff --git a/render/gemstoneMiningStats.js b/render/gemstoneMiningStats.js new file mode 100644 index 0000000..a44937c --- /dev/null +++ b/render/gemstoneMiningStats.js @@ -0,0 +1,66 @@ +import settings from "../settings" +import constants from "../util/constants" +const NBTTagString = Java.type("net.minecraft.nbt.NBTTagString") + + +register("itemTooltip", (lore, item) => { // this is so bad 💀 + if(item.getLore()[0] != "§o§aYour SkyBlock Profile§r" || !settings.gemstoneMiningStats) return + const list = new NBTTagList(item.getNBT().getCompoundTag("tag").getCompoundTag("display").getTagMap().get("Lore")) + + for(let index = 0; index < list.getTagCount(); index++) + { + let element = list.getStringTagAt(index) + if(element !== ` §6⸕ Mining Speed §f${element.replace(" §6⸕ Mining Speed §f", "").replace("§", "")}` || constants.data.professional == 0) + continue + let miningSpeed = element.replace(" §6⸕ Mining Speed §f", "").replace("§", ""), + professionalSpeed = parseInt(miningSpeed.toString().replace(",", "")) + Math.floor(50+(constants.data.professional*5)), + miningSpeedText = `${element} §6(§b${professionalSpeed}§6)` + + list.set(index, new NBTTagString(miningSpeedText)) + } + + for(let i = 0; i < list.getTagCount(); i++) + { + let element = list.getStringTagAt(i) + if(element !== ` §6☘ Mining Fortune §f${element.replace(" §6☘ Mining Fortune §f", "").replace("§", "")}` || constants.data.jungle_amulet == false) + continue + let miningFortune = element.replace(" §6☘ Mining Fortune §f", "").replace("§", ""), + replacedFortune = parseInt(miningFortune.toString().replace(",", "")) + 10, + miningFortuneText = `${element} §6(§b${replacedFortune}§6)` + + list.set(i, new NBTTagString(miningFortuneText)) + } +}) + + +register("itemTooltip", (lore, item) => { + if(item.getLore()[0] != "§o§aProfessional§r") return + constants.data.professional = parseInt(item.getLore()[1].replace("§5§o§7Level ", "")) + constants.data.save() +}) + + +register('step', () => { + let inventoryName = Player?.getOpenedInventory()?.getName()?.toString() + if(inventoryName == undefined) return + if(inventoryName.includes("Acessory Bag ")) { + for (i = 0; i < Player.getOpenedInventory().size; i++) { + let extraAttributes = Player.getOpenedInventory().getStackInSlot(i)?.getNBT()?.getCompoundTag("tag")?.getCompoundTag("ExtraAttributes") + if (extraAttributes.getString('id') == "JUNGLE_AMULET") + { + constants.data.jungle_amulet = true + constants.data.save() + } + } + } +}).setFps(2) + + +/* +let checked = false +register("itemTooltip", (lore, item) => { + if(!settings.debug || checked) return + console.log(item.getLore()) + checked = true +}) +*/
\ No newline at end of file diff --git a/render/tabList.js b/render/tabList.js index fcf971e..aa16445 100644 --- a/render/tabList.js +++ b/render/tabList.js @@ -1,26 +1,29 @@ -/*import axios from "../../axios" // implement when im not an idiot +/*import axios from "../../axios" // â™’ import settings from "../settings" import constants from "../util/constants" const PREFIX = constants.PREFIX - +const ChatComponentText = Java.type("net.minecraft.util.ChatComponentText") register("worldLoad", () => { - const NetHandlerPlayClient = Client.getConnection(), - PlayerMap = NetHandlerPlayClient.func_175106_d() // getPlayerInfoMap + const NetHandlerPlayClient = Client.getMinecraft().func_147114_u(), + PlayerMap = NetHandlerPlayClient.func_175106_d() let tag = "" - axios.get(`https://ninjune.dev/api/mminers`) - .then((res) => { - PlayerMap.filter(player => !player.func_178845_a().name.startsWith("!")).forEach((player) => { - res.data.macroers.forEach((macroer) => { - if(player == macroer) tag ="[M] " - }) - res.data.griefers.forEach((griefer) => { - if(player == griefer) tag ="[G] " - }) - - player.func_178859_a(new net.minecraft.util.IChatComponentText("Player")) - }) + //axios.get(`https://ninjune.dev/api/mminers`) + //.then((res) => { + PlayerMap.filter(player => player.func_178853_c() > 0 && !player.func_178845_a().name.startsWith("!")).forEach((PlayerMP, index) => { + let player = PlayerMP.func_178845_a().name // getGameProfile + console.dir(PlayerMP) + PlayerMP.func_178859_a(new ChatComponentText("Hello World")) // setDisplayName; takes an IChatComponent; doesn't do anything. + PlayerMP.func_178850_i().func_96662_c("Hello World") // getPlayerTeam; setNameSuffix; doesn't do anything }) - .catch((e) => {console.log(e)}) -})*/
\ No newline at end of file + //.catch((e) => {console.log(e)}) + //}) +}) +/*res.data.macroers.forEach((macroer) => { + if(player == macroer) tag ="[M] " +}) +res.data.griefers.forEach((griefer) => { + if(player == griefer) tag ="[G] " +}) +*/
\ No newline at end of file |