From cf1f6a034b4b5c905506e3e9044b7fdea049925a Mon Sep 17 00:00:00 2001 From: Corey Sotiropoulos Date: Sun, 26 Jan 2025 12:33:32 -0500 Subject: [PATCH] Fix give_items Festival Moogle tool --- tools/give_items.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/give_items.py b/tools/give_items.py index 5e24eec0557..e19b87914cb 100644 --- a/tools/give_items.py +++ b/tools/give_items.py @@ -34,9 +34,9 @@ def connect(): line = f.readline() if not line: break - match = re.match(r"(SQL_\w+)\s+=\s+(\S+)", line) + match = re.findall(r"(SQL_\w+)\s*=\s*(?:\"(.*?)\"|([^\"\s,]+)),", line) if match: - credentials[match.group(1)] = match.group(2) + credentials[match[0][0]] = match[0][2] if match[0][2] else match[0][1] database = credentials["SQL_DATABASE"] host = credentials["SQL_HOST"] @@ -99,6 +99,7 @@ def all_characters(cur): "INSERT IGNORE INTO char_vars (charid, varname, value) VALUES (%s, %s, %s)", (charid, prizes[prize], 1), ) + db.commit() print("Prizes distributed!") return else: @@ -133,6 +134,7 @@ def single_character(cur): "INSERT IGNORE INTO char_vars (charid, varname, value) VALUES (%s, %s, %s)", (row[0], prizes[prize], 1), ) + db.commit() print("Prize distributed!") return else: