hi!
in july hogg wished for a way to keep track of all the rage quits so we can post them on the wikipenia, point, and laugh.
Here ya go:
to get a log from console put -condebug in your l4d launch options then check:
C:\program files\steam\steamapps\common\left 4 dead\left4dead\console.log
here's the goods:
http://www.crapyclawn.net/wikipenia/ind ... Rage_Quits
Code:
#suck my shebang.
# declare variables
my $inp;
my $out;
my %joiners;
my @quits;
# Find all detailed connects with playerId and gamertag. Add them to the hash.
open($inp, "<", "console.log");
while (<$inp>) {
if (/New client. Client Info: ID: (\d+?), Players: 1, Gamertag: (.+?),/) {
# print "$1 - ";
# print "$2\n";
$joiners{$1} = $2;
}
}
# Match the playerID and gamertag to any disconnects missing a gamertag, then store that gamertag.
open($inp, "<", "console.log");
while (<$inp>) {
while (($key, $value) = each(%joiners)){
# print $key." ".$value."\n";
if (/Dropped player: $key/) {
push (@quits, "*$value\n");
}
}
}
# store any clean quits.
open($inp, "<", "console.log");
while (<$inp>) {
if (/Player (.+?) left the game/) {
push (@quits, "*$1\n");
}
}
# De dupe any repeats in the list.
my %hash = map { $_, 1 } @quits;
# or a hash slice: @hash{ @array } = ();
# or a foreach: $hash{$_} = 1 foreach ( @array );
my @unique = keys %hash;
#Store them for posterity:
open($out, ">>", "ragelog.txt");
print $out @unique;
close $out;
print "These rage quitters have been logged:\n";
print @unique;
# thank you to http://perldoc.perl.org/perlfaq4.html#How-can-I-remove-duplicate-elements-from-a-list-or-array%3f for the dedupe.
_________________
We're all gonna die, but I got a helmet.
http://www.explodingdog.com/january2/we ... nadie.html