diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dungeonMap/index.js | 12 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 1 | ||||
-rw-r--r-- | features/hud/index.js | 18 | ||||
-rw-r--r-- | features/nether/index.js | 8 | ||||
-rw-r--r-- | features/nether/metadata.json | 2 | ||||
-rw-r--r-- | features/slayers/index.js | 43 |
6 files changed, 70 insertions, 14 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index e2e84ed..cfa4fd9 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -57,6 +57,7 @@ class DungeonMap extends Feature { this.newPuzzlesTab = [] this.mortLocationOnMap = undefined this.brBoxLoc = undefined + this.keys = 0 this.invMapImage = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB) this.renderImage = new BufferedImage(this.IMAGE_SIZE, this.IMAGE_SIZE, BufferedImage.TYPE_INT_ARGB) this.mapImage = new Image(this.renderImage) @@ -95,9 +96,17 @@ class DungeonMap extends Feature { this.bloodOpened = true }) + this.registerChat("&r${*}&r&f &r&ehas obtained &r&a&r&${*} Key&r&e!&r", () => { + this.keys++ + }) + this.registerChat("&r&eA &r&a&r&${*} Key&r&e was picked up!&r", () => { + this.keys++ + }) + this.lastDoorOpener = undefined this.registerChat("&r&a${player}&r&a opened a &r&8&lWITHER &r&adoor!&r", (player) => { this.lastDoorOpener = ChatLib.removeFormatting(player) + this.keys-- }) this.spiritLeapOverlayGui = new SpiritLeapOverlay(this) @@ -158,12 +167,13 @@ class DungeonMap extends Feature { this.brBoxLoc = undefined this.mortLocationOnMap = undefined this.bloodOpened = false + this.keys = 0 } renderWorld() { if (this.isInDungeon() && this.brBox.getValue()) { if (this.brBoxLoc && (!this.bloodOpened || !this.brBoxDisableWhenBloodOpened.getValue())) { - drawBoxAtBlock(this.brBoxLoc[0] - 1.5, 69, this.brBoxLoc[1] - 1.5, 255, 0, 0, 3, 4) + drawBoxAtBlock(this.brBoxLoc[0] - 1.5, 69, this.brBoxLoc[1] - 1.5, this.keys === 0 ? 255 : 0, this.keys === 0 ? 0 : 255, 0, 3, 4) } } } diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index f7d8e49..218642b 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -703,6 +703,7 @@ class DungeonSolvers extends Feature { } step() { + if (!TabList || !TabList.getNames()) return World.getAllPlayers().forEach((p) => { this.nameToUuid[p.getName().toLowerCase()] = p.getUUID().toString() }) diff --git a/features/hud/index.js b/features/hud/index.js index 92d91bd..b0bf45d 100644 --- a/features/hud/index.js +++ b/features/hud/index.js @@ -276,8 +276,6 @@ class Hud extends Feature { this.registerActionBar("${m}", this.actionbarMessage) - this.registerCustom("packetReceived", this.packetReceived) - this.packetMoves = 0 this.secondPackets = 0 this.tps = -2 @@ -286,12 +284,14 @@ class Hud extends Feature { this.registerStep(false, 1, this.step_1second) } - packetReceived(packet) { - this.packetMoves++ - } - step_1second() { - if (!this.lagEnabled.getValue()) return + if (!this.lagEnabled.getValue()) { + if (this.packetReceived) this.packetReceived.unregister() + return + } + if (!this.packetReceived) this.packetReceived = register("packetReceived", () => { + this.packetMoves++ + }) this.lastTps.push(this.secondPackets) if (this.lastTps.length > 10) this.lastTps.shift() if (this.tps === -2) { @@ -322,6 +322,8 @@ class Hud extends Feature { this.cpsEnabledSetting.delete() this.initVariables() + + if (this.packetReceived) this.packetReceived.unregister() } renderHud() { @@ -542,7 +544,7 @@ class Hud extends Feature { if (this.lastStatData.itemsData.talisman_bag) { let isSoulflowCounting = false - this.lastStatData.itemsData.talisman_bag.toString().split(",").forEach(line => { + this.lastStatData.itemsData.talisman_bag.toString().split(",").forEach(line => { //omega scuffed because i cba actually using the nbt like a normal person if (isSoulflowCounting) { this.lastStatData._soulflow *= 1000 this.lastStatData._soulflow += parseInt(ChatLib.removeFormatting(line.split(` `)[0]).replace(/[^0-9]/g, "")) diff --git a/features/nether/index.js b/features/nether/index.js index 4eb6fab..a7db6bb 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -71,7 +71,9 @@ class Nether extends Feature { let blockState = this.getBlockIdFromState(packet[m.getBlockState.S23PacketBlockChange]()) let oldBlockState = this.getBlockIdFromState(World.getBlockStateAt(position)) if (oldBlockState === 20515 && blockState === 16419) { - this.blocks.push({ loc: position, time: Date.now() + 3000 }) + if (Math.abs(Player.getX() - position.getX()) <= 20 && Math.abs(Player.getY() - position.getY()) <= 20 && Math.abs(Player.getZ() - position.getZ()) <= 20) { + this.blocks.push({ loc: position, time: Date.now() + 3000 }) + } } if (blockState === 57379) { this.blocks = this.blocks.filter(b => { @@ -98,7 +100,9 @@ class Nether extends Feature { this.lastBlock = [position.getX(), position.getY(), position.getZ()] } if (oldBlockState === 20515 && blockState === 16419) { - this.blocks.push({ loc: position, time: Date.now() + 3000 }) + if (Math.abs(Player.getX() - position.getX()) <= 20 && Math.abs(Player.getY() - position.getY()) <= 20 && Math.abs(Player.getZ() - position.getZ()) <= 20) { + this.blocks.push({ loc: position, time: Date.now() + 3000 }) + } } if (blockState === 57379) { this.blocks = this.blocks.filter(b => { diff --git a/features/nether/metadata.json b/features/nether/metadata.json index 322c840..e68fb41 100644 --- a/features/nether/metadata.json +++ b/features/nether/metadata.json @@ -1,6 +1,6 @@ { "name": "Nether", - "description": "Nether features", + "description": "May cause some lag if enabled when not in nether", "isHidden": false, "isTogglable": true, "defaultEnabled": true, diff --git a/features/slayers/index.js b/features/slayers/index.js index 408c123..e5f7219 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -3,10 +3,11 @@ import Feature from "../../featureClass/class"; import { f, m } from "../../../mappings/mappings"; import { numberWithCommas, timeNumber } from "../../utils/numberUtils"; -import { drawBoxAtBlock, drawBoxAtEntity, drawFilledBox, drawLine } from "../../utils/renderUtils"; +import { drawBoxAtBlock, drawBoxAtEntity, drawCoolWaypoint, drawFilledBox, drawLine } from "../../utils/renderUtils"; import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; +import socketConnection from "../../socketConnection"; class Slayers extends Feature { constructor() { @@ -48,6 +49,8 @@ class Slayers extends Feature { this.hudElements.push(this.dulkirThingElement); + this.otherSlayerWaypoints = new ToggleSetting("Show other users slayer boss locations", "May be usefull for loot share", true, "slayer_location_other", this) + this.lastSlayerFinishes = []; this.lastSlayerExps = []; this.slayerExp = {}; @@ -104,6 +107,8 @@ class Slayers extends Feature { this.emanStartedSittingTime = -1 this.pillerE = undefined this.lastPillerDink = 0 + this.lastServer = undefined + this.slayerLocationDataH = {} this.entityAttackEventLoaded = false; this.entityAttackEventE = undefined; @@ -114,6 +119,22 @@ class Slayers extends Feature { this.registerEvent("worldLoad", this.worldLoad); this.registerEvent("renderOverlay", this.renderHud); this.registerStep(true, 2, this.step); + this.registerForge(Java.type("net.minecraftforge.client.event.RenderWorldLastEvent"), this.renderWorldLast) + } + + renderWorldLast() { + if (!this.otherSlayerWaypoints) return + Object.keys(this.slayerLocationDataH).forEach(key => { + drawCoolWaypoint(this.slayerLocationDataH[key][0][0], this.slayerLocationDataH[key][0][1], this.slayerLocationDataH[key][0][2], 255, 0, 0, { name: key + "'s boss" }) + }) + } + + slayerLocationData(loc, user) { + if (!loc) { + delete this.slayerLocationDataH[user] + return + } + this.slayerLocationDataH[user] = [loc, Date.now()] } renderHud() { @@ -202,6 +223,13 @@ class Slayers extends Feature { } } + if (this.lastServer !== this.FeatureManager.features["dataLoader"].class.stats.Server) { + this.lastServer = this.FeatureManager.features["dataLoader"].class.stats.Server; + + socketConnection.setSlayerServer(this.FeatureManager.features["dataLoader"].class.stats.Server); + } + + let lastBossSlainMessage = this.bossSlainMessage this.bossSlainMessage = false; let dis1 = false; this.dulkirThingElement.setText("") @@ -228,10 +256,16 @@ class Slayers extends Feature { //slayerExp[lastSlayerType] += lastSlayerExp } if (line.getName().includes("Boss slain!")) { + if (!lastBossSlainMessage) { + socketConnection.sendSlayerSpawnData({ loc: null, lobby: this.FeatureManager.features["dataLoader"].class.stats.Server }); + } this.bossSlainMessage = true; } if (line.getName().includes("Slay the boss!")) { + if (!this.bossSpawnedMessage) { + socketConnection.sendSlayerSpawnData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())], lobby: this.FeatureManager.features["dataLoader"].class.stats.Server }); + } if (!this.bossSpawnedMessage && !this.emanBoss) { this.nextIsBoss = Date.now(); } @@ -246,7 +280,6 @@ class Slayers extends Feature { && lineSplitThing[0].split("/").length === 2 && lineSplitThing[1] === "Kills") { let kills = lineSplitThing[0].split("/").map(a => parseInt(a)) - console.log(kills[0], kills[1]) if (kills[0] / kills[1] >= 0.9) { this.dulkirThingElement.setText(line.getName()) } @@ -474,6 +507,12 @@ class Slayers extends Feature { } else { this.slayerSpeedRatesElement.setText(""); } + + Object.keys(this.slayerLocationDataH).forEach(n => { + if (this.slayerLocationDataH[n][1] + 60000 * 3 < Date.now()) { + delete this.slayerLocationDataH[n] + } + }) } initVariables() { |