From 16db0e981896c256ecc55db8ac872d8f89a1ec1e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Thu, 23 Jun 2022 21:50:26 +0800 Subject: finished todo - added a setting to toggle boss spawn + kill time - introduce boss kill time --- features/slayers/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'features/slayers/index.js') diff --git a/features/slayers/index.js b/features/slayers/index.js index ea592c8..11413f0 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -24,6 +24,8 @@ 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.bossSpawnKillTime = new ToggleSetting("Show boss spawn and kill time", "tells you your slayer boss speed", true, "Slayer_spawn_kill_time", this).contributor("EmeraldMerchant"); + this.bossKillTime = new ToggleSetting("Shows you bosses kill time", "requires previous option to be on", true, "slayer_kill_time", this).requires(this.bossSpawnKillTime).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...") @@ -114,7 +116,12 @@ class Slayers extends Feature { ChatLib.chat("&r &r&a&lSLAYER QUEST COMPLETE!&a&r"); 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 (Date.now() - this.lastBossSlain < 60000 * 5) ChatLib.chat("&r &r&aBoss took &d" + timeNumber(Date.now() - this.lastBossSlain) + " &ato spawn and kill&r&7!" + /* (" + timeNumber(Date.now()-this.lastBossSpawned) + " to kill) */ "&r"); //TODO: Seperate setting for this + let bossKillTimeMessage = undefined + if (this.bossSpawnKillTime.getValue() && Date.now() - this.lastBossSlain < 60000 * 5) { + bossKillTimeMessage = `&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!` + if (this.bossKillTime.getValue()) bossKillTimeMessage += `(${timeNumber(Date.now() - this.lastBossSpawned)} to kill)&r`; + ChatLib.chat(bossKillTimeMessage) + } } this.lastBossSlain = Date.now(); }); @@ -385,7 +392,7 @@ class Slayers extends Feature { if (!this.bossSpawnedMessage && e instanceof net.minecraft.entity.item.EntityArmorStand) { let mobName = `${e[m.getCustomNameTag]().removeFormatting().split(" ")[0]} ${e[m.getCustomNameTag]().removeFormatting().split(" ")[1]}` if (this.Miniboss[this.lastSlayerType].has(mobName)) { - if (this.BoxAroundMiniboss.getValue() && !this.minibossEntity.map(a=>a[0].getUUID().toString()).includes(e[m.getEntityId.Entity]().toString())) { + if (this.BoxAroundMiniboss.getValue() && !this.minibossEntity.map(a => a[0].getUUID().toString()).includes(e[m.getEntityId.Entity]().toString())) { this.minibossEntity.push([new Entity(e), this.lastSlayerType]); } } -- cgit From 33d232312fcc83f878a3bab1944019924d7009aa Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:54:55 +0800 Subject: small fix - made boss kill time actually works --- features/slayers/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'features/slayers/index.js') diff --git a/features/slayers/index.js b/features/slayers/index.js index 11413f0..65abe37 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -34,7 +34,7 @@ class Slayers extends Feature { 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"); - this.MinibossPing = new ToggleSetting("Also make a sound when miniboss spawned", "Sound ping when a miniboss spawned", false, "miniboss_sound_ping", this).requires(this.MinibossAlert).contributor("EmeraldMerchant"); + this.MinibossPing = new ToggleSetting("Also make a sound when miniboss spawned", "Sound ping when a miniboss spawned", false, "miniboss_sound_ping", this).contributor("EmeraldMerchant"); this.BoxAroundMiniboss = new ToggleSetting("Draws boxes around minibosses.", "If they are too far away it doesnt draw.", false, "box_around_miniboss", this).contributor("EmeraldMerchant"); 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); @@ -118,10 +118,10 @@ 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"); let bossKillTimeMessage = undefined if (this.bossSpawnKillTime.getValue() && Date.now() - this.lastBossSlain < 60000 * 5) { - bossKillTimeMessage = `&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!` - if (this.bossKillTime.getValue()) bossKillTimeMessage += `(${timeNumber(Date.now() - this.lastBossSpawned)} to kill)&r`; - ChatLib.chat(bossKillTimeMessage) + bossKillTimeMessage += `&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!` } + if (this.bossKillTime.getValue()) bossKillTimeMessage += `(${timeNumber(Date.now() - this.lastBossSpawned)} to kill)&r`; + if (bossKillTimeMessage !== undefined) ChatLib.chat(bossKillTimeMessage) } this.lastBossSlain = Date.now(); }); @@ -666,6 +666,7 @@ class Slayers extends Feature { 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())] }); + this.lastBossSpawned = Date.now(); } if (!this.bossSpawnedMessage && !this.emanBoss) { this.nextIsBoss = Date.now(); -- cgit From 9af4e7965387c617dec21406a7e9544b248c37fa Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:59:46 +0800 Subject: small fix - separated boss spawn + kill time and kill time - recolored kill time to make it fit with the other messages --- features/slayers/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'features/slayers/index.js') diff --git a/features/slayers/index.js b/features/slayers/index.js index 65abe37..4fe5cf3 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -116,12 +116,12 @@ class Slayers extends Feature { ChatLib.chat("&r &r&a&lSLAYER QUEST COMPLETE!&a&r"); 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"); - let bossKillTimeMessage = undefined if (this.bossSpawnKillTime.getValue() && Date.now() - this.lastBossSlain < 60000 * 5) { - bossKillTimeMessage += `&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!` + Chatlib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!`); + } + if (this.bossKillTime.getValue() && Date.now() - this.lastBossSpawned < 60000 * 4) { + Chatlib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSpawned)} &ato kill&r&7!`); } - if (this.bossKillTime.getValue()) bossKillTimeMessage += `(${timeNumber(Date.now() - this.lastBossSpawned)} to kill)&r`; - if (bossKillTimeMessage !== undefined) ChatLib.chat(bossKillTimeMessage) } this.lastBossSlain = Date.now(); }); -- cgit From ab55667da0bbf4408438b2b5fd060296d1148419 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Thu, 23 Jun 2022 23:06:23 +0800 Subject: small fixes - rewrote the lore for boss kill time option to make it meaningful - fixed "ChatLib" that was "Chatlib" --- features/slayers/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'features/slayers/index.js') diff --git a/features/slayers/index.js b/features/slayers/index.js index 4fe5cf3..b9f4a1e 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -25,7 +25,7 @@ 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.bossKillTime = new ToggleSetting("Shows you bosses kill time", "requires previous option to be on", true, "slayer_kill_time", this).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.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...") @@ -117,10 +117,10 @@ 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 * 5) { - Chatlib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!`); + ChatLib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSlain)} &ato spawn and kill&r&7!`); } if (this.bossKillTime.getValue() && Date.now() - this.lastBossSpawned < 60000 * 4) { - Chatlib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSpawned)} &ato kill&r&7!`); + ChatLib.chat(`&r &r&aBoss took &d${timeNumber(Date.now() - this.lastBossSpawned)} &ato kill&r&7!`); } } this.lastBossSlain = Date.now(); -- cgit From 056ffe36e1fa3c80a77cd4d1d8d03960efb7d779 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:56:36 +0800 Subject: added a check to reduce lag ^ --- features/slayers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/slayers/index.js') diff --git a/features/slayers/index.js b/features/slayers/index.js index b9f4a1e..910d0ef 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -306,7 +306,7 @@ class Slayers extends Feature { if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(name => { let MobName = `${name.getName().removeFormatting().split(" ")[0]} ${name.getName().removeFormatting().split(" ")[1]}` - if (this.BoxAroundMiniboss.getValue() && !this.bossSpawnedMessage && this.Miniboss[this.lastSlayerType]?.has(MobName)) { + if (this.BoxAroundMiniboss.getValue() && !this.bossSpawnedMessage && this.Miniboss[this.lastSlayerType]?.has(MobName) && !this.minibossEntity.map(a => a[0].getUUID().toString()).includes(name.getUUID().toString())) { this.minibossEntity.push([new Entity(name.getEntity()), this.lastSlayerType]); } if (this.betterHideDeadEntity.getValue()) { -- cgit