From 37956188a6e4e255961a54ef60e94b98d9a65507 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 12 May 2024 01:10:03 +0200 Subject: fixed error in rng meter item detection when talking to maddox --- .../skyhanni/features/slayer/SlayerRngMeterDisplay.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') 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 \\((?.*)§a\\)" + ) private var display = emptyList() 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) } -- cgit