From 92465ab7d607f2bf0a73114c43c9c27ba14e9aec Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 7 Aug 2023 22:53:20 +0200 Subject: fixed regex in GhostCounter --- .../skyhanni/features/misc/ghostcounter/GhostCounter.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt index d301fdf6f..a87e88de7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt @@ -54,8 +54,8 @@ object GhostCounter { val hidden get() = ProfileStorageData.profileSpecific?.ghostCounter private var display = emptyList>() var ghostCounterV3File = File("." + File.separator + "config" + File.separator + "ChatTriggers" + File.separator + "modules" + File.separator + "GhostCounterV3" + File.separator + ".persistantData.json") - private val skillXPPattern = "[+](?[0-9,.]+) \\((?[0-9,.]+)(?:\\/(?[0-9,.]+))?\\)".toPattern() - private val combatSectionPattern = ".*[+](?[0-9,.]+) (?[A-Za-z]+) \\((?(?:(?:(?:(?[0-9.,]+)\\/(?[0-9.,]+))|(?:(?[0-9.]+)%))))\\).*".toPattern() + private val skillXPPattern = "[+](?[0-9,.]+) \\((?[0-9,.]+)(?:/(?[0-9,.]+))?\\)".toPattern() + private val combatSectionPattern = ".*[+](?[0-9,.]+) (?[A-Za-z]+) \\((?(?[0-9.,]+)/(?[0-9.,]+)|(?[0-9.]+)%)\\).*".toPattern() private val killComboExpiredPattern = "§cYour Kill Combo has expired! You reached a (?.*) Kill Combo!".toPattern() private val ghostXPPattern = "(?\\d+(?:\\.\\d+)?(?:,\\d+)?[kK]?)\\/(?\\d+(?:\\.\\d+)?(?:,\\d+)?[kKmM]?)".toPattern() private val bestiaryPattern = ".*(?:§\\d|§\\w)+BESTIARY (?:§\\d|§\\w)+Ghost (?:§\\d|§\\w)(?\\d+)➜(?:§\\d|§\\w)(?\\d+).*".toPattern() // &3&lBESTIARY &b&lGhost &89➜&b10 @@ -110,14 +110,13 @@ object GhostCounter { } val xpHourFormatting = config.textFormatting.xpHourFormatting - val xp: String val xpInterp: Float - if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { - xp = xpHourFormatting.noData + val xp = if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { + xpHourFormatting.noData } else { xpInterp = interp(xpGainHour, xpGainHourLast, lastUpdate) val part = "([0-9]{3,}[^,]+)".toRegex().find(format.format(xpInterp))?.groupValues?.get(1) ?: "N/A" - xp = "$part ${if (isKilling) "" else xpHourFormatting.paused}" + "$part ${if (isKilling) "" else xpHourFormatting.paused}" } val killHourFormatting = config.textFormatting.killHourFormatting -- cgit