PDA

View Full Version : spawnlog parser (sort mobs by lvl range)



jonseq
12-19-2002, 05:57 PM
Could someone please run this for spawnlog.txt over the various PoP planes and post the output? I'd like to see what the level ranges of mobs are (for good exping, of course)



#!/usr/local/bin/perl -w
use strict;
my %minlvl=();
my %maxlvl=();
my @bins=();
my $DEBUG=0;
my ($lowest,$highest)=(0,100);

sub out
{
my ($mob) = @_;
print "$minlvl{$mob}-$maxlvl{$mob}\t$mob\n";
}

while (<>) {
next unless
/^.:(\w+)\d\d\([^:]*:(\d+):[^:]*:[^:]*:[^:]*:(\w+)\:/;
my ($mob,$lvl,$zone) = ($1,$2,$3);
print "$mob\t$lvl\t$zone\n" if $DEBUG;
$_=$mob;
next if (
/s_(Mount|warder|familiar|corpse)$/ or
/^Eye_of_/ or
/^[GJKLVXZ]([aeio][bnrsk])+(n|tik)?$/ or
/^[GJKLVXZ]tik$/
);
$mob = "$zone\t$mob";
if (defined($minlvl{$mob})) {
$maxlvl{$mob} = $lvl if ($lvl > $maxlvl{$mob});
$minlvl{$mob} = $lvl if ($lvl < $minlvl{$mob});
} else {
$minlvl{$mob} = $maxlvl{$mob} = $lvl;
}
}
# my @byminlvl = sort { $minlvl{$a} <=> $minlvl{$b} } keys %minlvl;
# for (@byminlvl) {
# &out($_);
# print "$minlvl{$_}-$maxlvl{$_}\t$_\n";
# }

for ($lowest .. $highest) {
$bins[$_] = [];
}
while (my ($k,$v) = each(%minlvl)) {
push @{$bins[$v]},$k;
}
for my $binno ($lowest .. $highest) {
for my $mob (@{$bins[$binno]}) {
&out($mob);
}
}

KaL
12-20-2002, 06:43 AM
I couldn't get this to do anything. Changed DEBUG to 1 and still no dice.

cat spawnlog.txt | spawnparse.pl

Cryonic
12-20-2002, 07:27 AM
did you make spawnparse.pl executable?

man chmod

jonseq
12-20-2002, 12:41 PM
So - you need perl installed.

You can run the program with:

cat spawnlog.txt | perl spawnparse.pl

(or
cat spawnlog.txt | perl spawnparse.pl spawnlog.txt
)

No need to chmod or change the first line to point at `which perl`

Thanks for volunteering to run it =)

jonseq
12-20-2002, 12:50 PM
By the way, the little single quotes on their own line at the beginning and end are not part of the program =) the forum inserts those when you use the code tag

OK, actually the forum added some whitespace, and split a long line into two so it's no wonder it didn't work =) I think this might be related to the smiley detection code (I disabled smilies of course).

I just tried pasting the code and running it ; it never made it past the first regexp, which had an extra space inserted at the beginning of the first regexp, and inserted a newline in the middle of it

Please try running this attachment.

jonseq
12-20-2002, 12:55 PM
see attachment:

jonseq
12-20-2002, 12:59 PM
My attachments show when I edit my post but not when I browse the forum; using latest IE and Mozilla. I do have javascript enabled.

jonseq
12-20-2002, 01:02 PM
Took out some unnecessary backslashes and shortened lines, hoping regexp will quote ok:



#!/usr/local/bin/perl -w
use strict;
my %minlvl=();
my %maxlvl=();
my @bins=();
my $DEBUG=0;
my ($lowest,$highest)=(0,100);

sub out
{
my ($mob) = @_;
print "$minlvl{$mob}-$maxlvl{$mob}\t$mob\n";
}

while (<>) {
next unless
/^.:(\w+)\d\d\([^:]*:(\d+):[^:]*:[^:]*:[^:]*:(\w+)\:/;
my ($mob,$lvl,$zone) = ($1,$2,$3);
print "$mob\t$lvl\t$zone\n" if $DEBUG;
$_=$mob;
next if (
/s_(Mount|warder|familiar|corpse)$/ or
/^Eye_of_/ or
/^[GJKLVXZ]([aeio][bnrsk])+(n|tik)?$/ or
/^[GJKLVXZ]tik$/
);
$mob = "$zone\t$mob";
if (defined($minlvl{$mob})) {
$maxlvl{$mob} = $lvl if ($lvl > $maxlvl{$mob});
$minlvl{$mob} = $lvl if ($lvl < $minlvl{$mob});
} else {
$minlvl{$mob} = $maxlvl{$mob} = $lvl;
}
}
# my @byminlvl = sort { $minlvl{$a} <=> $minlvl{$b} } keys %minlvl;
# for (@byminlvl) {
# &out($_);
# print "$minlvl{$_}-$maxlvl{$_}\t$_\n";
# }

for ($lowest .. $highest) {
$bins[$_] = [];
}
while (my ($k,$v) = each(%minlvl)) {
push @{$bins[$v]},$k;
}
for my $binno ($lowest .. $highest) {
for my $mob (@{$bins[$binno]}) {
&out($mob);
}
}

jonseq
12-20-2002, 01:03 PM
OK - that works after I pasted it from browser into a new file. I recommend anyone who posts code do the same, because this board mangles it.

KaL
12-20-2002, 03:00 PM
The 2nd version works. Nice. Now write one that figures out Quillmane's placeholders.

KaL

jonseq
12-23-2002, 05:17 PM
Can somebody please post the resulting mob/level listing for PoP tier1-3 planes (the more, the merrier)

I don't actually have any of tier 2+ in my spawnlog (not using keysniffer) - I was hoping that somebody who has spent a lot of time in PoP could post the output of my script.

This is for exp purposes, of course (don't wanna fight anything 6 levels or lower than me). I don't trust Illia's bestiary listings for mob levels - they've been wrong before.

I guess it wasn't really necessary to sort the mobs by level - you can just use various combinations of 'sort' and 'grep' to get a desired view.

KaL
12-24-2002, 05:53 AM
Yeah, sorting by zone would have been more practical. Then that subset could be sorted by level.

I've only been to Tier 1 PoP zones (I R lame) but I'll post what I have later.

jonseq
12-26-2002, 12:45 AM
Grep for a specific zone works fairly well; there aren't that many zones either.

You can use the command line 'sort' program to get any desired order.

Thanks, tier 1 would still be interesting.

curio
12-26-2002, 06:57 PM
Small correction to the mob exclusion list.
You were excluding mobs that start with "#" and mobs with ' in their name, which excluded a number of named.

Added pet and mage_pet removal



...
next unless
/^.:[#]*([\w`']+)\d\d\([^:]*:(\d+):[^:]*:[^:]*:[^:]*:(\w+)\:/;
my ($mob,$lvl,$zone) = ($1,$2,$3);
next if $mob =~ m/_pet$/;
next if $mob =~ m/^\w+00$/;
....

curio
12-26-2002, 07:42 PM
I give up. I cant get attachments to show up.

I have mob info for

Thunder
Decay
Honor
Nightmare
Nightmare-b
Disease
Innovation
Justice
Storms
Tactics
Torment
Valor


See this thread: http://seq.sourceforge.net/showthread.php?s=&threadid=2659