From 5e71dc9572870b7dc7ab4358ee61718bec014ae1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:18:24 +0200 Subject: Fix: Experimentation Table Pet Rule (#2699) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../inventory/experimentationtable/GuardianReminder.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt index 216cbf7c6..32157adf7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha +import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -37,12 +38,17 @@ object GuardianReminder { fun onInventory(event: InventoryFullyOpenedEvent) { if (!isEnabled()) return if (event.inventoryName != "Experimentation Table") return - if (ExperimentationTableAPI.petNamePattern.matches(PetAPI.currentPet)) return - lastInventoryOpen = SimpleTimeMark.now() + DelayedRun.runDelayed(200.milliseconds, ::warn) + } + + private fun warn() { + if (ExperimentationTableAPI.petNamePattern.matches(PetAPI.currentPet)) return + if (lastWarn.passedSince() < 5.seconds) return lastWarn = SimpleTimeMark.now() + ChatUtils.clickToActionOrDisable( "Use a §9§lGuardian Pet §efor more Exp in the Experimentation Table.", config::guardianReminder, -- cgit