diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/collectionGui.js | 64 | ||||
-rw-r--r-- | render/cwGui.js | 178 | ||||
-rw-r--r-- | render/dwarvenNotifier.js | 36 | ||||
-rw-r--r-- | render/gemstoneMiningStats.js | 99 | ||||
-rw-r--r-- | render/miningAbilities.js | 95 | ||||
-rw-r--r-- | render/naturals.js | 37 | ||||
-rw-r--r-- | render/tabList.js | 39 | ||||
-rw-r--r-- | render/textGuiCreator.js | 20 |
8 files changed, 489 insertions, 79 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 96c0bf6..0d734cd 100644 --- a/render/cwGui.js +++ b/render/cwGui.js @@ -1,15 +1,37 @@ import settings from "../settings"; import constants from "../util/constants"; - +import axios from "../../axios" const cwGui = new Gui() let txt = "Please set your api key with /cw setkey (key)!" +let cwValues = [], + calcCwPerHr = false, + upTimeTrack = false, + uptime = 0, + coleweight = 0, + baseColeweight = 0, + stepsSinceLast = 0, + coleweightHr = 0, + cwValuesSum = 0, + cwInfo + + export function openCwGui() { cwGui.open() } +export function reloadColeweight() +{ + upTimeTrack = false + stepsSinceLast = 0 + cwValues = [] + uptime = 0 + ChatLib.chat(`${PREFIX}Reloaded!`) +} + + register("dragged", (dx, dy, x, y) => { if (!cwGui.isOpen()) return constants.data.x = x @@ -28,27 +50,149 @@ register("renderOverlay", () => { } if(!settings.cwToggle || constants.data.api_key == undefined) return - let coleweight = constants.data.coleweight || 0, - coleweightMessage = "", - uptimeHr = Math.floor(constants.uptime/60/60) + let coleweightMessage = "", + uptimeHr = Math.floor(uptime/60/60) coleweight > 1000 ?coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`: coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}` - if(constants.cwValues[0] != undefined && constants.upTimeTrack && constants.calcCwPerHr) + if(cwValues[0] != undefined && upTimeTrack && calcCwPerHr) { - constants.cwValuesSum = 0 - for(let i = 0; i < constants.cwValues.length; i++) - { - constants.cwValuesSum += constants.cwValues[i] - } - let eq = Math.ceil((constants.cwValuesSum*(3600/constants.uptime)) * 100) / 100 - eq != Infinity ? constants.coleweightHr = eq : constants.coleweightHr = "Calculating..." - constants.calcCwPerHr = false + cwValuesSum = 0 + for(let i = 0; i < cwValues.length; i++) + cwValuesSum += cwValues[i] + let eq = Math.ceil((cwValuesSum*(3600/uptime)) * 100) / 100 + eq != Infinity ? coleweightHr = eq : coleweightHr = "Calculating..." + calcCwPerHr = false } - if (cwGui.isOpen() || !constants.upTimeTrack) return + if (cwGui.isOpen() || !upTimeTrack) return if(uptimeHr >= 1) - Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${constants.coleweightHr}\n&aUptime: &b${uptimeHr}h ${Math.floor(constants.uptime/60) - uptimeHr*60}m\n&aColeweight Gained: &b${Math.ceil(constants.cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) + Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${coleweightHr}\n&aUptime: &b${uptimeHr}h ${Math.floor(uptime/60) - uptimeHr*60}m\n&aColeweight Gained: &b${Math.ceil(cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) else - Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${constants.coleweightHr}\n&aUptime: &b${Math.floor(constants.uptime/60)}m ${Math.floor(constants.uptime%60)}s\n&aColeweight Gained: &b${Math.ceil(constants.cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) -})
\ No newline at end of file + Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${coleweightHr}\n&aUptime: &b${Math.floor(uptime/60)}m ${Math.floor(uptime%60)}s\n&aColeweight Gained: &b${Math.ceil(cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) +}) + +register("gameLoad", () => { + axios.get(`https://ninjune.dev/api/cwinfo`) + .then(cwInfoRes => { + cwInfo = cwInfoRes.data + }) +}) + + +register("step", () => { + // updates coleweight for gui + let date_ob = new Date(), + seconds = date_ob.getSeconds() + + if(upTimeTrack == true) + uptime += 1 + if(seconds == 0 || seconds == 15 || seconds == 30 || seconds == 45) + { + try + { + let tempUuid = Player.getUUID(), + profileData = "", + tempColeweight = 0, + uuid = "" + + for(let i = 0; i < tempUuid.length; i++) + { + if(tempUuid[i] != "-") + { + uuid = uuid + tempUuid[i] + } + } + axios.get(`https://api.hypixel.net/skyblock/profiles?key=${constants.data.api_key}&uuid=${uuid}`) + .then(res => { + let eq = 0 + + for(let i=0; i < res.data.profiles.length; i+=1) + { + if(res.data.profiles[i].selected == true) + profileData = res.data.profiles[i] + } + + tempColeweight += Math.ceil((profileData.members[uuid][cwInfo.experience.name]/cwInfo.experience.req)*100) / 100 + + for(let i = 0; i < cwInfo.powder.length; i++) + { + let sourceToSearch = cwInfo.powder[i].name, + source = profileData.members[uuid].mining_core[sourceToSearch] + + if(source != undefined) + { + eq = Math.ceil(source/cwInfo.powder[i].req*100) / 100 + + if(i == 0) + { + let powder2 = profileData.members[uuid].mining_core['powder_spent_mithril'] + + if(powder2 != undefined) + eq = Math.ceil((source+powder2)/cwInfo.powder[i].req*100) / 100 + } + else + { + let powder2 = profileData.members[uuid].mining_core['powder_spent_gemstone'] + + if(powder2 != undefined) + eq = Math.ceil((source+powder2)/cwInfo.powder[i].req*100) / 100 + } + tempColeweight += eq + } + } + + for(let i = 0; i < cwInfo.collection.length; i++) + { + let sourceToSearch = cwInfo.collection[i].name, + source = profileData.members[uuid].collection[sourceToSearch] + + if(source != undefined) + { + eq = Math.ceil(source/cwInfo.collection[i].req*100) / 100 + tempColeweight += eq + } + } + for(let i = 0; i < cwInfo.miscellaneous.length; i++) + { + let sourceToSearch = cwInfo.miscellaneous[i].name + if(i == 0 || i == 1) + source = profileData.members[uuid].bestiary[sourceToSearch] + else + source = profileData.members[uuid].mining_core.crystals.jade_crystal[sourceToSearch] + if (source != undefined) + { + eq = Math.ceil(source/cwInfo.miscellaneous[i].req*100) / 100 + tempColeweight += eq + } + } + if(baseColeweight == 0) + { + baseColeweight = tempColeweight + } + else if((tempColeweight - baseColeweight) > 0) + { + cwValues.push(tempColeweight - baseColeweight) + calcCwPerHr = true + upTimeTrack = true + stepsSinceLast = 0 + baseColeweight = tempColeweight + } + else if(stepsSinceLast > 20) + { + uptime = 0 + upTimeTrack = false + stepsSinceLast = 0 + cwValues = [] + } + else + { + stepsSinceLast += 1 + } + + coleweight = Math.ceil(tempColeweight*100)/100 + }) + } + catch(e) { if (settings.debug) console.log(e)} + } +}).setFps(1)
\ No newline at end of file diff --git a/render/dwarvenNotifier.js b/render/dwarvenNotifier.js new file mode 100644 index 0000000..33739b0 --- /dev/null +++ b/render/dwarvenNotifier.js @@ -0,0 +1,36 @@ +import settings from "../settings" +import { checkInDwarven, drawTitle } from "../util/helperFunctions" +import constants from "../util/constants" +const PREFIX = constants.PREFIX + +let drawTitleState = 0, + drawTimestamp = undefined + +register("step", () => { + if(checkInDwarven() || !settings.dwarvenNotifier) return + const scoreboard = Scoreboard.getLines() + + for(let lineIndex = 0; lineIndex < scoreboard.length; lineIndex++) + { + let line = scoreboard[lineIndex].toString() + if (line.includes("☽") || line.includes("☀")) + { + let matches = /§7(\d\d?:\d\d)(am|pm)/g.exec(line) + if(matches == undefined) return ChatLib.chat("No matches.") + if(matches[1] == "12:00" && matches[2] == "am") + { + ChatLib.chat(`${PREFIX}&aA day has passed and your Skymall perk has changed!`) + drawTitleState = 1 + } + } + } +}).setDelay(10) + +register("renderOverlay", () => { + if(drawTitleState == 1) + { + titleResults = drawTitle(`&2A day has passed and your &bSkymall &2perk has changed!`, drawTimestamp, 3) + drawTitleState = titleResults.drawTitle + drawTimestamp = titleResults.drawTimestamp + } +})
\ No newline at end of file diff --git a/render/gemstoneMiningStats.js b/render/gemstoneMiningStats.js new file mode 100644 index 0000000..e86911d --- /dev/null +++ b/render/gemstoneMiningStats.js @@ -0,0 +1,99 @@ +import settings from "../settings" +import constants from "../util/constants" +import { findTick } from "../commands/calculate/tick" +import { addCommas, getSelectedProfile } from "../util/helperFunctions" +import axios from "../../axios" +const NBTTagString = Java.type("net.minecraft.nbt.NBTTagString") + + +register("itemTooltip", (lore, item) => { // this is so bad 💀 + if(!item.getLore()[0].startsWith("§o§aYour SkyBlock Profile") || !settings.gemstoneMiningStats) return + const list = new NBTTagList(item.getNBT().getCompoundTag("tag").getCompoundTag("display").getTagMap().get("Lore")), + tempList = [] + + for(let elementIndex = 0; elementIndex < list.getTagCount(); elementIndex++) + { + tempList.push(list.getStringTagAt(elementIndex)) + } + + for(let elementIndex = 0; elementIndex < list.getTagCount(); elementIndex++) + { + let element = list.getStringTagAt(elementIndex) + if(element !== ` §6⸕ Mining Speed §f${element.replace(" §6⸕ Mining Speed §f", "").replace("§", "")}` || constants.data.professional == 0) + { + if(element !== ` §6☘ Mining Fortune §f${element.replace(" §6☘ Mining Fortune §f", "").replace("§", "")}` || (constants.data.jungle_amulet == false && constants.data.fortunate == 0)) + continue + let miningFortune = element.replace(" §6☘ Mining Fortune §f", "").replace("§", ""), + replacedFortune + + if(constants.data.jungle_amulet && constants.data.fortunate > 0) + replacedFortune = parseInt(miningFortune.toString().replace(",", "")) + 10 + 5*constants.data.fortunate + else if(constants.data.jungle_amulet) + replacedFortune = parseInt(miningFortune.toString().replace(",", "")) + 10 + else + replacedFortune = parseInt(miningFortune.toString().replace(",", "")) + 5*constants.data.fortunate + + let miningFortuneText = `${element} §6(§b${addCommas(replacedFortune)}§6)` + + list.set(elementIndex, new NBTTagString(miningFortuneText)) + continue + } + let miningSpeed = parseInt(element.replace(" §6⸕ Mining Speed §f", "").replace("§", "").replace(",", "")), + professionalSpeed = miningSpeed + Math.floor(50+(constants.data.professional*5)), + miningSpeedText = `${element} §6(§b${addCommas(professionalSpeed)}§6)`, + tick + if(settings.tickSpeedBlock > 1) // may need to change if add tick blocks (good programming real) + tick = findTick(professionalSpeed, settings.tickSpeedBlock).currentBlockTick + else + tick = findTick(miningSpeed, settings.tickSpeedBlock).currentBlockTick + + list.set(elementIndex, new NBTTagString(miningSpeedText)) + list.set(elementIndex + 1, new NBTTagString(` §6⸕ Block Tick §f${Math.round(tick)}`)) // 1 new added + for(let i = elementIndex + 2; i < list.getTagCount() + 1; i++) + { + list.set(i, new NBTTagString(tempList[i - 1])) + } + } +}) + + + + +register("worldLoad", () => { + axios.get(`https://api.hypixel.net/skyblock/profiles?key=${constants.data.api_key}&uuid=${Player.getUUID()}`) + .then(res => { + let professional = getSelectedProfile(res)?.members[Player.getUUID().replace(/-/g, "")]?.mining_core?.nodes?.professional, + fortunate = getSelectedProfile(res)?.members[Player.getUUID().replace(/-/g, "")]?.mining_core?.nodes?.fortunate + + if(professional != undefined) + constants.data.professional = professional + if(fortunate != undefined) + constants.data.fortunate = fortunate + constants.data.save() + }) +}) + +register('step', () => { // idk how to get items so... + let inventoryName = Player?.getOpenedInventory()?.getName()?.toString() + if(inventoryName == undefined) return + if(inventoryName.includes("Accessory Bag ")) { + for (i = 0; i < Player.getOpenedInventory().getSize(); 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) + + +register("itemTooltip", (lore, item) => { // keeping for if api key isn't set + if(item.getLore()[0].startsWith("§o§aFortunate§r")) + constants.data.fortunate = parseInt(item.getLore()[1].replace("§5§o§7Level ", "")) + else if (item.getLore()[0].startsWith("§o§aProfessional§r")) + constants.data.professional = parseInt(item.getLore()[1].replace("§5§o§7Level ", "")) + else return + constants.data.save() +}) diff --git a/render/miningAbilities.js b/render/miningAbilities.js new file mode 100644 index 0000000..d920e50 --- /dev/null +++ b/render/miningAbilities.js @@ -0,0 +1,95 @@ +import settings from "../settings" +import constants from "../util/constants" +import { capitalizeFirst, checkInDwarven, checkInHollows, drawTitle, textGui } from "../util/helperFunctions" + +const miningAbilitiesGui = new textGui() +let activeAbilities = [] + + +export function openMiningAbilitiesGui() +{ + miningAbilitiesGui.moveGui() +} + + +register("dragged", (dx, dy, x, y) => { + if (!miningAbilitiesGui.moveGuiObject.isOpen()) return + constants.abilitydata.x = x + constants.abilitydata.y = y + constants.abilitydata.save() +}) + + +register("renderOverlay", () => { + if(!(checkInDwarven() || checkInHollows()) || !settings.miningAbilities) return + activeAbilities.forEach(ability => { + if(ability.drawTitle == 1) + { + let titleResults = drawTitle(`&6[&3&kd&6] &b&l${ability.name}&6 [&3&kd&6]`, ability.drawTimestamp) + ability.drawTitle = titleResults.drawTitle + ability.drawTimestamp = titleResults.drawTimestamp + } + }) +}) + +register("renderOverlay", () => { + if(!(checkInDwarven() || checkInHollows()) || !settings.miningAbilitiesGui) return + let leftValues = [], + rightValues = [] + + activeAbilities.forEach(ability => { + leftValues.push(`${ability.name} CD`) + rightValues.push(ability.timer + "s") + }) + + if(miningAbilitiesGui.moveGuiObject.isOpen() && leftValues.length < 1) + { + leftValues.push("Mining Speed Boost") + rightValues.push("0") + } + + miningAbilitiesGui.guiObject = {leftValues: leftValues, rightValues: rightValues} + miningAbilitiesGui.x = constants.abilitydata.x + miningAbilitiesGui.y = constants.abilitydata.y + miningAbilitiesGui.alignment = settings.miningAbilitiesAlignment + miningAbilitiesGui.renderGui() +}) + + +register("step", () => { + activeAbilities.forEach(ability => { + if(ability.timer > 0) + ability.timer -= 1 + else if (ability.drawTitle == 0) + ability.drawTitle = 1 + }) +}).setDelay(1) // delay instead of fps for accuracy ? + + +register("chat", (abilityName, event) => { + let found = false + + activeAbilities.forEach(ability => { + if(ability.name == capitalizeFirst(abilityName)) + { + found = true + drawTimestamp = undefined + ability.drawTitle = 0 + if (capitalizeFirst(abilityName) === "Pickobulus") + ability.timer = 110 + else + ability.timer = 120 + } + }) + + if (!found) + { + let object = {timer: capitalizeFirst(abilityName) === "Pickobulus" ? 110 : 120, name: capitalizeFirst(abilityName), drawTitle: 0, drawTimestamp: undefined} + + activeAbilities.push(object) + } +}).setCriteria(/&r&aYou used your &r&6(.+) &r&aPickaxe Ability!&r/g) + +register("worldLoad", () => { + activeAbilities = [] +})
\ No newline at end of file diff --git a/render/naturals.js b/render/naturals.js index 595c32d..a4d4393 100644 --- a/render/naturals.js +++ b/render/naturals.js @@ -2,37 +2,40 @@ import axios from "../../axios" import settings from "../settings" import constants from "../util/constants" import { waypointRender } from "../util/helperFunctions" -const PREFIX = constants.PREFIX -let coords = [] +let coords = [], + visibleCoords = [] - -register("step", () => { - if(constants.serverData.map != "Crystal Hollows") return +register("gameLoad", res => { axios.get(`https://ninjune.dev/api/coords`) .then((res) => { - coords = [] - res.data.filter(coord => - (((-1 * settings.naturalRange)/2 < (parseInt(Player.getX()) - coord.x)) && ((parseInt(Player.getX()) - coord.x) < settings.naturalRange/2) - && ((-1 * settings.naturalRange)/2 < (parseInt(Player.getY()) - coord.y)) && ((parseInt(Player.getY()) - coord.y) < settings.naturalRange/2) - && ((-1 * settings.naturalRange)/2 < (parseInt(Player.getZ()) - coord.z)) && ((parseInt(Player.getZ()) - coord.z) < settings.naturalRange/2)) - ).forEach(coord => { - coords.push([coord.x, coord.y, coord.z]) - }) + coords = res.data }) .catch((err) => { - console.log(err) + if(settings.debug) return console.log(err) + }) +}) + +register("step", () => { + if(constants.serverData.map != "Crystal Hollows" || !settings.showNaturals || coords.length < 1) return + visibleCoords = [] + coords.filter(coord => + (((-1 * settings.naturalRange)/2 < (parseInt(Player.getX()) - coord.x)) && ((parseInt(Player.getX()) - coord.x) < settings.naturalRange/2) + && ((-1 * settings.naturalRange)/2 < (parseInt(Player.getY()) - coord.y)) && ((parseInt(Player.getY()) - coord.y) < settings.naturalRange/2) + && ((-1 * settings.naturalRange)/2 < (parseInt(Player.getZ()) - coord.z)) && ((parseInt(Player.getZ()) - coord.z) < settings.naturalRange/2)) + ).forEach(coord => { + visibleCoords.push([coord.x, coord.y, coord.z]) }) }).setFps(1) register("renderWorld", () => { if(!settings.showNaturals) return - if(coords.length < 1) return - waypointRender(coords) + if(visibleCoords.length < 1) return + waypointRender(visibleCoords) }) register("worldUnload", () => { - coords = [] + visibleCoords = [] }) 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 diff --git a/render/textGuiCreator.js b/render/textGuiCreator.js new file mode 100644 index 0000000..e85b7e4 --- /dev/null +++ b/render/textGuiCreator.js @@ -0,0 +1,20 @@ +export function createGui(guiObject, x, y) +// format: { leftValues: [], rightValues: [] } (must have same amount of each or error). +{ + let string = "" + guiObject.leftValues.forEach((leftValue, index) => { + if(leftValue == "Uptime") + { + let uptime = guiObject.rightValues[index], + uptimeHr = Math.floor(uptime/60/60) + + if(uptimeHr >= 1) + string += `&aUptime: &b${uptimeHr}h ${Math.floor(uptime/60) - uptimeHr*60}m\n` + else + string += `&aUptime: &b${Math.floor(uptime/60)}m ${Math.floor(uptime%60)}s\n` + } + else + string += `&a${leftValue}: &b${guiObject.rightValues[index]}\n` + }) + Renderer.drawStringWithShadow(string, x, y) +}
\ No newline at end of file |