From 381214462080012b4f6842473887127bd0b59e07 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Sun, 21 Aug 2022 23:56:07 +0800 Subject: + nearby slayer miniboss hud = fixed a typo (you -> your) in line:51 + nearby slayer miniboss hud (y dist. < 6, monster y level lowered to ground) --- features/slayers/index.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 442c6f3..288d599 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -48,7 +48,7 @@ class Slayers extends Feature { this.slayerXpElement = new HudTextElement() .setText("&6Slayer&7> &fLoading...") .setToggleSetting(this.slayerXpGuiElement) - .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of you current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant")); + .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of your current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant")); this.hudElements.push(this.slayerXpElement); this.MinibossAlert = new ToggleSetting("Alert when miniboss spawned nearby", "Pops up notification when a miniboss spawned", false, "miniboss_title_ping", this).contributor("EmeraldMerchant"); @@ -57,6 +57,13 @@ class Slayers extends Feature { this.BoxAroundAreaMiniboss = new ToggleSetting("Draws boxes around area minibosses", "eg. Voidling Extremist in void sepulture", false, "box_around_area_mini", this).contributor("EmeraldMerchant"); this.MinibossOffWhenBoss = new ToggleSetting("Disable miniboss features when your boss spawned", "this will boost your fps a little bit during boss", true, "miniboss_off_when_boss", this).contributor("EmeraldMerchant"); + this.MinibossGuiElement = new ToggleSetting("Lists Nearby Miniboss HP on Screen", "This will help you to know if theres miniboss nearby/ know their hp", true, "miniboss_hud", this).contributor("EmeraldMerchant"); + this.MinibossElement = new HudTextElement() + .setText("") + .setToggleSetting(this.MinibossGuiElement) + .setLocationSetting(new LocationSetting("Nearby Miniboss HP Location", "Allows you to edit the location of Nearby Miniboss HP hud", "miniboss_hud_location", this, [10, 50, 1, 1]).requires(this.MinibossGuiElement).editTempText("&5Voidling Radical &a25M&c❤").contributor("EmeraldMerchant")); + this.hudElements.push(this.MinibossElement); + this.betterHideDeadEntity = new ToggleSetting("Also hides mob nametag when it's dead.", "An improvement for Skytils's hide dead entity", false, "hide_dead_mob_nametag", this); this.beaconSoundType = { @@ -412,7 +419,7 @@ class Slayers extends Feature { drawBoxAtEntity(x[0], 0, 1, 0, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false); }) - + this.areaMiniEntity.forEach((x) => { drawBoxAtEntity(x[0], this.areaColor[x[1]].r, this.areaColor[x[1]].g, this.areaColor[x[1]].b, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false); }) @@ -506,7 +513,8 @@ class Slayers extends Feature { this.areaMiniEntity.push([name, this.lastSlayerType]); } if (this.betterHideDeadEntity.getValue()) { - if (nameSplit[nameSplit.length - 1].startsWith("0") && nameSplit[nameSplit.length - 1].endsWith("❤")) { + let lastArgs = nameSplit[nameSplit.length - 1] + if (lastArgs.startsWith("0") && lastArgs.endsWith("❤")) { name.getEntity()[m.setAlwaysRenderNameTag](false) } } @@ -789,6 +797,18 @@ class Slayers extends Feature { } else { this.emanHpElement.setText(""); } + + if (this.MinibossGuiElement.getValue() && !this.bossSpawnedMessage && this.minibossEntity.length > 0) { + let PY = Player.getY() + let tempArray = [] + this.minibossEntity.forEach((x) => {//this.SlayerHeight[slayerType] values are negative + if (Math.abs((x[0].getY() + this.SlayerHeight[x[1]] - PY)) > 6) return + let name = x[0].getName() + if (name.split(" ")[2] === "§e0§c❤") return + tempArray.push(name) + }) + this.MinibossElement.setText(tempArray.join("\n")) + } else this.MinibossElement.setText("") if (this.pillerE) { if (this.pillerE.getEntity()[f.isDead]) this.pillerE = undefined -- cgit From 6c5718a0d213ebf0e1a727e369e1d310bfb8ff9a Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Mon, 22 Aug 2022 00:27:09 +0800 Subject: prevent duplicated lines in miniboss hud --- features/slayers/index.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 288d599..d090e9b 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -801,10 +801,13 @@ class Slayers extends Feature { if (this.MinibossGuiElement.getValue() && !this.bossSpawnedMessage && this.minibossEntity.length > 0) { let PY = Player.getY() let tempArray = [] + let tempEntity = [] this.minibossEntity.forEach((x) => {//this.SlayerHeight[slayerType] values are negative + if (tempEntity.includes(x)) return if (Math.abs((x[0].getY() + this.SlayerHeight[x[1]] - PY)) > 6) return let name = x[0].getName() if (name.split(" ")[2] === "§e0§c❤") return + tempEntity.push(x) tempArray.push(name) }) this.MinibossElement.setText(tempArray.join("\n")) -- cgit From e91835e466ea5112c5cb93d61dbea6c4268539e8 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Mon, 22 Aug 2022 00:41:30 +0800 Subject: oops its x[0] not x --- features/slayers/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index d090e9b..3a06139 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -800,14 +800,15 @@ class Slayers extends Feature { if (this.MinibossGuiElement.getValue() && !this.bossSpawnedMessage && this.minibossEntity.length > 0) { let PY = Player.getY() + let minis = this.minibossEntity let tempArray = [] let tempEntity = [] - this.minibossEntity.forEach((x) => {//this.SlayerHeight[slayerType] values are negative - if (tempEntity.includes(x)) return + minis.forEach((x) => {//this.SlayerHeight[slayerType] values are negative + if (tempEntity.includes(x[0])) return if (Math.abs((x[0].getY() + this.SlayerHeight[x[1]] - PY)) > 6) return let name = x[0].getName() if (name.split(" ")[2] === "§e0§c❤") return - tempEntity.push(x) + tempEntity.push(x[0]) tempArray.push(name) }) this.MinibossElement.setText(tempArray.join("\n")) -- cgit