aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-03-21 18:07:24 +0100
committerGitHub <noreply@github.com>2024-03-21 18:07:24 +0100
commit183330cffcced59da0bc3f317706b2d054b4ca44 (patch)
tree14777c3541fedfdef9f99d169dd847f58b69d08f /src/main/java
parent685c8d232bcef40178d331ad4d3dde7ae0d1c3e9 (diff)
downloadskyhanni-183330cffcced59da0bc3f317706b2d054b4ca44.tar.gz
skyhanni-183330cffcced59da0bc3f317706b2d054b4ca44.tar.bz2
skyhanni-183330cffcced59da0bc3f317706b2d054b4ca44.zip
Improvement: Added another gui for bits to claim (#1230)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt18
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
+ }
+ }
}
}