From edf8d88e1c2915392f557d5b2e3dc561424ac53e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 11:42:24 +0800 Subject: options for slayer spawn kill time + options for slayer spawn kill time decimal point (eg. 1.55s) --- features/slayers/index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'features') diff --git a/features/slayers/index.js b/features/slayers/index.js index 59606a1..1814d9d 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -2,7 +2,7 @@ /// import Feature from "../../featureClass/class"; import { f, m } from "../../../mappings/mappings"; -import { numberWithCommas, timeNumber } from "../../utils/numberUtils"; +import { numberWithCommas, timeNumber, timeNumberDetailed } from "../../utils/numberUtils"; import { drawBoxAtBlock, drawBoxAtEntity, drawCoolWaypoint, drawFilledBox, drawLine } from "../../utils/renderUtils"; import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; @@ -43,7 +43,9 @@ class Slayers extends Feature { this.slainAlert = new ToggleSetting("Show boss slain alert", "This helps you to not kill mobs for ages with an inactive quest", true, "boss_slain_alert", this); this.spawnAlert = new ToggleSetting("Show boss spawned alert", "This helps you to not miss your boss when you spawn it", true, "boss_spawn_alert", this); this.bossSpawnKillTime = new ToggleSetting("Show boss spawn and kill time", "tells you your slayer boss speed", true, "Slayer_spawn_kill_time", this).contributor("EmeraldMerchant"); + this.bossSpawnKillTimeDetalied = new TextSetting("Boss spawn & kill time using Decimal Point", "empty = don't use, 1 = 5.1s, 2 = 5.15s etc. max: 4", "0", "slayer_spawn_kill_time_decimal_point", this, "default", false).requires(this.bossSpawnKillTime) this.bossKillTime = new ToggleSetting("Shows you bosses kill time", "tells you your slayer boss kill time", true, "slayer_kill_time", this).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); + this.bossKillTimeDetalied = new TextSetting("Boss kill time using Decimal Point", "empty = don't use, 1 = 5.1s, 2 = 5.15s etc. max: 4", "0", "slayer_kill_time_decimal_point", this, "default", false).requires(this.bossKillTime) this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); this.slayerXpElement = new HudTextElement() .setText("&6Slayer&7> &fLoading...") @@ -183,10 +185,20 @@ class Slayers extends Feature { ChatLib.chat("&r &r&aYou have &d" + numberWithCommas(this.slayerExp[this.lastSlayerType]) + " " + this.lastSlayerType + " XP&r&7!&r"); ChatLib.chat("&r &r&aYou have &d" + numberWithCommas(Object.values(this.slayerExp).reduce((a, t) => t + a, 0)) + " total XP&r&7!&r"); if (this.bossSpawnKillTime.getValue() && Date.now() - this.lastBossSlain < 60000 * 10) { - ChatLib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!`); + let time = timeNumber(Date.now() - this.lastBossSlain); + let v = this.bossSpawnKillTimeDetalied.getValue() + if (v && v !== "" && v >= 1 && v <= 4) { + time = timeNumberDetailed(Date.now() - this.lastBossSlain, parseInt(this.bossSpawnKillTimeDetalied.getValue())); + } else if (v && v !== "" && (v < 1 || v > 4)) ChatLib.chat(this.FeatureManager.messagePrefix + "&c Decimal Point must be full number between 1-4!") + ChatLib.chat(`&r &r&aBoss took &d${time} &ato spawn and kill&r&7!`); } if (this.bossKillTime.getValue() && Date.now() - this.lastBossSpawned < 60000 * 4.6) { - ChatLib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSpawned)} &ato kill&r&7!`); + let time = timeNumber(Date.now() - this.lastBossSpawned); + let v = this.bossKillTimeDetalied.getValue() + if (v && v !== "" && v >= 1 && v <= 4) { + time = timeNumberDetailed(Date.now() - this.lastBossSpawned, parseInt(this.bossKillTimeDetalied.getValue())); + } else if (v && v !== "" && (v < 1 || v > 4)) ChatLib.chat(this.FeatureManager.messagePrefix + "&c Decimal Point must be full number between 1-4!") + ChatLib.chat(`&r &r&aBoss took &d${time} &ato kill&r&7!`); } } this.lastBossSlain = Date.now(); -- cgit From 1fba832922a47236beec1c05bc2c5d083e4e2d17 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:26:19 +0800 Subject: changed text setting to dropdown setting - text setting for time decimal point + drop down setting for time decimal point (so it is more straight forward) = made the description easier to understand --- features/slayers/index.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'features') diff --git a/features/slayers/index.js b/features/slayers/index.js index 1814d9d..e17e7d4 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -43,9 +43,9 @@ class Slayers extends Feature { this.slainAlert = new ToggleSetting("Show boss slain alert", "This helps you to not kill mobs for ages with an inactive quest", true, "boss_slain_alert", this); this.spawnAlert = new ToggleSetting("Show boss spawned alert", "This helps you to not miss your boss when you spawn it", true, "boss_spawn_alert", this); this.bossSpawnKillTime = new ToggleSetting("Show boss spawn and kill time", "tells you your slayer boss speed", true, "Slayer_spawn_kill_time", this).contributor("EmeraldMerchant"); - this.bossSpawnKillTimeDetalied = new TextSetting("Boss spawn & kill time using Decimal Point", "empty = don't use, 1 = 5.1s, 2 = 5.15s etc. max: 4", "0", "slayer_spawn_kill_time_decimal_point", this, "default", false).requires(this.bossSpawnKillTime) + this.bossSpawnKillTimeDetalied = new DropdownSetting("Boss spawn & kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_spawn_kill_time_decimal_point", this, ["0", "1", "2", "3", "4"]).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); this.bossKillTime = new ToggleSetting("Shows you bosses kill time", "tells you your slayer boss kill time", true, "slayer_kill_time", this).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); - this.bossKillTimeDetalied = new TextSetting("Boss kill time using Decimal Point", "empty = don't use, 1 = 5.1s, 2 = 5.15s etc. max: 4", "0", "slayer_kill_time_decimal_point", this, "default", false).requires(this.bossKillTime) + this.bossKillTimeDetalied = new DropdownSetting("Boss kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_kill_time_decimal_point", this, ["0", "1", "2", "3", "4"]).requires(this.bossKillTime).contributor("EmeraldMerchant"); this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); this.slayerXpElement = new HudTextElement() .setText("&6Slayer&7> &fLoading...") @@ -186,18 +186,14 @@ class Slayers extends Feature { ChatLib.chat("&r &r&aYou have &d" + numberWithCommas(Object.values(this.slayerExp).reduce((a, t) => t + a, 0)) + " total XP&r&7!&r"); if (this.bossSpawnKillTime.getValue() && Date.now() - this.lastBossSlain < 60000 * 10) { let time = timeNumber(Date.now() - this.lastBossSlain); - let v = this.bossSpawnKillTimeDetalied.getValue() - if (v && v !== "" && v >= 1 && v <= 4) { - time = timeNumberDetailed(Date.now() - this.lastBossSlain, parseInt(this.bossSpawnKillTimeDetalied.getValue())); - } else if (v && v !== "" && (v < 1 || v > 4)) ChatLib.chat(this.FeatureManager.messagePrefix + "&c Decimal Point must be full number between 1-4!") + let v = parseInt(this.bossSpawnKillTimeDetalied.getValue()) || 0 + if (v > 0) time = timeNumberDetailed(Date.now() - this.lastBossSlain, v); ChatLib.chat(`&r &r&aBoss took &d${time} &ato spawn and kill&r&7!`); } if (this.bossKillTime.getValue() && Date.now() - this.lastBossSpawned < 60000 * 4.6) { let time = timeNumber(Date.now() - this.lastBossSpawned); - let v = this.bossKillTimeDetalied.getValue() - if (v && v !== "" && v >= 1 && v <= 4) { - time = timeNumberDetailed(Date.now() - this.lastBossSpawned, parseInt(this.bossKillTimeDetalied.getValue())); - } else if (v && v !== "" && (v < 1 || v > 4)) ChatLib.chat(this.FeatureManager.messagePrefix + "&c Decimal Point must be full number between 1-4!") + let v = parseInt(this.bossKillTimeDetalied.getValue()) || 0 + if (v > 0) time = timeNumberDetailed(Date.now() - this.lastBossSpawned, v); ChatLib.chat(`&r &r&aBoss took &d${time} &ato kill&r&7!`); } } -- cgit From f6dfd7233ecb3c5849730cfe50815df3aec7b656 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:34:16 +0800 Subject: ok ig dropdownsetting option is object not array --- features/slayers/index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'features') diff --git a/features/slayers/index.js b/features/slayers/index.js index e17e7d4..786e732 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -42,10 +42,24 @@ class Slayers extends Feature { this.expOnKill = new ToggleSetting("Show slayer exp on boss kill", "Says your slayer exp in chat when you kill a boss, also says time taken to spawn+kill", true, "slayer_xp", this); this.slainAlert = new ToggleSetting("Show boss slain alert", "This helps you to not kill mobs for ages with an inactive quest", true, "boss_slain_alert", this); this.spawnAlert = new ToggleSetting("Show boss spawned alert", "This helps you to not miss your boss when you spawn it", true, "boss_spawn_alert", this); + this.spawnKillSetting = { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4" + } this.bossSpawnKillTime = new ToggleSetting("Show boss spawn and kill time", "tells you your slayer boss speed", true, "Slayer_spawn_kill_time", this).contributor("EmeraldMerchant"); - this.bossSpawnKillTimeDetalied = new DropdownSetting("Boss spawn & kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_spawn_kill_time_decimal_point", this, ["0", "1", "2", "3", "4"]).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); + this.bossSpawnKillTimeDetalied = new DropdownSetting("Boss spawn & kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_spawn_kill_time_decimal_point", this, this.spawnKillSetting).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); + this.killSetting = { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4" + } this.bossKillTime = new ToggleSetting("Shows you bosses kill time", "tells you your slayer boss kill time", true, "slayer_kill_time", this).requires(this.bossSpawnKillTime).contributor("EmeraldMerchant"); - this.bossKillTimeDetalied = new DropdownSetting("Boss kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_kill_time_decimal_point", this, ["0", "1", "2", "3", "4"]).requires(this.bossKillTime).contributor("EmeraldMerchant"); + this.bossKillTimeDetalied = new DropdownSetting("Boss kill time using Decimal Point", "0 = 5s, 1 = 5.1s, 2 = 5.15s etc.", "full number", "slayer_kill_time_decimal_point", this, this.killSetting).requires(this.bossKillTime).contributor("EmeraldMerchant"); this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); this.slayerXpElement = new HudTextElement() .setText("&6Slayer&7> &fLoading...") -- cgit From 772ed9fd29a2933db373f42a5ef0d97ffda6354b Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:52:56 +0800 Subject: assign actualemanboss + attempt to find this.actualEmanBoss whenever this.emanBoss changed --- features/slayers/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'features') diff --git a/features/slayers/index.js b/features/slayers/index.js index 786e732..da05a68 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -159,6 +159,7 @@ class Slayers extends Feature { candidatesDist.push(Math.round(parseFloat(distanceTo(candidate)) * 10)) }) this.emanBoss = this.candidateBoss[candidatesDist.indexOf(Math.min(...candidatesDist))] + assignActualEmanBoss(this.emanBoss) } } }) @@ -428,6 +429,20 @@ class Slayers extends Feature { } } } + + assignActualEmanBoss(entity) { + if (this.bossSpawnedMessage) { + World.getAllEntitiesOfType(net.minecraft.entity.monster.EntityEnderman).forEach((e) => { + if (e.getName().includes("Voidgloom Seraph")) { + //if distance from e to entity < 5 + if ((e.getX() - entity.getX()) ** 2 + (e.getY() - entity.getY()) ** 2 + (e.getZ() - entity.getZ()) ** 2 < 25) { + this.actualEmanBoss = e; + } + } + }) + } + } + renderWorld(ticks) { this.minibossEntity.forEach((x) => { drawBoxAtEntity(x[0], 0, 1, 0, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false); @@ -514,6 +529,7 @@ class Slayers extends Feature { this.cannotFindEmanBoss = false } else if (nameRemoveFormat.includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { this.emanBoss = name + assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } } @@ -604,10 +620,12 @@ class Slayers extends Feature { if (e[m.getCustomNameTag]() && e[m.getCustomNameTag]().includes("Voidgloom Seraph")) { if (Date.now() - this.nextIsBoss < 3000) { this.emanBoss = new Entity(e); + assignActualEmanBoss(this.emanBoss) this.nextIsBoss = false; } if (this.cannotFindEmanBoss && ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 < 5)) { this.emanBoss = new Entity(e); + assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } -- cgit