Skip to content

Commit

Permalink
Fix + Improvement: Stonks Auction Not Showing The Right Price (hannib…
Browse files Browse the repository at this point in the history
  • Loading branch information
im-h authored Dec 4, 2024
1 parent 654c659 commit 2a35f08
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ object StockOfStonkFeature {

/**
* REGEX-TEST: §5§o§7§7▶ §c§lTOP 5,000§7 - §5Stock of Stonks §8x2
* REGEX-TEST: §5§o§7§a▶ §a§lTOP 100§7 - §5Stock of Stonks §8x25
*/
private val topPattern by repoGroup.pattern(
"top",
"§5§o§7§.▶ §c§lTOP (?<rank>[\\d,]+)§7 - §5Stock of Stonks §8x(?<amount>\\d+)",
"§5§o§7§.▶ §.§lTOP (?<rank>[\\d,]+)§7 - §5Stock of Stonks §8x(?<amount>\\d+)",
)

/**
Expand Down Expand Up @@ -84,7 +85,7 @@ object StockOfStonkFeature {
continue@loop
}
bidPattern.matchMatcher(line) {
val cost = group("amount").replace(",", "").toLong()
val cost = group("amount").replace(",", "").toLong().coerceAtLeast(2000000) // minimum bid is 2,000,000
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) {
Expand Down

0 comments on commit 2a35f08

Please sign in to comment.