From 2efa126057236a912d5b413676f714545e661862 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:40:04 +0100 Subject: Fixed Great Spook Potion not working in Non God Pot effect feature (#658) Fixed Great Spook potion not working in Non God Pot Effect feature. #658 --- .../skyhanni/features/misc/NonGodPotEffectDisplay.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index a1ae6f5ad..f4ce726f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -70,31 +70,31 @@ class NonGodPotEffectDisplay { } if (event.message == "§aYou ate a §r§aRe-heated Gummy Polar Bear§r§a!") { - checkFooter = true effectDuration[NonGodPotEffect.SMOLDERING] = Timer(1.hours) update() } if (event.message == "§a§lBUFF! §fYou have gained §r§2Mushed Glowy Tonic I§r§f! Press TAB or type /effects to view your active effects!") { - checkFooter = true effectDuration[NonGodPotEffect.GLOWY] = Timer(1.hours) update() } if (event.message == "§a§lBUFF! §fYou splashed yourself with §r§bWisp's Ice-Flavored Water I§r§f! Press TAB or type /effects to view your active effects!") { - checkFooter = true effectDuration[NonGodPotEffect.WISP] = Timer(5.minutes) update() } + if (event.message == "§eYou consumed a §r§fGreat Spook Potion§r§e!") { + effectDuration[NonGodPotEffect.GREAT_SPOOK] = Timer(24.hours) + update() + } + if (event.message == "§e[NPC] §6King Yolkar§f: §rThese eggs will help me stomach my pain.") { - checkFooter = true effectDuration[NonGodPotEffect.GOBLIN] = Timer(20.minutes) update() } if (event.message == "§cThe Goblin King's §r§afoul stench §r§chas dissipated!") { - checkFooter = true effectDuration.remove(NonGodPotEffect.GOBLIN) update() } @@ -199,9 +199,11 @@ class NonGodPotEffectDisplay { var effectsCount = 0 for (line in lines) { for (effect in NonGodPotEffect.entries) { - if (line.startsWith(effect.tabListName)) { + val tabListName = effect.tabListName + if (line.startsWith(tabListName)) { + val string = line.substring(tabListName.length) try { - val duration = TimeUtils.getMillis(line.split("§f")[1]) + val duration = TimeUtils.getMillis(string.split("§f")[1]) effectDuration[effect] = Timer(duration.milliseconds) update() } catch (e: IndexOutOfBoundsException) { -- cgit