aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
index eca5bbcc3..a69622916 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
@@ -67,10 +67,15 @@ object BitsAPI {
private val bitsChatGroup = bitsDataGroup.group("chat")
private val bitsFromFameRankUpChatPattern by bitsChatGroup.pattern(
- "famerankup",
+ "rankup.bits",
"§eYou gained §3(?<amount>.*) Bits Available §ecompounded from all your §epreviously eaten §6cookies§e! Click here to open §6cookie menu§e!"
)
+ private val fameRankUpPattern by bitsChatGroup.pattern(
+ "rankup.rank",
+ "[§\\w\\s]+FAME RANK UP (?:§.)+(?<rank>.*)"
+ )
+
private val boosterCookieAte by bitsChatGroup.pattern(
"boostercookieate",
"§eYou consumed a §6Booster Cookie§e!.*"
@@ -173,6 +178,21 @@ object BitsAPI {
return
}
+ fameRankUpPattern.matchMatcher(message) {
+ val rank = group("rank")
+
+ currentFameRank = getFameRankByNameOrNull(rank)
+ ?: return ErrorManager.logErrorWithData(
+ FameRankNotFoundException(rank),
+ "FameRank $rank not found",
+ "Rank" to rank,
+ "Message" to message,
+ "FameRanks" to FameRanks.fameRanks
+ )
+
+ return
+ }
+
boosterCookieAte.matchMatcher(message) {
bitsAvailable += (defaultcookiebits * (currentFameRank?.bitsMultiplier ?: return)).toInt()
val cookieTime = cookieBuffTime