From c3be57c318b3966992e40959470245c5d3f6eb04 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sat, 27 Apr 2024 11:42:59 +0200 Subject: Fix: Discord profile level error (#1548) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/misc/discordrpc/DiscordStatus.kt | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index b217aded1..eef6e4efa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType +import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -165,20 +166,7 @@ enum class DiscordStatus(private val displayMessageSupplier: (() -> String?)) { }), PROFILE({ - val player = LorenzUtils.getPlayerName() - - val tabData = TabListData.getTabList() - val levelRegex = Regex("""\[(\d{1,3})] $player""") - var sbLevel = "" -// SkyBlock Level: [999] on Lemon - for (line in tabData) { - if (line.contains(player)) { - val colorlessLine = line.removeColor() - sbLevel = levelRegex.find(colorlessLine)!!.groupValues[1] - break - } - } - + val sbLevel = AdvancedPlayerList.tabPlayerData[LorenzUtils.getPlayerName()]?.sbLevel?.toString() ?: "?" var profile = "SkyBlock Level: [$sbLevel] on " profile += when { -- cgit