from standard_pattern import player class player_weaponstats2: # "froggy420<2687><STEAM_0:1:9830121><CT>" triggered "weaponstats" (weapon "m4a1") (shots "27") (hits "3") (kills "0") (headshots "0") (tks "0") (damage "60") (deaths "0") pattern = re.compile(player()+" triggered \"weaponstats2\" \(weapon \"(?P<weapon>.*)\"\) \(head \"(?P<head>[0-9]+)\"\) \(chest \"(?P<chest>[0-9]+)\"\) \(stomach \"(?P<stomach>[0-9]+)\"\) \(leftarm \"(?P<leftarm>[0-9]+)\"\) \(rightarm \"(?P<rightarm>[0-9]+)\"\) \(leftleg \"(?P<leftleg>[0-9]+)\"\) \(rightleg \"(?P<rightleg>[0-9]+)\"\)") @staticmethod def isMatch(instr): return (player_weaponstats2.pattern.match(instr) != None) def __init__(self,instr): obj = player_weaponstats2.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.team = obj.group("team") self.weapon = obj.group("weapon") self.head = obj.group("head") self.chest = obj.group("chest") self.leftarm = obj.group("leftarm") self.rightarm = obj.group("rightarm") self.leftleg = obj.group("leftleg") self.rightleg = obj.group("rightleg") def __str__(self): return "player %s weaponstats2 for %s" % (self.name,self.weapon) from eventhandler import eventhandler eventhandler.registerEvent(player_weaponstats2)
pattern = re.compile(player()+" attacked "+player2()+" with \"(?P<weapon>.*)\" \(damage \"(?P<damage>[0-9]+)\"\) \(damage_armor \"(?P<damage_armor>[0-9]+)\"\) \(health \"(?P<health>[0-9]+)\"\) \(armor \"(?P<armor>[0-9]+)\"\) \(hitgroup \"(?P<hitgroup>[a-zA-Z_\s]+)\"\)") @staticmethod def isMatch(instr): return (player_attacked.pattern.match(instr) != None) def __init__(self,instr): obj = player_attacked.pattern.match(instr) self.attacker_name = obj.group("name") self.attacker_uniqueid = obj.group("uniqueid") self.attacker_steamid = obj.group("steamid") self.attacker_team = obj.group("team") self.victim_name = obj.group("name2") self.victim_uniqueid = obj.group("uniqueid2") self.victim_steamid = obj.group("steamid2") self.victim_team = obj.group("team2") self.weapon = obj.group("weapon") self.damage = int(obj.group("damage")) self.damage_armor = int(obj.group("damage_armor")) self.health = int(obj.group("health")) self.armor = int(obj.group("armor")) self.hitgroup = obj.group("hitgroup") def __str__(self): return "player %s did %s damage to %s" % (self.attacker_name,self.damage,self.victim_name) from eventhandler import eventhandler eventhandler.registerEvent(player_attacked)
import re from standard_pattern import player class player_suicide: # "[SC-UBW] Yahn<2292><BOT><TERRORIST>" committed suicide with "world" pattern = re.compile(player()+" committed suicide with \"(?P<weapon>.*)\"") @staticmethod def isMatch(instr): return (player_suicide.pattern.match(instr) != None) def __init__(self,instr): obj = player_suicide.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.team = obj.group("team") self.weapon = obj.group("weapon") def __str__(self): return "player %s committed suicide with %s" % (self.name,self.weapon) from eventhandler import eventhandler eventhandler.registerEvent(player_suicide)
import re from standard_pattern import player class player_connect: # "[SC-UBW] Don<2273><BOT><Team>" connected, address "none" pattern = re.compile(player()+" connected, address \"(?P<ip>.*)\"") @staticmethod def isMatch(instr): return (player_connect.pattern.match(instr) != None) def __init__(self,instr): obj = player_connect.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.ip = obj.group("ip") self.team = obj.group("team") def __str__(self): return "player connected %s (%s) (%s)" % (self.name,self.steamid,self.ip) from eventhandler import eventhandler eventhandler.registerEvent(player_connect)
import re from standard_pattern import player class player_validated: # "[SC-UBW] Don<2273><BOT><Team>" STEAM USERID validated pattern = re.compile(player()+" STEAM USERID validated") @staticmethod def isMatch(instr): return (player_validated.pattern.match(instr) != None) def __init__(self,instr): obj = player_validated.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.team = obj.group("team") def __str__(self): return "player steamid validated %s (%s)" % (self.name,self.steamid) from eventhandler import eventhandler eventhandler.registerEvent(player_validated)
import re from standard_pattern import player class player_joinedteam: # "[SC-UBW] Don<2273><BOT><Unassigned>" joined team "TERRORIST" pattern = re.compile(player()+" joined team \"(?P<new_team>.*)\"") @staticmethod def isMatch(instr): return (player_joinedteam.pattern.match(instr) != None) def __init__(self,instr): obj = player_joinedteam.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.oldteam = obj.group("team") self.newteam = obj.group("new_team") def __str__(self): return "player %s (%s) joined team %s" % (self.name,self.steamid,self.newteam) from eventhandler import eventhandler eventhandler.registerEvent(player_joinedteam)
import re class world_triggered: # World triggered "Round_End" pattern = re.compile("World triggered \"(?P<event>.*)\"") @staticmethod def isMatch(instr): return (world_triggered.pattern.match(instr) != None) def __init__(self,instr): obj = world_triggered.pattern.match(instr) self.event = obj.group("event") def __str__(self): return "World triggered %s" % (self.event) from eventhandler import eventhandler eventhandler.registerEvent(world_triggered)
import re class team_scored: # Team "CT" scored "1" with "4" players pattern = re.compile("Team \"(?P<team>.*)\" scored \"(?P<score>[0-9]+)\" with \"(?P<players>[0-9]+)\" players") @staticmethod def isMatch(instr): return (team_scored.pattern.match(instr) != None) def __init__(self,instr): obj = team_scored.pattern.match(instr) self.team = obj.group("team") self.score = obj.group("score") self.playercount = obj.group("players") def __str__(self): return "%s scored %s with %s players" % (self.team,self.score,self.playercount) from eventhandler import eventhandler eventhandler.registerEvent(team_scored)
import re class server_map: # Started map "de_dust2" (CRC "1413637712") pattern = re.compile("Started map \"(?P<mapname>.*)\" \(CRC \"(?P<crc>[0-9]*)\"\)") @staticmethod def isMatch(instr): return (server_map.pattern.match(instr) != None) def __init__(self,instr): obj = server_map.pattern.match(instr) self.map = obj.group("mapname") self.crc = obj.group("crc") def __str__(self): return "server changed map to %s" % (self.map) from eventhandler import eventhandler eventhandler.registerEvent(server_map)
import re class server_cvar: # server_cvar: "mp_friendlyfire" "1" pattern = re.compile("server_cvar: \"(?P<cvar>.*)\" \"(?P<value>.*)\"") @staticmethod def isMatch(instr): return (server_cvar.pattern.match(instr) != None) def __init__(self,instr): obj = server_cvar.pattern.match(instr) self.cvar = obj.group("cvar") self.value = obj.group("value") def __str__(self): return "server_cvar: %s changed to \"%s\"" % (self.cvar,self.value) from eventhandler import eventhandler eventhandler.registerEvent(server_cvar)
import re from standard_pattern import player class player_teamsay: # "[SC-UBW] Mike<2277><BOT><TERRORIST>" say_team "wtf?" pattern = re.compile(player()+" say_team \"(?P<message>.*)\"") @staticmethod def isMatch(instr): return (player_teamsay.pattern.match(instr) != None) def __init__(self,instr): obj = player_teamsay.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.message = obj.group("message") def __str__(self): return "%s team says %s" % (self.name,self.message) from eventhandler import eventhandler eventhandler.registerEvent(player_teamsay)
class player_killed: # "[SC-UBW] Irving<41><BOT><TERRORIST>" killed "[SC-UBW] Wyatt<38><BOT><CT>" with "mac10" (headshot) # "[SC-UBW] Derek<34><BOT><CT>" killed "[SC-UBW] Irving<41><BOT><TERRORIST>" with "usp" pattern = re.compile(player()+" killed "+player2()+" with \"(?P<weapon>.*)\"(?P<headshot>.*)") @staticmethod def isMatch(instr): return (player_killed.pattern.match(instr) != None) def __init__(self,instr): obj = player_killed.pattern.match(instr) self.attacker_name = obj.group("name") self.attacker_uniqueid = obj.group("uniqueid") self.attacker_steamid = obj.group("steamid") self.attacker_team = obj.group("team") self.victim_name = obj.group("name2") self.victim_uniqueid = obj.group("uniqueid2") self.victim_steamid = obj.group("steamid2") self.victim_team = obj.group("team2") self.weapon = obj.group("weapon") self.headshot = len(obj.group("headshot").strip()) > 1 def __str__(self): return "player %s killed %s with %s headshot: %i" % (self.attacker_name,self.victim_name,self.weapon,self.headshot) from eventhandler import eventhandler eventhandler.registerEvent(player_killed)
import re from standard_pattern import player class player_enteredgame: # "[SC-UBW] Don<2273><BOT><>" entered the game pattern = re.compile(player()+" entered the game") @staticmethod def isMatch(instr): return (player_enteredgame.pattern.match(instr) != None) def __init__(self,instr): obj = player_enteredgame.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.oldteam = obj.group("team") def __str__(self): return "player %s (%s) entered the game" % (self.name,self.steamid) from eventhandler import eventhandler eventhandler.registerEvent(player_enteredgame)
import re class team_triggered: # Team "TERRORIST" triggered "Terrorists_Win" (CT "1") (T "4") pattern = re.compile("Team \"(?P<team>.*)\" triggered \"(?P<event>[\w\s]*)\"(?P<extradata>.*)") @staticmethod def isMatch(instr): return (team_triggered.pattern.match(instr) != None) def __init__(self,instr): obj = team_triggered.pattern.match(instr) self.team = obj.group("team") self.event = obj.group("event") def __str__(self): return "%s triggered %s" % (self.team,self.event) from eventhandler import eventhandler eventhandler.registerEvent(team_triggered)
import re from standard_pattern import player class player_triggered: # "[SC-UBW] Don<2273><BOT><TERRORIST>" triggered "Got_The_Bomb" pattern = re.compile(player()+" triggered \"(?P<event>[A-Za-z0-9_]*)\"") @staticmethod def isMatch(instr): return (player_triggered.pattern.match(instr) != None) def __init__(self,instr): obj = player_triggered.pattern.match(instr) self.name = obj.group("name") self.uniqueid = obj.group("uniqueid") self.steamid = obj.group("steamid") self.team = obj.group("team") self.event = obj.group("event") def __str__(self): return "player %s (%s) triggered event %s" % (self.name,self.steamid,self.event) from eventhandler import eventhandler eventhandler.registerEvent(player_triggered)