diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt index d8b45ddb7..06de4bcf3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt @@ -85,11 +85,16 @@ object BitsAPI { "^SkyBlock Menu$" ) - private val bitsGuiStackPattern by bitsGuiGroup.pattern( + private val cookieGuiStackPattern by bitsGuiGroup.pattern( "mainmenustack", "^§6Booster Cookie$" ) + private val bitsStackPattern by bitsGuiGroup.pattern( + "bitsstack", + "§bBits" + ) + private val fameRankGuiNamePattern by bitsGuiGroup.pattern( "famerankmenuname", "^(Community Shop|Booster Cookie)$" @@ -146,7 +151,7 @@ object BitsAPI { val stacks = event.inventoryItems if (bitsGuiNamePattern.matches(event.inventoryName)) { - val cookieStack = stacks.values.lastOrNull { bitsGuiStackPattern.matches(it.displayName) } + val cookieStack = stacks.values.lastOrNull { cookieGuiStackPattern.matches(it.displayName) } // If the cookie stack is null, then the player should not have any bits to claim if (cookieStack == null) { @@ -165,6 +170,7 @@ object BitsAPI { } if (fameRankGuiNamePattern.matches(event.inventoryName)) { + val bitsStack = stacks.values.lastOrNull { bitsStackPattern.matches(it.displayName) } ?: return val fameRankStack = stacks.values.lastOrNull { fameRankGuiStackPattern.matches(it.displayName) } ?: return line@ for (line in fameRankStack.getLore()) { @@ -198,6 +204,14 @@ object BitsAPI { continue@line } } + + line@ for (line in bitsStack.getLore()) { + bitsAvailableMenuPattern.matchMatcher(line) { + bitsToClaim = group("toClaim").formatInt() + + continue@line + } + } } } |