diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-13 20:24:27 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-13 20:24:27 +0800 |
commit | d16efe86f43b9216206d5b8a1194c5814385d943 (patch) | |
tree | dda35181c11a35d03238caf52ccc5921d4ff30ba /features | |
parent | 2ce1a023ff3a111793e8be00349d60a3e8b82909 (diff) | |
download | SoopyV2-d16efe86f43b9216206d5b8a1194c5814385d943.tar.gz SoopyV2-d16efe86f43b9216206d5b8a1194c5814385d943.tar.bz2 SoopyV2-d16efe86f43b9216206d5b8a1194c5814385d943.zip |
+ small fixes
+ paul ezpz checking in score calc
+ hypixel cookie clicker leaderboard + cookie saving (see top left of screen when in gui)
Diffstat (limited to 'features')
-rw-r--r-- | features/dungeonMap/index.js | 12 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 26 | ||||
-rw-r--r-- | features/globalSettings/index.js | 83 | ||||
-rw-r--r-- | features/nether/index.js | 3 |
4 files changed, 108 insertions, 16 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index fcb964b..03d99e8 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -79,13 +79,13 @@ class DungeonMap extends Feature { } this.dungeonBossImages = { - // "F1":[ + // "F1": [ // { // image: new Image(javax.imageio.ImageIO.read(new java.io.File("./config/ChatTriggers/modules/SoopyV2/features/dungeonMap/dungeonBossImages/f1.png"))), - // bounds: [[-65,70,-3],[-19,90,45]], + // bounds: [[-65, 70, -3], [-19, 90, 45]], // widthInWorld: 46, // heightInWorld: 48, - // topLeftLocation: [-64,-2] + // topLeftLocation: [-64, -2] // } // ] } @@ -788,7 +788,7 @@ class SpiritLeapOverlay { this.buttonsContainer.clearChildren() Object.keys(this.items).forEach((name, i) => { - let button = new ButtonWithArrow().setText((ChatLib.removeFormatting(name) === this.parent.lastDoorOpener ? "&4" : "&2") + "[" + this.players[ChatLib.removeFormatting(name)] + "] " + ChatLib.removeFormatting(name)).addEvent(new SoopyMouseClickEvent().setHandler(() => { + let button = new ButtonWithArrow().setText((ChatLib.removeFormatting(name) === this.parent.lastDoorOpener ? "&4" : "&2") + "[" + (this.players[ChatLib.removeFormatting(name)] || "?") + "] " + ChatLib.removeFormatting(name)).addEvent(new SoopyMouseClickEvent().setHandler(() => { Player.getContainer().click(itemsNew[name]) ChatLib.chat("Leaping to " + name) })).setLocation((i % 2) * 0.5, Math.floor(i / 2) * 0.5, 0.5, 0.5) @@ -847,7 +847,7 @@ class soopyGuiMapRendererThing extends SoopyGuiElement { let renderY = player.y / this.parentE.parent.mapScale / 128 * size//*16/this.roomWidth Renderer.translate(renderX + x + this.parentE.parent.offset[0] / 128 * size, renderY + y + this.parentE.parent.offset[1] / 128 * size, 1000) - renderLibs.drawStringCenteredShadow((player.uuid === closestPlayer?.uuid ? "&c" : "&a") + "[" + this.parentE.players[player.username] + "] " + player.username, 0, -7 * scale * 3, 2) + renderLibs.drawStringCenteredShadow((player.uuid === closestPlayer?.uuid ? "&c" : "&a") + "[" + (this.parentE.players[player.username] || "?") + "] " + player.username, 0, -7 * scale * 3, 2) /* { x: player.getX(), @@ -864,7 +864,7 @@ class soopyGuiMapRendererThing extends SoopyGuiElement { let renderY = closestPlayer.y / this.parentE.parent.mapScale / 128 * size//*16/this.roomWidth Renderer.translate(renderX + x + this.parentE.parent.offset[0] / 128 * size, renderY + y + this.parentE.parent.offset[1] / 128 * size) - renderLibs.drawStringCenteredShadow("&c" + "[" + this.parentE.players[closestPlayer.username] + "] " + closestPlayer.username, 0, -7 * scale * 3, 2) + renderLibs.drawStringCenteredShadow("&c" + "[" + (this.parentE.players[closestPlayer.username] || "?") + "] " + closestPlayer.username, 0, -7 * scale * 3, 2) } })) this.addEvent(new SoopyMouseClickEvent().setHandler((mouseX, mouseY) => { diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 64245fe..03e935b 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -142,6 +142,7 @@ class DungeonSolvers extends Feature { this.lastPings = [undefined, undefined, undefined]; this.ping = 0; this.pingI = 0; + this.ezpz = false this.arrows = []; this.blazes = []; @@ -169,6 +170,7 @@ class DungeonSolvers extends Feature { this.registerStep(true, 2, this.step).registeredWhen(() => this.isInDungeon()); this.registerStep(true, 10, this.step2).registeredWhen(() => this.isInDungeon()); + this.registerStep(false, 60 * 5, this.step_5min) this.registerEvent("worldLoad", this.onWorldLoad); this.registerEvent("renderOverlay", this.renderHud).registeredWhen(() => this.isInDungeon()); @@ -249,6 +251,18 @@ class DungeonSolvers extends Feature { this.onWorldLoad(); } + step_5min() { + fetch("http://soopymc.my.to/api/v2/mayor").json(data => { + this.ezpz = false + if (!data.success) return + if (data.data.mayor.name === "Paul") { + if (data.data.mayor.perks.some(a => a.name === "EZPZ")) { + this.ezpz = true + } + } + }) + } + calculateDungeonScore() { if (!this.FeatureManager.features["dataLoader"].class.dungeonFloor) { this.scoreElement.setText(""); @@ -283,8 +297,6 @@ class DungeonSolvers extends Feature { let crypts = parseInt(this.FeatureManager.features["dataLoader"].class.stats["Crypts"]); - let ezpz = false; - let maxSecrets = currentSecretsFound / currentSecretPercent || 50; //Actual Score Calculation @@ -304,7 +316,7 @@ class DungeonSolvers extends Feature { } else { speedScore = 0; } - let bonus = Math.min(5, crypts) + this.mimicDead * 2 + ezpz * 10; + let bonus = Math.min(5, crypts) + this.mimicDead * 2 + this.ezpz * 10; //Calculating secrets for s/s+ @@ -312,7 +324,7 @@ class DungeonSolvers extends Feature { let hypotheticalSpeedScore = speedScore //Calculating for S - let hypotheticalBonusScoreS = Math.min(5, crypts) + this.mimicDead * 2 + ezpz * 10; + let hypotheticalBonusScoreS = Math.min(5, crypts) + this.mimicDead * 2 + this.ezpz * 10; let sNeededSecrets = Math.min(maxSecrets * secretPercentRequired, Math.ceil((270 - hypotheticalSkillScore - hypotheticalBonusScoreS - hypotheticalSpeedScore - 60) * maxSecrets * secretPercentRequired / 40)); @@ -321,13 +333,13 @@ class DungeonSolvers extends Feature { let hypotheticalScoreGottenS = hypotheticalSkillScore + hypotheticalSpeedScore + hypotheticalBonusScoreS + 60 + Math.floor(Math.min(40, (40 * sNeededSecrets) / secretPercentRequired / maxSecrets)); let sCryptsNeeded = Math.max(crypts, Math.min(5, (270 - hypotheticalScoreGottenS))) hypotheticalScoreGottenS -= hypotheticalBonusScoreS - hypotheticalBonusScoreS = sCryptsNeeded + this.mimicDead * 2 + ezpz * 10 + hypotheticalBonusScoreS = sCryptsNeeded + this.mimicDead * 2 + this.ezpz * 10 hypotheticalScoreGottenS += hypotheticalBonusScoreS let sPossible = hypotheticalScoreGottenS >= 270 //Calculating for S+ - let hypotheticalBonusScoreSplus = 5 + this.mimicDead * 2 + ezpz * 10; + let hypotheticalBonusScoreSplus = 5 + this.mimicDead * 2 + this.ezpz * 10; let splusNeededSecrets = Math.ceil((300 - hypotheticalSkillScore - hypotheticalBonusScoreSplus - hypotheticalSpeedScore - 60) * maxSecrets * secretPercentRequired / 40); @@ -338,7 +350,7 @@ class DungeonSolvers extends Feature { let hypotheticalScoreGottenSPlus = hypotheticalSkillScore + hypotheticalSpeedScore + hypotheticalBonusScoreSplus + 60 + Math.floor(Math.min(40, (40 * splusNeededSecrets) / secretPercentRequired / maxSecrets)); let splusCryptsNeeded = Math.max(crypts, 5 - (hypotheticalScoreGottenSPlus - 300)) hypotheticalScoreGottenSPlus -= hypotheticalBonusScoreSplus - hypotheticalBonusScoreSplus = splusCryptsNeeded + this.mimicDead * 2 + ezpz * 10 + hypotheticalBonusScoreSplus = splusCryptsNeeded + this.mimicDead * 2 + this.ezpz * 10 hypotheticalScoreGottenSPlus += hypotheticalBonusScoreSplus //Setting hud element diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 09a85a9..11d8d9a 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -13,12 +13,15 @@ import soopyV2Server from "../../socketConnection"; import { numberWithCommas } from "../../utils/numberUtils"; import { firstLetterCapital } from "../../utils/stringUtils"; import { fetch } from "../../utils/networkUtils"; +import socketConnection from "../../socketConnection"; +import renderLibs from "../../../guimanager/renderLibs"; +import { f } from "../../../mappings/mappings"; const Files = Java.type("java.nio.file.Files") const Paths = Java.type("java.nio.file.Paths") const JavaString = Java.type("java.lang.String") const JavaLong = Java.type("java.lang.Long") -class Hud extends Feature { +class GlobalSettings extends Feature { constructor() { super() @@ -75,6 +78,82 @@ class Hud extends Feature { this.registerCommand("sweight", (user = Player.getName()) => { this.soopyWeight(user) }) + + this.lastCookies = 0 + + this.registerEvent("postGuiRender", () => { + if (Player.getContainer().getName() === "Cookie Clicker v0.01" && Player.getContainer().getStackInSlot(13)) this.renderCookie() + }) + this.registerStep(false, 1, () => { + if (Player.getContainer().getName() === "Cookie Clicker v0.01" && Player.getContainer().getStackInSlot(13)) this.tickCookie() + }) + + this.registerEvent("guiMouseClick", this.guiClicked) + } + + guiClicked(mouseX, mouseY, button, gui, event) { + if (gui.class.toString() === "class net.minecraft.client.gui.inventory.GuiChest" && Player.getContainer().getName() === "Cookie Clicker v0.01") { + + let hoveredSlot = gui.getSlotUnderMouse() + if (!hoveredSlot) return + + let hoveredSlotId = hoveredSlot[f.slotNumber] + + // logger.logMessage(hoveredSlotId, 4) + + Player.getContainer().click(hoveredSlotId, false, "MIDDLE") + cancel(event) + } + } + + tickCookie() { + let cookies = parseInt(ChatLib.removeFormatting(Player.getContainer().getStackInSlot(13).getName().split(" ")[0])) + + let cookiesGained = cookies - this.lastCookies + this.lastCookies = cookies + if (cookiesGained > 50) cookiesGained = 0 + if (cookiesGained < 1) cookiesGained = 0 + if (!cookiesGained) cookiesGained = 0 + + socketConnection.cookiesGained(cookiesGained) + } + + renderCookie() { + let cookies = parseInt(ChatLib.removeFormatting(Player.getContainer().getStackInSlot(13).getName().split(" ")[0])) + + let cookiesGained = cookies - this.lastCookies + let cookieCount = socketConnection.cookieCount + ((cookiesGained < 50 && cookiesGained > 0) ? cookiesGained : 0) + + renderLibs.drawString("Lifetime Cookies: " + numberWithCommas(cookieCount), 10, 10, 1) + + if (socketConnection.cookieData) { + // this.cookieData = { + // cookieLeaderboard: data.cookieLeaderboard, + // clickingNow: data.clickingNow + // } + + let linesOfText = [] + + linesOfText.push("---- CURRENTLY CLICKING ----") + for (let data of socketConnection.cookieData.clickingNow) { + linesOfText.push(data[0] + ": " + numberWithCommas(data[1])) + + if (linesOfText.length * 10 > Renderer.screen.getHeight() / 2) break + } + linesOfText.push("------- LEADERBOARD -------") + let i = 0 + for (let data of socketConnection.cookieData.cookieLeaderboard) { + i++ + + linesOfText.push("#" + i + " " + data[0] + ": " + numberWithCommas(data[1])) + + if (linesOfText.length * 10 > Renderer.screen.getHeight()) break + } + + for (let i = 0; i < linesOfText.length; i++) { + renderLibs.drawString(linesOfText[i], 10, 20 + 10 * i, 1) + } + } } fixNEU() { @@ -405,5 +484,5 @@ class FirstLoadingPage extends GuiPage { } module.exports = { - class: new Hud() + class: new GlobalSettings() }
\ No newline at end of file diff --git a/features/nether/index.js b/features/nether/index.js index ee75c35..0ae4c70 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -44,7 +44,8 @@ class Nether extends Feature { this.masteryTimer = new ToggleSetting("Mastery Timer", "Countdown untill a block will turn red", true, "nether_mastery_timer", this) this.speedNextBlock = new ToggleSetting("Show next block to stand on for dojo swiftness", "", true, "dojo_swiftness", this) this.tenacityLine = new ToggleSetting("Show line for fireball in dojo tenacity", "This may help you to dodge the fireballs", false, "dojo_tanacity", this) - + //TODO: Vanquisher waypoints (&r&aA &r&cVanquisher &r&ais spawning nearby!&r) + //TODO: add toggle setting for hostage waypoint this.registerCustom("packetReceived", this.packetReceived).registeredWhen(() => this.isInDojo()) this.registerStep(true, 1, this.step1S).registeredWhen(() => this.isInDojo()) this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.isInNether()) |