aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-31 22:04:35 +0100
committerGitHub <noreply@github.com>2024-10-31 22:04:35 +0100
commit2c9132d0c755964800b710ce43c8feebd44f1299 (patch)
tree670669e61408ccdf47d9e29cb4d5f1ee3599aa4d /src
parent3115eeef02d541822470f08f298110e37fa7a1e6 (diff)
parent988e4289455b56aa6ba484a502440f640f6656fa (diff)
downloadLocalTransactionLedger-2c9132d0c755964800b710ce43c8feebd44f1299.tar.gz
LocalTransactionLedger-2c9132d0c755964800b710ce43c8feebd44f1299.tar.bz2
LocalTransactionLedger-2c9132d0c755964800b710ce43c8feebd44f1299.zip
Merge pull request https://github.com/nea89o/LocalTransactionLedger/pull/3
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/moe/nea/ledger/Ledger.kt1
-rw-r--r--src/main/kotlin/moe/nea/ledger/NpcDetection.kt2
2 files changed, 2 insertions, 1 deletions
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
*/
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 (?<what>.*?) (x(?<count>$SHORT_NUMBER_PATTERN) )?for (?<coins>$SHORT_NUMBER_PATTERN) Coins!")
+ Pattern.compile("You bought (back )?(?<what>.*?) (x(?<count>$SHORT_NUMBER_PATTERN) )?for (?<coins>$SHORT_NUMBER_PATTERN) Coins!")
val npcSellPattern =
Pattern.compile("You sold (?<what>.*) (x(?<count>$SHORT_NUMBER_PATTERN) )?for (?<coins>$SHORT_NUMBER_PATTERN) Coins!")