Skip to content

Instantly share code, notes, and snippets.

@Yepoleb
Last active March 5, 2020 23:06
Show Gist options
  • Save Yepoleb/fee896f9834fd2e17a949f32ab471b41 to your computer and use it in GitHub Desktop.
Save Yepoleb/fee896f9834fd2e17a949f32ab471b41 to your computer and use it in GitHub Desktop.
import re
import string
import os
LOGFILE_NAME = os.path.expanduser(
"~/.steam/steam/steamapps/common/Team Fortress 2/tf/console.log")
# TF2 launch options: -rpt
f = open(LOGFILE_NAME)
cheaters = set()
while True:
line = f.readline()
match = re.match(r"^(?:\*DEAD\* )?(.*?)\u200f? : \x1b", line)
if match:
cheater_name = match.group(1)
if cheater_name not in cheaters:
cheaters.add(cheater_name)
print(cheater_name)
if line.endswith("connected\n") and "niggerkiller" in line.lower():
print("Niggerkiller joined")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment