Skip to content

Commit

Permalink
Fix: Experimentation Table Pet Rule (#2699)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
2 people authored and CalMWolfs committed Oct 8, 2024
1 parent a2b417a commit a9c0661
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a9c0661

Please sign in to comment.