This dumps from parfait's .src files.

   1 #!python
   2 
   3 import sys, os, re
   4 
   5 def print_safe(string):
   6     sys.stdout.buffer.write((str(string)+"\n").encode("utf-8"))
   7 
   8 for fn in sys.argv[1:]:
   9     if not fn.endswith(".src"):
  10         continue
  11     with open(fn, "r", encoding="cp932") as f:
  12         for line in f.readlines():
  13             line = re.sub(r"//.*", "", line).strip()
  14             if line == "":
  15                 continue
  16             message = re.search(r'SetMessage[^\(]*\([^,]*,[^,]*,[^"]*"[^"]*"[^,]*,[^"]*"([^"]*)"[^\)]*\)', line)
  17             #message = re.search(r'(SetMessage)', line)
  18             if message:
  19                 message = message.group(1)
  20                 message = re.sub(r"@[vhstwmfio][0-9a-zA-Z_]*", "", message)
  21                 
  22                 message = re.sub(r"@[npkeag]", "", message)
  23                 print_safe(message)
  24                 if "@" in message:
  25                     exit()
  26                 allowed = ["Merry", "World", "Space", "blueberry", "strawberry", "pudding", "Excuse", "Later", "Wait", "Something", "Again", "cakes", "possible", "problem", "waiting", "Thank"]
  27                 if re.search(r'[a-zA-Z_]', message) and not sum([term in message for term in allowed]):
  28                     exit()

Nexas (last edited 2018-05-02 05:02:37 by weh)