pastebin - collaborative debugging
pastebin is a collaborative debugging tool allowing you to share
and modify code snippets while chatting on IRC, IM or a message board.
This site is developed to XHTML and CSS2 W3C standards.
If you see this paragraph, your browser does not support those standards and you
need to upgrade. Visit WaSP
for a variety of options.
#!/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!";
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);
};
Submit a correction or amendment below (click here to make a fresh posting)After submitting an amendment, you'll be able to view the differences between the old and new posts easily.