From 5f9ae3e145a22235df8f71be169b134266a33cb0 Mon Sep 17 00:00:00 2001 From: xeals Date: Mon, 27 Mar 2023 21:51:50 +1100 Subject: [PATCH] track knockouts --- main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.py b/main.py index dd44e85..bb65cbc 100755 --- a/main.py +++ b/main.py @@ -114,6 +114,18 @@ def parse_log(game: str, log: str, into: sqlite3.Connection): """, (game, player, name, specie.split(", ")[0]), ) + case ["faint", mon]: + player, mon = resolve_mon(mon) + conn.execute( + """ + INSERT INTO knockouts(game, turn, player, name) + VALUES(?, ?, ?, ?) + ON CONFLICT DO NOTHING + """, + (game, turn, player, mon), + ) + case _: + debug(f"unhandled message {chunks[0]}") @dataclass(frozen=True)