diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/StockOfStonkFeature.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/StockOfStonkFeature.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/StockOfStonkFeature.kt index 4bc8af1e3..f905eb5a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/StockOfStonkFeature.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/StockOfStonkFeature.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.CollectionUtils.transformAt +import at.hannibal2.skyhanni.utils.ConditionalUtils.transformIf import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher @@ -20,7 +21,6 @@ object StockOfStonkFeature { private val repoGroup = RepoPattern.group("inventory.stockofstonks") - /** * REGEX-TEST: Stonks Auction */ @@ -42,7 +42,7 @@ object StockOfStonkFeature { */ private val topPattern by repoGroup.pattern( "top", - "§5§o§7§7▶ §c§lTOP (?<rank>[\\d,]+)§7 - §5Stock of Stonks §8x(?<amount>\\d+)", + "§5§o§7§.▶ §c§lTOP (?<rank>[\\d,]+)§7 - §5Stock of Stonks §8x(?<amount>\\d+)", ) /** @@ -85,7 +85,7 @@ object StockOfStonkFeature { } bidPattern.matchMatcher(line) { val cost = group("amount").replace(",", "").toLong() - val ratio = cost / stonksReward + val ratio = cost / stonksReward.transformIf({ this == 0 }, { 1 }) event.toolTip[index - 1] = line + " §7(§6§6${ratio.addSeparators()} §7per)" // double §6 for the replacement at the end if (ratio < bestRatio) { bestValueIndex = index - 1 |