To run this, save the latest map from
SLMaps.com as "map.htm" in the same folder, then run this script using Perl. The output will be a file named "simData.txt" which you can open and copy to a notecard named simData in game for the pathfinder.
#!/usr/bin/perl -w
open MAP, "map.htm" or warn "can't open map.htm\n", <STDIN>, die;
@allLines = <MAP>;
close MAP;
$allLines[0] =~ /date (.{10}) /;
open SAVEFILE, ">simData.txt";
print SAVEFILE "### Pathfinder database ### Last updated $1 ###\n";
for ($i = 0; $i < @allLines; ++$i) {
if ($allLines[$i] =~ /<tr /) {
if (@xRow) {
push @map, ([@xRow]);
@xRow = ();
}
}
if ($allLines[$i] =~ /<td /) {
if ($allLines[$i] =~ m!<td.*?>(.*?)</td>!) {
push @xRow, ($1 eq "" ? "0" : $1);
}
else {
$allLines[$i + 1] =~ m!secondlife://!;
$i += 2;
push @xRow, ("1");
}
}
}
print SAVEFILE "$map[0][3], $map[0][-4], $map[-2][0], $map[2][0]\n";
for ($y = @map - 2; $y > 1; --$y) {
for ($x = 3; $x < @{ $map[$y] } - 3; ++$x) {
$toSplit .= $map[$y][$x];
}
}
while($toSplit =~ s/(.{255})//) {
$output .= "$1\n";
}
$output .= $toSplit;
print SAVEFILE $output;
Pathfinder script |
Output as of 2005-03-10