diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-09-23 00:40:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 08:40:07 +1000 |
commit | e1b9ba327a4569e31728cbcbee217cbf72ec2e8d (patch) | |
tree | 3af85dd514dfca4fcd3a70529dd4c9e9247ae1f8 /src/main | |
parent | ad247a94a9d7186b670c834ebf88c5426c7b1c88 (diff) | |
download | skyhanni-e1b9ba327a4569e31728cbcbee217cbf72ec2e8d.tar.gz skyhanni-e1b9ba327a4569e31728cbcbee217cbf72ec2e8d.tar.bz2 skyhanni-e1b9ba327a4569e31728cbcbee217cbf72ec2e8d.zip |
Fix: Stonks of stonks auction on auction (#2572)
Diffstat (limited to 'src/main')
-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 |