aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/slayer
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-12 01:10:03 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-12 01:10:03 +0200
commit37956188a6e4e255961a54ef60e94b98d9a65507 (patch)
treeb67eb35ff7e92e6cd70d759e3f932d39c1a7f1a2 /src/main/java/at/hannibal2/skyhanni/features/slayer
parent9f4733bcf9142ba9d39c5c9725c0650e53edc2ce (diff)
downloadskyhanni-37956188a6e4e255961a54ef60e94b98d9a65507.tar.gz
skyhanni-37956188a6e4e255961a54ef60e94b98d9a65507.tar.bz2
skyhanni-37956188a6e4e255961a54ef60e94b98d9a65507.zip
fixed error in rng meter item detection when talking to maddox
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
index 93d1a414d..b19014034 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
@@ -54,6 +54,13 @@ class SlayerRngMeterDisplay {
"changeditem",
"§aYou set your §r.* RNG Meter §r§ato drop §r.*§a!"
)
+ /**
+ * REGEX-TEST: §aEnchanted Book (§d§lDuplex I§a)
+ */
+ private val bookFormatPattern by patternGroup.pattern(
+ "book.format",
+ "§aEnchanted Book \\((?<name>.*)§a\\)"
+ )
private var display = emptyList<Renderable>()
private var lastItemDroppedTime = 0L
@@ -159,8 +166,11 @@ class SlayerRngMeterDisplay {
if (name != getCurrentSlayer()) return
- val selectedItem = lore.nextAfter("§7Selected Drop") ?: return
- val internalName = NEUInternalName.fromItemName(selectedItem)
+ val rawName = lore.nextAfter("§7Selected Drop") ?: return
+ val itemName = bookFormatPattern.matchMatcher(rawName) {
+ group("name")
+ } ?: rawName
+ val internalName = NEUInternalName.fromItemName(itemName)
setNewGoal(internalName)
}