From d9de03ce66ab5224d91dd69ea3753d0be2b1a178 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:56:16 +0100 Subject: fix: NPC Buy Detection not working if you bought back items --- src/main/kotlin/moe/nea/ledger/NpcDetection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/moe/nea/ledger/NpcDetection.kt b/src/main/kotlin/moe/nea/ledger/NpcDetection.kt index 65693ef..3c3fe87 100644 --- a/src/main/kotlin/moe/nea/ledger/NpcDetection.kt +++ b/src/main/kotlin/moe/nea/ledger/NpcDetection.kt @@ -6,7 +6,7 @@ import java.util.regex.Pattern class NpcDetection(val ledger: LedgerLogger, val ids: ItemIdProvider) { val npcBuyPattern = - Pattern.compile("You bought (?.*?) (x(?$SHORT_NUMBER_PATTERN) )?for (?$SHORT_NUMBER_PATTERN) Coins!") + Pattern.compile("You bought (back )?(?.*?) (x(?$SHORT_NUMBER_PATTERN) )?for (?$SHORT_NUMBER_PATTERN) Coins!") val npcSellPattern = Pattern.compile("You sold (?.*) (x(?$SHORT_NUMBER_PATTERN) )?for (?$SHORT_NUMBER_PATTERN) Coins!") -- cgit From 988e4289455b56aa6ba484a502440f640f6656fa Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:57:31 +0100 Subject: feat: Pattern test for bought back npc items --- src/main/kotlin/moe/nea/ledger/Ledger.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/moe/nea/ledger/Ledger.kt b/src/main/kotlin/moe/nea/ledger/Ledger.kt index 23d1265..a11480f 100644 --- a/src/main/kotlin/moe/nea/ledger/Ledger.kt +++ b/src/main/kotlin/moe/nea/ledger/Ledger.kt @@ -50,6 +50,7 @@ class Ledger { // You bought Cactus x32 for 465.6 Coins! // You sold Cactus x1 for 3 Coins! + // You bought back Potato x3 for 9 Coins! TODO: TRADING, FORGE, COOKIE_EATEN */ -- cgit