From de47024ea3f4910bbca68a880491c8924fc5ecc6 Mon Sep 17 00:00:00 2001 From: CalMWolfs Date: Tue, 20 Jun 2023 09:40:29 +1000 Subject: hours do have 60 minutes --- .../skyhanni/features/misc/FrozenTreasureTracker.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt index 264d16ae4..50c11d128 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FrozenTreasureTracker.kt @@ -28,13 +28,13 @@ class FrozenTreasureTracker { private var lastEstimatedIce = 0L private val icePerMin = mutableListOf() private var icePerHour = 0 - private var missedMinutes = 0 + private var stoppedChecks = 0 private var compactPattern = "COMPACT! You found an Enchanted Ice!".toPattern() private var treasureCount = mapOf() init { - fixedRateTimer(name = "skyhanni-dungeon-milestone-display", period = 60_000) { + fixedRateTimer(name = "skyhanni-dungeon-milestone-display", period = 15_000) { if (!onJerryWorkshop()) return@fixedRateTimer calculateIcePerHour() } @@ -44,17 +44,17 @@ class FrozenTreasureTracker { val difference = estimatedIce - lastEstimatedIce lastEstimatedIce = estimatedIce if (difference == 0L) { - missedMinutes += 1 - if (missedMinutes == 3) { - missedMinutes = 0 + stoppedChecks += 1 + if (stoppedChecks == 12) { + stoppedChecks = 0 icePerMin.clear() icePerHour = 0 } return } - missedMinutes = 0 + stoppedChecks = 0 icePerMin.add(difference) - if (difference != estimatedIce) icePerHour = icePerMin.average().toInt() + if (difference != estimatedIce) icePerHour = icePerMin.average().toInt() * 240 } private fun formatDisplay(map: List>): List> { -- cgit