From 7949ad0ee8ca8e851f141cf2dc75e5675103a785 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 10 Aug 2022 05:31:35 +0800 Subject: Added Bozo Mask Features + Bonzo Mask Timer (in dun) + Fragged Bonzo Mask Timer (in dun) + Spirit Mask Timer (in dun/ in+out dun toggleable) --- features/dungeonSolvers/index.js | 91 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'features') diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 26bbc1b..ea1838e 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -50,6 +50,12 @@ class DungeonSolvers extends Feature { Arcade: "&e", }; + this.bonzoMaskTimer = 0; + this.fraggedBonzoMaskTimer = 0; + this.spiritMaskTimer = 0; + this.eraseBonzoTimer = true; + this.bonzoMaskCooldown = 0; + this.lastWorldload = Date.now() this.lividFindEnabled = new ToggleSetting("Correct livid finder", "Finds the real livid to kill in the f5 boss fight", true, "livid_find_enabled", this); this.lividFindHud = new ToggleSetting("Show Livid Hp", "Shows the nametag of the correct livid", true, "livid_hud_enabled", this).requires(this.lividFindEnabled); @@ -103,7 +109,92 @@ class DungeonSolvers extends Feature { if (this.lastDungFinishes.length > 5) { this.lastDungFinishes.shift(); } + + this.bonzoMaskTimer = 0; + this.fraggedBonzoMaskTimer = 0; + this.spiritMaskTimer = 0; + this.eraseBonzoTimer = true; }); + this.registerChat("${prefix}\"mode\":\"dungeon\",\"map\":\"Dungeon\"}&r", () => { + [...Player.getInventory().getItems()].forEach(i => { + if (!i) return + let itemName = i.getName() + if (itemName.removeFormatting().includes("Bonzo's Mask")) { + i.getLore().forEach(line => { + if (line.includes("Cooldown:")) { + this.bonzoMaskCooldown = Number(line.removeFormatting().split("n: ")[1].replace("s", "")) + } + }) + } + }) + }) + this.bonzoSpiritMaskTimer = new ToggleSetting("Timer for when bonzo/spirit mask will be ready", "works for both bonzo masks, hides bonzo masks' timers after you leave the run", false, "bonzo_mask_timer", this); + this.bonzoSpiritMaskTimerElement = new HudTextElement().setToggleSetting(this.bonzoSpiritMaskTimer).setLocationSetting(new LocationSetting("Bonzo/Spirit Mask timer location", "Allows you to edit the location of the timer", "bonzo_mask_timer_location", this, [10, 100, 1, 1]).requires(this.bonzoSpiritMaskTimer).editTempText("&9Bonzo's Mask: &c157s")); + this.hudElements.push(this.bonzoSpiritMaskTimerElement); + this.spiritMaskOutsideDungeon = new ToggleSetting("Spirit Mask Timer Outside Dungeons", "should spirit mask timer be shown outside dungeon?", false, "spirit_mask_timer", this).requires(this.bonzoSpiritMaskTimer); + + this.normalBonzoMask = new ToggleSetting("Bonzo Mask Proc'ed Alert", "Enable this to change the message", true, "bonzo_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.normalBonzoMaskMessage = new TextSetting("Bonzo Mask Proc'ed Message", "change bonzo mask proc message here", "&cBonzo Mask Used", "bonzo_mask_alert_message", this, "&cBonzo Mask Used", false).requires(this.normalBonzoMask); + this.fraggedBonzoMask = new ToggleSetting("⚚ Bonzo Mask Proc'ed Alert", "Enable this to change the message", true, "fragged_bonzo_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.fraggedBonzoMaskMessage = new TextSetting("⚚ Bonzo Mask Proc'ed Message", "change bonzo mask proc message here", "&c⚚ Bonzo Mask Used", "fragged_bonzo_mask_alert_message", this, "&c⚚ Bonzo Mask Used", false).requires(this.fraggedBonzoMask); + this.spiritMask = new ToggleSetting("Spirit Mask Proc'ed Alert", "Enable this to change the message", true, "spirit_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.spiritMaskMessage = new TextSetting("Spirit Mask Proc'ed Message", "change spirit mask proc message here", "&cSpirit Mask Used", "spirit_mask_alert_message", this, "&cSpirit Mask Used", false).requires(this.spiritMask); + + this.registerChat("&r&aYour &r&9Bonzo's Mask &r&asaved your life!&r", () => { + this.eraseBonzoTimer = false; + if (this.bonzoSpiritMaskTimer.getValue()) { + this.bonzoMaskTimer = Date.now() + this.bonzoMaskCooldown * 1000; + } + if (this.normalBonzoMask.getValue()) { + let m = this.normalBonzoMaskMessage.getValue() + Client.showTitle(m ? m : "&cBonzo Mask Used", "", 0, 60, 10) + } + }) + + this.registerChat("&r&aYour &r&9⚚ Bonzo's Mask &r&asaved your life!&r", () => { + this.eraseBonzoTimer = false; + if (this.bonzoSpiritMaskTimer.getValue()) { + this.fraggedBonzoMaskTimer = Date.now() + this.bonzoMaskCooldown * 1000; + } + if (this.fraggedBonzoMask.getValue()) { + let m = this.fraggedBonzoMaskMessage.getValue() + Client.showTitle(m ? m : "&c⚚ Bonzo Mask Used", "", 0, 60, 10) + } + }) + + this.registerChat("&r&6Second Wind Activated&r&a! &r&aYour Spirit Mask saved your life!&r", () => { + if (this.bonzoSpiritMaskTimer.getValue()) { + if (this.spiritMaskOutsideDungeon.getValue() ? true : !this.eraseBonzoTimer) { + this.spiritMaskTimer = Date.now() + 30 * 1000; + } + } + if (this.fraggedBonzoMask.getValue()) { + let m = this.spiritMaskMessage.getValue() + Client.showTitle((m ? m : "&cSpirit Mask Used"), "", 0, 60, 10) + } + }) + + this.registerStep(true, 10, () => { + if (!this.bonzoSpiritMaskTimer.getValue()) return + let timerText = "" + if (this.spiritMaskOutsideDungeon.getValue() ? true : !this.eraseBonzoTimer) { + if (this.spiritMask.getValue()) { + let timer1 = Math.round((this.spiritMaskTimer - Date.now())/100)/10 + timerText += "&5Spirit Mask: " + (timer1 > 0 ? "&c" + timer1 + "&6s" : "&6READY") + "\n" + } + } + if (!this.eraseBonzoTimer) { + if (this.normalBonzoMask.getValue()) { + let timer2 = Math.round((this.bonzoMaskTimer - Date.now())/100)/10 + timerText += "&9Bonzo's Mask: " + (timer2 > 0 ? "&c" + timer2 + "&6s" : "&6READY") + "\n" + } + if (this.fraggedBonzoMask.getValue()) { + let timer3 = Math.round((this.fraggedBonzoMaskTimer - Date.now())/100)/10 + timerText += "&9⚚ Bonzo's Mask: " + (timer3 > 0 ? "&c" + timer3 + "&6s" : "&6READY") + } + } + this.bonzoSpiritMaskTimerElement.setText(timerText) + }) this.forgorEnabled = new ToggleSetting("Change withermancer death message to forgor ", "", true, "withermancer_forgor", this); this.f7waypoints = new ToggleSetting("Waypoints for P3 F7/M7", "(Only shows unfinished ones)", true, "f7_waypoints", this); -- cgit From 1e69dba025712a55e6f484a28a8f7d38474ad18a Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 10 Aug 2022 05:56:47 +0800 Subject: update yes mb i forgot to import textsettings --- features/dungeonSolvers/index.js | 1 + 1 file changed, 1 insertion(+) (limited to 'features') diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index ea1838e..ee957b4 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -7,6 +7,7 @@ import * as renderUtils from "../../utils/renderUtils"; import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; +import TextSetting from "../settings/settingThings/textSetting"; import { fetch } from "../../utils/networkUtils"; import { delay } from "../../utils/delayUtils"; import { Waypoint } from "../../utils/renderJavaUtils"; -- cgit From 1a1a03cb1477e1b89b39d080347a2e28ae72d6fa Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 10 Aug 2022 07:21:19 +0800 Subject: change bonzo mask cooldown check change bonzo mask cooldown check to 30s step --- features/dungeonSolvers/index.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'features') diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index ee957b4..471d3d5 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -116,19 +116,7 @@ class DungeonSolvers extends Feature { this.spiritMaskTimer = 0; this.eraseBonzoTimer = true; }); - this.registerChat("${prefix}\"mode\":\"dungeon\",\"map\":\"Dungeon\"}&r", () => { - [...Player.getInventory().getItems()].forEach(i => { - if (!i) return - let itemName = i.getName() - if (itemName.removeFormatting().includes("Bonzo's Mask")) { - i.getLore().forEach(line => { - if (line.includes("Cooldown:")) { - this.bonzoMaskCooldown = Number(line.removeFormatting().split("n: ")[1].replace("s", "")) - } - }) - } - }) - }) + this.registerStep(false, 30, this.getBonzoMaskCooldown()); this.bonzoSpiritMaskTimer = new ToggleSetting("Timer for when bonzo/spirit mask will be ready", "works for both bonzo masks, hides bonzo masks' timers after you leave the run", false, "bonzo_mask_timer", this); this.bonzoSpiritMaskTimerElement = new HudTextElement().setToggleSetting(this.bonzoSpiritMaskTimer).setLocationSetting(new LocationSetting("Bonzo/Spirit Mask timer location", "Allows you to edit the location of the timer", "bonzo_mask_timer_location", this, [10, 100, 1, 1]).requires(this.bonzoSpiritMaskTimer).editTempText("&9Bonzo's Mask: &c157s")); this.hudElements.push(this.bonzoSpiritMaskTimerElement); @@ -475,6 +463,19 @@ class DungeonSolvers extends Feature { } catch (e) { }//older ct version } + getBonzoMaskCooldown() { + [...Player.getInventory().getItems()].forEach(i => { + if (!i) return + let itemName = i.getName() + if (itemName.removeFormatting().includes("Bonzo's Mask")) { + i.getLore().forEach(line => { + if (line.includes("Cooldown:")) { + this.bonzoMaskCooldown = Number(line.removeFormatting().split("n: ")[1].replace("s", "")) + } + }) + } + }) + } getCurrentRoomId() { if (Scoreboard.getLines().length === 0) return let id = ChatLib.removeFormatting(Scoreboard.getLineByIndex(Scoreboard.getLines().length - 1).getName()).trim().split(" ").pop() -- cgit From 3783fc60b3ea1ee4143825038ade8f7fa9afe28d Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:38:54 +0800 Subject: fixed ice spray chat msg --- features/dungeonSolvers/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features') diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 471d3d5..187d46c 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -116,7 +116,7 @@ class DungeonSolvers extends Feature { this.spiritMaskTimer = 0; this.eraseBonzoTimer = true; }); - this.registerStep(false, 30, this.getBonzoMaskCooldown()); + this.registerStep(false, 30, this.getBonzoMaskCooldown); this.bonzoSpiritMaskTimer = new ToggleSetting("Timer for when bonzo/spirit mask will be ready", "works for both bonzo masks, hides bonzo masks' timers after you leave the run", false, "bonzo_mask_timer", this); this.bonzoSpiritMaskTimerElement = new HudTextElement().setToggleSetting(this.bonzoSpiritMaskTimer).setLocationSetting(new LocationSetting("Bonzo/Spirit Mask timer location", "Allows you to edit the location of the timer", "bonzo_mask_timer_location", this, [10, 100, 1, 1]).requires(this.bonzoSpiritMaskTimer).editTempText("&9Bonzo's Mask: &c157s")); this.hudElements.push(this.bonzoSpiritMaskTimerElement); @@ -1182,7 +1182,7 @@ class DungeonSolvers extends Feature { let MobName = ChatLib.removeFormatting(name.getName()) if (MobName.includes("Ice Spray Wand") && name.getTicksExisted() <= 199) { Client.showTitle(`&r&6&l[&b&l&kO&6&l] ${MobName.toUpperCase()} &6&l[&b&l&kO&6&l]`, "", 0, 40, 10); - ChatLib.chat(`&6&lRARE DROP! &r${MobName}`) + ChatLib.chat(`&6&lRARE DROP! &r${name}`) } }) } -- cgit From 6517d8d451354845617a83cdb4809b476ece5870 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:42:31 +0800 Subject: .getName() --- features/dungeonSolvers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features') diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 187d46c..04add0f 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -1182,7 +1182,7 @@ class DungeonSolvers extends Feature { let MobName = ChatLib.removeFormatting(name.getName()) if (MobName.includes("Ice Spray Wand") && name.getTicksExisted() <= 199) { Client.showTitle(`&r&6&l[&b&l&kO&6&l] ${MobName.toUpperCase()} &6&l[&b&l&kO&6&l]`, "", 0, 40, 10); - ChatLib.chat(`&6&lRARE DROP! &r${name}`) + ChatLib.chat(`&6&lRARE DROP! &r${name.getName()}`) } }) } -- cgit