tanoh
By: a guest | May 7th, 2008 | Syntax:
Perl | Size: 1.27 KB | Hits: 60 | Expires: Never
#!/usr/bin/perl
use strict;
use vars
qw ( %unit @temp );
#
# Lists guids from WoWCombatLog.txt and tries to find collisions in the spawncounter section
#
# Written by Tanoh for EJ discussion, use freely :>
#
open(FIL
,"WoWCombatLog.txt") or die "d, aoh!";
s/^(.+?) //;
foreach my $i ( 1, 4 ) {
if( (hex(substr($temp[$i],2
,3
)) & 0x00f
) == 0x003
) {
$unit{$temp[$i]} = {
'name' => substr($temp[$i+1],1,-1),
'counter' => substr($temp[$i],13
,6
),
};
};
};
};
# check for counter collisions.
foreach my $key ( keys %unit ) {
foreach my $otherkey ( keys %unit ) {
next if( $otherkey eq $key );
if( hex($unit{$key}->{'counter'}) == hex($unit{$otherkey}->{'counter'}) ) {
print "Collision! $key and $otherkey!\n";
};
};
};
# list counters and keys.
foreach my $key ( sort {hex($unit{$a}->{'counter'}) <=> hex($unit{$b}->{'counter'})} keys %unit ) {
printf("%-25s: %s (%s)\n",$unit{$key}->{'name'},$unit{$key}->{'counter'},$key);
};