diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-04-23 13:19:19 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-04-23 13:19:19 +0800 |
commit | b4111d1e0895559f800e275fbbae98a86ac11e7d (patch) | |
tree | c08770b446717a3420d45fc716b76f4e703afb03 | |
parent | 5595ba9f25365aad0c5aaa1b3641f0617d869834 (diff) | |
download | SoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.tar.gz SoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.tar.bz2 SoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.zip |
+ dulkur thingo
+ DinkDonk for piller only happens when ur boss is spawned
-rw-r--r-- | features/events/index.js | 20 | ||||
-rw-r--r-- | features/hud/index.js | 8 | ||||
-rw-r--r-- | features/nether/index.js | 38 | ||||
-rw-r--r-- | features/slayers/index.js | 62 | ||||
-rw-r--r-- | features/waypoints/index.js | 58 | ||||
-rw-r--r-- | metadata.json | 4 |
6 files changed, 140 insertions, 50 deletions
diff --git a/features/events/index.js b/features/events/index.js index 0a4287c..8ab5f86 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -1,7 +1,7 @@ /// <reference types="../../../CTAutocomplete" /> /// <reference lib="es2015" /> import Feature from "../../featureClass/class"; -import { drawBoxAtBlockNotVisThruWalls, drawCoolWaypoint, drawLine } from "../../utils/renderUtils"; +import { drawBoxAtBlock, drawBoxAtBlockNotVisThruWalls, drawCoolWaypoint, drawLine } from "../../utils/renderUtils"; import { calculateDistanceQuick } from "../../utils/utils"; import SettingBase from "../settings/settingThings/settingBase"; import ToggleSetting from "../settings/settingThings/toggle"; @@ -136,7 +136,7 @@ class Events extends Feature { return time > Date.now() - 5000 }) - if (this.showBurrialGuess.getValue() && Date.now() - this.lastDing > 500 && Date.now() - this.lastDing < 100000) { + if (this.lastParticlePoint && this.showBurrialGuess.getValue() && Date.now() - this.lastDing > 500 && Date.now() - this.lastDing < 100000) { // console.log(this.firstPitch, this.lastDingPitch, this.lastDingPitch / this.firstPitch) this.lastDing = 0 @@ -282,6 +282,22 @@ class Events extends Feature { found = true loc.lastPing = Date.now() } + if ((loc.x + 1) + "," + (loc.y + 1) + "," + loc.z === locstr) { + found = true + loc.lastPing = Date.now() + } + if ((loc.x + 1) + "," + (loc.y - 1) + "," + loc.z === locstr) { + found = true + loc.lastPing = Date.now() + } + if ((loc.x - 1) + "," + (loc.y + 1) + "," + loc.z === locstr) { + found = true + loc.lastPing = Date.now() + } + if ((loc.x - 1) + "," + (loc.y - 1) + "," + loc.z === locstr) { + found = true + loc.lastPing = Date.now() + } if ((loc.x - 1) + "," + loc.y + "," + loc.z === locstr) { found = true loc.lastPing = Date.now() diff --git a/features/hud/index.js b/features/hud/index.js index 3a17830..a4b8eb2 100644 --- a/features/hud/index.js +++ b/features/hud/index.js @@ -275,7 +275,7 @@ class Hud extends Feature { this.packetMoves = 0 this.secondPackets = 0 - this.tps = -1 + this.tps = -2 this.lastTps = [] this.registerEvent("tick", this.tick) this.registerStep(false, 1, this.step_1second) @@ -289,6 +289,10 @@ class Hud extends Feature { if (!this.lagEnabled.getValue()) return this.lastTps.push(this.secondPackets) if (this.lastTps.length > 10) this.lastTps.shift() + if (this.tps === -2) { + this.tps = -1 + this.lastTps = [] + } this.tps = this.lastTps.reduce((a, b) => a + b, 0) / this.lastTps.length this.secondPackets = 0 @@ -665,7 +669,7 @@ class Hud extends Feature { this.lastUpdatedStatData = 0 this.packetMoves = 0 this.secondPackets = 0 - this.tps = -1 + this.tps = -2 this.lastTps = [] this.lagElement.setText("&6Tps&7> &fLOADING") } diff --git a/features/nether/index.js b/features/nether/index.js index 8606284..ba4fdd0 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -15,6 +15,7 @@ class Nether extends Feature { this.initVariables(); 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.registerCustom("packetReceived", this.packetReceived) @@ -22,6 +23,19 @@ class Nether extends Feature { this.registerEvent("renderWorld", this.renderWorld) this.blocks = [] + + this.inSwiftness = false + this.lastBlock = undefined + this.registerChat("&r&r&r &r&aTest of Swiftness &r&e&lOBJECTIVES&r", () => { + if (this.speedNextBlock.getValue()) { + this.inSwiftness = true + this.lastBlock = [Math.floor(Player.getX()), Math.floor(Player.getY()) - 1, Math.floor(Player.getZ())] + } + }) + this.registerChat("&r&r&r ${*}&r&6Your Rank: &r${*}&r", () => { + this.inSwiftness = false + this.lastBlock = undefined + }) } packetReceived(packet, event) { @@ -46,14 +60,30 @@ class Nether extends Feature { //yellow=16419 //red=57379 } + if (oldBlockState === 0 && blockState === 20515 && this.inSwiftness) { + this.lastBlock = [position.getX(), position.getY(), position.getZ()] + } + } + if (packetType === "S22PacketMultiBlockChange") { + packet[m.getChangedBlocks]().forEach(b => { + let position = new BlockPos(b[m.getPos.S22PacketMultiBlockChange$BlockUpdateData]()) + let blockState = this.getBlockIdFromState(b[m.getBlockState.S22PacketMultiBlockChange$BlockUpdateData]()) + let oldBlockState = this.getBlockIdFromState(World.getBlockStateAt(position)) + if (oldBlockState === 0 && blockState === 20515 && this.inSwiftness) { + this.lastBlock = [position.getX(), position.getY(), position.getZ()] + } + }) } } renderWorld(event) { - if (!this.masteryTimer.getValue()) return - this.blocks.forEach(data => { - Tessellator.drawString(Math.max(0, (data.time - Date.now()) / 1000).toFixed(1) + "s", data.loc.getX() + 0.5, data.loc.getY() + 0.5, data.loc.getZ() + 0.5, 0, false, 0.05, false) - }) + if (this.masteryTimer.getValue()) { + this.blocks.forEach(data => { + Tessellator.drawString(Math.max(0, (data.time - Date.now()) / 1000).toFixed(1) + "s", data.loc.getX() + 0.5, data.loc.getY() + 0.5, data.loc.getZ() + 0.5, 0, false, 0.05, false) + }) + } + + if (this.lastBlock && this.inSwiftness) drawBoxAtBlock(this.lastBlock[0], this.lastBlock[1], this.lastBlock[2], 0, 255, 0, 1, 1) } step1S() { diff --git a/features/slayers/index.js b/features/slayers/index.js index 59453c1..adbb2e2 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -39,11 +39,17 @@ class Slayers extends Feature { this.hudElements.push(this.slayerSpeedRatesElement); + this.blazeTowerDink = new ToggleSetting("DinkDonk & Box for blaze tower", "(the tower might not nessesarily belong to your boss though)", true, "blaze_tower_dinkdink", this); + this.slayerProgressAlert = new ToggleSetting("Shows slayer progress in middle of screen when close", "(blame dulkir)", false, "slayer_progress_alert", this); + this.lastSlayerFinishes = []; this.lastSlayerExps = []; this.slayerExp = {}; this.slayerExpLoaded = false; + this.slayerProgressAlertText = "" + this.slayerProgressAlertTime = 0 + this.lastSlayerType = ""; this.lastSlayerExp = 0; this.lastBossSlain = 0; @@ -93,6 +99,8 @@ class Slayers extends Feature { this.nextIsBoss = 0; this.counter = 0; this.emanStartedSittingTime = -1 + this.pillerE = undefined + this.lastPillerDink = 0 this.entityAttackEventLoaded = false; this.entityAttackEventE = undefined; @@ -146,6 +154,10 @@ class Slayers extends Feature { Tessellator.drawString(ChatLib.addColor("&a&lLazer: &c&l" + Math.max(0, 8.2 - (Date.now() - this.emanStartedSittingTime) / 1000).toFixed(1)), this.emanBoss.getX(), this.emanBoss.getY() - 1.2, this.emanBoss.getZ(), 0, true, 0.04, false); } + if (this.pillerE && this.bossSpawnedMessage) { + drawBoxAtBlock(~~this.pillerE.getX() - 1, ~~this.pillerE.getY() + 2, ~~this.pillerE.getZ() - 1, 255, 0, 0, 1, -4); + } + if (this.boxToEmanBeacon.getValue()) { Object.values(this.beaconPoints).forEach((line) => { let lastPoint = undefined; @@ -223,6 +235,18 @@ class Slayers extends Feature { dis1 = true; this.bossSpawnedMessage = true; } + if (ChatLib.removeFormatting(line.getName()).trim().split(" ")[0] + && ChatLib.removeFormatting(line.getName()).trim().split(" ")[0].split("/").length == 2 + && ChatLib.removeFormatting(line.getName()).trim().split(" ")[1] === "Kills") { + let kills = ChatLib.removeFormatting(line.getName()).trim().split(" ")[0].split("/").map(a => parseInt(a)) + if (kills[0] > kills[1] - 4 || kills[0] / kills[1] > 0.95) { + this.slayerProgressAlertText = line.getName() + this.slayerProgressAlertTime = Date.now() + 1000 + } + } + // this.slayerProgressAlert + // this.slayerProgressAlertText = "" + // this.slayerProgressAlertTime = 0 }); if (!dis1) { this.lastBossNotSpawnedTime = Date.now(); @@ -273,17 +297,16 @@ class Slayers extends Feature { } } - // if (e instanceof net.minecraft.entity.item.EntityArmorStand && e[m.getCustomNameTag]()) { - // let name = e[m.getCustomNameTag]() - // let isPiller = true - // if (isPiller && name.trim().split(" ").length !== 2) isPiller = false - // if (isPiller && name.trim().split(" ")[0].split("").pop() !== "s") isPiller = false - // if (isPiller && name.trim().split(" ")[1].split("").pop() !== "s") isPiller = false - // //TODO: thus - // if (isPiller) { - // ChatLib.chat(name) - // } - // } + if (e instanceof net.minecraft.entity.item.EntityArmorStand && e[m.getCustomNameTag]() && this.blazeTowerDink.getValue()) { + let name = ChatLib.removeFormatting(e[m.getCustomNameTag]()) + let isPiller = true + if (isPiller && name.trim().split(" ").length !== 3) isPiller = false + if (isPiller && name.trim().split(" ")[0].split("").pop() !== "s") isPiller = false + if (isPiller && name.trim().split(" ")[2] !== "hits") isPiller = false + if (isPiller) { + this.pillerE = new Entity(e) + } + } } catch (_) { console.log(JSON.stringify(_, undefined, 2)); } @@ -383,6 +406,18 @@ class Slayers extends Feature { this.emanHpElement.setText(""); } + if (this.pillerE) { + if (this.pillerE.getEntity()[f.isDead]) this.pillerE = undefined + } + if (this.pillerE && ChatLib.removeFormatting(this.pillerE.getName())[1] === "s" && this.bossSpawnedMessage) { + let time = parseInt(ChatLib.removeFormatting(this.pillerE.getName())[0]); + if (Date.now() - this.lastPillerDink > time * 40) { + World.playSound("note.pling", 1, 1); + this.lastPillerDink = Date.now() + } + Client.showTitle(this.pillerE.getName(), "", 0, 20, 10); + } + if (this.emanLazerTimer.getValue() && this.actualEmanBoss && this.actualEmanBoss[m.isRiding]()) { if (this.emanStartedSittingTime === -1) { this.emanStartedSittingTime = Date.now() @@ -418,6 +453,11 @@ class Slayers extends Feature { Renderer.drawString("&4BOSS SPAWNED", Renderer.screen.getWidth() * 0.125 * scale, (Renderer.screen.getHeight() / 2 - 9 / scale) * scale); Renderer.scale(1, 1); } + if (this.slayerProgressAlert.getValue() && Date.now() > this.slayerProgressAlertTime) { + Renderer.scale(1 / scale, 1 / scale); + Renderer.drawString(this.slayerProgressAlertText, Renderer.screen.getWidth() * 0.125 * scale, (Renderer.screen.getHeight() / 2 - 9 / scale) * scale); + Renderer.scale(1, 1); + } } step() { diff --git a/features/waypoints/index.js b/features/waypoints/index.js index 8c4be05..47806ec 100644 --- a/features/waypoints/index.js +++ b/features/waypoints/index.js @@ -12,7 +12,7 @@ class Waypoints extends Feature { super() } - onEnable(){ + onEnable() { this.initVariables() new SettingBase("/addwaypoint [name] [x] [y] [z] [r?] [g?] [b?] [area?]", "Allows you to create a waypoint", undefined, "create_waypoint", this) @@ -28,68 +28,68 @@ class Waypoints extends Feature { this.registerForge(RenderWorldLastEvent, this.renderWorldLast) - this.registerCommand("addwaypoint", (name, x=Math.floor(Player.getX()).toString(), y=Math.floor(Player.getY()).toString(), z=Math.floor(Player.getZ()).toString(), r="0", g="255", b="0", area)=>{ + this.registerCommand("addwaypoint", (name, x = Math.floor(Player.getX()).toString(), y = Math.floor(Player.getY()).toString(), z = Math.floor(Player.getZ()).toString(), r = "0", g = "255", b = "0", area = "") => { let lx = 0 let ly = 0 let lz = 0 - if(Player.lookingAt().getX){ + if (Player.lookingAt().getX) { lx = Player.lookingAt().getX() ly = Player.lookingAt().getY() lz = Player.lookingAt().getZ() - if(Player.lookingAt().getWidth){ + if (Player.lookingAt().getWidth) { lx += -0.5 lz += -0.5 } } - + this.userWaypoints[name] = { x: parseFloat(x.replace("l", lx).replace('p', Math.floor(Player.getX()))), y: parseFloat(y.replace("l", ly).replace('p', Math.floor(Player.getY()))), z: parseFloat(z.replace("l", lz).replace('p', Math.floor(Player.getZ()))), - r: parseInt(r)/255, - g: parseInt(g)/255, - b: parseInt(b)/255, - area: area==="a"?this.FeatureManager.features["dataLoader"].class.area:area.replace(/_/g," "), - options: {name: ChatLib.addColor(name.replace(/_/g," "))} + r: parseInt(r) / 255, + g: parseInt(g) / 255, + b: parseInt(b) / 255, + area: area === "a" ? this.FeatureManager.features["dataLoader"].class.area : area.replace(/_/g, " "), + options: { name: ChatLib.addColor(name.replace(/_/g, " ")) } } - + this.userWaypointsArr = Object.values(this.userWaypoints) this.waypointsChanged = true - ChatLib.chat(this.FeatureManager.messagePrefix + "Added waypoint "+ name + "!") + ChatLib.chat(this.FeatureManager.messagePrefix + "Added waypoint " + name + "!") }) - this.registerCommand("delwaypoint", (name)=>{ + this.registerCommand("delwaypoint", (name) => { delete this.userWaypoints[name] this.userWaypointsArr = Object.values(this.userWaypoints) this.waypointsChanged = true - ChatLib.chat(this.FeatureManager.messagePrefix + "Deleted waypoint "+ name + "!") + ChatLib.chat(this.FeatureManager.messagePrefix + "Deleted waypoint " + name + "!") }) - this.registerCommand("clearwaypoints", ()=>{ + this.registerCommand("clearwaypoints", () => { this.userWaypoints = {} this.userWaypointsArr = [] this.waypointsChanged = true ChatLib.chat(this.FeatureManager.messagePrefix + "Cleared waypoints!") }) - this.registerCommand("savewaypoints", ()=>{ + this.registerCommand("savewaypoints", () => { Java.type("net.minecraft.client.gui.GuiScreen")[m.setClipboardString](JSON.stringify(this.userWaypoints)) ChatLib.chat(this.FeatureManager.messagePrefix + "Saved waypoints to clipboard!") }) - this.registerCommand("loadwaypoints", ()=>{ - try{ + this.registerCommand("loadwaypoints", () => { + try { this.userWaypoints = JSON.parse(Java.type("net.minecraft.client.gui.GuiScreen")[m.getClipboardString]()) - + this.userWaypointsArr = Object.values(this.userWaypoints) this.waypointsChanged = true ChatLib.chat(this.FeatureManager.messagePrefix + "Loaded waypoints from clipboard!") - }catch(e){ + } catch (e) { ChatLib.chat(this.FeatureManager.messagePrefix + "Error loading from clipboard!") } }) } - addWaypoint(x, y, z, r, g, b, options){ + addWaypoint(x, y, z, r, g, b, options) { this.waypoints.push({ x: x, y: y, @@ -101,23 +101,23 @@ class Waypoints extends Feature { }) } - renderWorldLast(){ - for(let waypoint of this.waypoints){ + renderWorldLast() { + for (let waypoint of this.waypoints) { drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, waypoint.options) } - for(let waypoint of this.userWaypointsArr){ //TODO: Performance optimisation: Make hash from waypoint.area -> waypoints[] - if(!waypoint.area || this.FeatureManager.features["dataLoader"].class.area === waypoint.area){ - drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, {...waypoint.options}) + for (let waypoint of this.userWaypointsArr) { //TODO: Performance optimisation: Make hash from waypoint.area -> waypoints[] + if (!waypoint.area || this.FeatureManager.features["dataLoader"].class.area === waypoint.area) { + drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, { ...waypoint.options }) } } } - initVariables(){ + initVariables() { this.waypoints = undefined } - onDisable(){ - if(this.waypointsChanged){ + onDisable() { + if (this.waypointsChanged) { FileLib.write("soopyAddonsData", "soopyv2userwaypoints.json", JSON.stringify(this.userWaypoints)) } diff --git a/metadata.json b/metadata.json index f0982ec..c587b96 100644 --- a/metadata.json +++ b/metadata.json @@ -5,8 +5,8 @@ "entry": "index.js", "description": "SoopyV2", "name": "SoopyV2", - "version": "2.1.53", - "versionId": 180, + "version": "2.1.54", + "versionId": 181, "requires": [ "soopyApis", "soopyAddonsData", |