#!/bin/perl -w # Party Kills log processor v0.3 # Programmed and designed by Matti 'ccr' Hämäläinen (aka Ggr Pupunen) # (C) Copyright 2004 Tecnic Software productions (TNSP) # # Inputs: BatMUD logs # Output: List of killed monsters with count of kills, # exp from each kill and average of those. # # Format of output, one line (without quotes): # "monster name:number of times killed:exp from kills (separated by spaces):min:max:average # while (<>) { if (/^\| *([0-9]+): (.*) +\|$/) { $mexp = $1; $mname = $2; $mname =~ s/ *$//; $mobs{$mname}++ unless ($mscores{$mname}{$mexp}); $mscores{$mname}{$mexp}++; } } foreach $i (keys %mobs) { print "$i:$mobs{$i}:"; $v = 0; $n = 0; $imin = 9999999; $imax = -1; foreach $j (keys %{$mscores{$i}}) { print "$j "; if ($j < $imin) { $imin = $j; } if ($j > $imax) { $imax = $j; } $v += $j; $n++; } print ":".$imin.":".$imax.":".($v / $n)."\n"; }