Once upon a time, a casual tank formed a raid coalition for BC. Stuff happened.
Random stasiscl Tricks
Posted 05/27/08 at 5:34 PM by Abbi
If you are not a perl geek, turn away now.
stasiscl is the bees knees. It produces pretty solid charts of raid performance, a la WWS but not dynamic. Even cooler (to me), it is built on a perl parser which is monumentally simple to turn to your own ends.
This is some ends. Yes, my raid group is still working on Archimonde.
The basic tool -- this shows you the data structure each line is parsed into. I use this to figure out what my conditionals are in the bigger scripts.
This prints out log lines in a coherent fashion. There's a quickie built in parser function to do it -- you can see it in the above script, it's $parser->toString() -- but it doesn't print timestamps, which are crucial for analysis. So I added a bit of code to generate timestamps.
You can do some nice tricks with grep and the raw combat log, since it's plaintext, if you just care about certain things. E.g.:
% grep Abbi 05-10-hyjal.txt | ./print.pl
Shows just events involving Abbi.
It could be pretty, but it isn't. I wanted to know who was taking Doomfire damage while the tank was alive. Adding up Doomfire damage is very easy. The fun part of this script is not recording Doomfires after the tank dies -- so I stuck in a simple flag which drops when the UNIT_DIES event fires for the tank, and goes up again when the tank gets buffed with Fort. One assumes the tank will always be buffed with Fort.
The ugly regexp is a hack to put commas into the numbers.
stasiscl is the bees knees. It produces pretty solid charts of raid performance, a la WWS but not dynamic. Even cooler (to me), it is built on a perl parser which is monumentally simple to turn to your own ends.
This is some ends. Yes, my raid group is still working on Archimonde.
Code:
#!/usr/bin/perl
use lib 'lib';
use Stasis::Parser;
use Data::Dumper;
$parser = Stasis::Parser->new(version => 2);
foreach (<>) {
%data = $parser->parse($_);
print Dumper \%data;
}
Code:
#!/usr/bin/perl
use lib 'lib';
use Stasis::Parser;
$parser = Stasis::Parser->new(version => 2);
foreach (<>) {
%data = $parser->parse($_);
@s = split(/\./, $data{t});
@t = split(" ", scalar localtime $data{t});
print $t[3], ".", $s[1], " " x (3 - length($s[1])), " ";
print $parser->toString(\%data);
print "\n";
}
You can do some nice tricks with grep and the raw combat log, since it's plaintext, if you just care about certain things. E.g.:
% grep Abbi 05-10-hyjal.txt | ./print.pl
Shows just events involving Abbi.
Code:
#!/usr/bin/perl
use lib 'lib';
use Stasis::Parser;
$parser = Stasis::Parser->new(version => 2);
$record = 1;
$debug = 0;
$tank = shift;
foreach (<>) {
%data = $parser->parse($_);
if ($data{action} eq "SPELL_DAMAGE" &&
$data{extra}->{spellname} eq "Doomfire" &&
$record) {
$dam{$data{target_name}} += $data{extra}->{amount};
print "$data{target_name} took $data{extra}->{amount}\n" if $debug;
}
if ($data{action} eq "UNIT_DIED" &&
$data{target_name} eq $tank) {
$record = 0;
print "Stopped recording on $tank death.\n" if $debug;
}
if ($data{action} eq "SPELL_AURA_APPLIED" &&
$data{target_name} eq $tank &&
$data{extra}->{spellname} eq "Prayer of Fortitude") {
$record = 1;
print "Started recording on $tank buff.\n" if $debug;
}
}
foreach $ow (sort { $dam{$b} <=> $dam{$a} } keys %dam) {
$dam{$ow} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,
/g;
print $ow, "\t", $dam{$ow}, "\n";
}
The ugly regexp is a hack to put commas into the numbers.
Total Comments 2
Comments
|
|
That's pretty nifty - thanks. I've been playing around with Stasis a fair bit, and while my Perl is pretty rusty it's been very handy.
|
|
|
|
My pleasure. Mine's system administrator perl, which means I use a lot of blunt objects, but it gets by.
![]() |
|
Recent Blog Entries by Abbi
- Automatic Stasiscl Log Posting (08/14/08)
- Revised stasiscl Raid Listing (07/08/08)
- More stasiscl Tricks (Raid Listing Page) (07/07/08)
- stasiscl Tricks, Volume II (06/19/08)
- Random stasiscl Tricks (05/27/08)






