Tool for finding all the npcs and the images they use

Here is a nifty something that I threw together in Perl, that you can use to extract all the npcs, and the images they use, to files.

Note: I know this works in Windows, can’t speak for other OS’s

To use this tool :

  1. go to and install ActivePerl on your computer. Its free.

  2. copy this code
    use File::Find;
    use Cwd;


foreach my $key (sort {$a cmp $b} keys %img)
print OUT "$key

sub x
#check each .nw file for npcs, and if we find one, export it to its own file
return if -d;
return unless m/\.nw$/;
print “$nwfile
until (eof(FILE))

	if ($isnpc==1)


	if($line =~ /^NPC (.*?) /)
		#create filename
		$npcstring=""; #append to this while $isnpc is 1

	if($line =~ /^NPCEND/)
		# write npc to file
		$outfile=~s/ /\\_/g;
		#print $npcstring;
		print OUT "$npcstring\

unless (-e $outfile)
die "Unable to create $outfile!



  1. In your graal reborn server folder, go to the servers/default/ directory and create a new text file. Open the file and paste in the code. Save the file.

  2. rename the file to or something with the .pl extension. The icon for the file should change (indicating successfull file association with ActivePerl)

  3. create a new folder here in the servers/default directory called perl_npcs

  4. double click the file

then look in the perl_npcs folder and there you go! the all_npc_images_used.txt will appear in the servers/default directory.

Please feel free to provide any constructive feedback and enhancements. I plan to make more of these for finding all levels linked to (then make sure no levels are missing), presence of chests and what type (for example, determine how many full hearts, sword and shield levels, total rupees etc exist within your world) and other stuff

Where are all of these coders coming from? Why don’t they all go to a party, get drunk and make a new client?

Maybe we can get them to help with upgrades.

super sweet

well, for making a new client, my job is in publishing related stuff so most of what I am good at is text-like file processing. not so much on the ui side of things and not a lot of math.

what do you think of an account checking/reset tool for your gserver/servers/default/accounts folder, that would let you remove a single weapon if anyone has it, or report on anyone who has more fullhearts than they should, reset everyone to a particular level-x-y position and, well, anything you can do in the account files.

for example if you wanted to do an account reset on everyone, but let people keep their appearance so they didnt have to sethead, shield, sword, colors all over again … would that be good?

yes pls

get the listserver working again so I can connect … then i’ll think about it :wink:

This would be useful