version 1.1 | | version 1.2 |
---|
| | |
#!/usr/local/bin/perl | | #!/usr/bin/perl |
# | | # |
# Usage: archsearch.pl file | | # Usage: archsearch.pl file |
# | | # |
| | |
# in pupland | | # in pupland |
# | | # |
| | |
| | |
die("Usage: archsearch.pl file\n") if ($#ARGV < 0); | | die("Usage: archsearch.pl file\n") if ($#ARGV < 0); |
| | |
for ($file=0; $file<=$#ARGV; $file++) { | | for ($file=0; $file<=$#ARGV; $file++) { |
print "Proccessing $ARGV[$file]\n"; | | # print "Proccessing $ARGV[$file]\n"; |
if (!open(INFILE, "<$ARGV[$file]")) { | | if (!open(INFILE, "<$ARGV[$file]")) { |
print "Can not open $ARGV[$file] - skipping\n"; | | print "Can not open $ARGV[$file] - skipping\n"; |
next; | | next; |
| | |
$type=-1; | | $type=-1; |
$x = -1; | | $x = -1; |
$y = -1; | | $y = -1; |
| | $title=""; |
} | | } |
| | $object .= $_; |
$type = $1 if (/^type (\S+)/); | | $type = $1 if (/^type (\S+)/); |
| | $title = $1 if (/^title (\S+)/); |
$invisible = $1 if (/^invisible (\S+)/); | | $invisible = $1 if (/^invisible (\S+)/); |
$x = $1 if (/^x (\S+)/); | | $x = $1 if (/^x (\S+)/); |
$y = $1 if (/^y (\S+)/); | | $y = $1 if (/^y (\S+)/); |
if (/^end$/ && $invisible) { | | if (/^end$/ ) { |
print "Object $obname (type $type) @ $x, $y is invisible\n"; | | if ($obname =~ /^altar/ && $title ne "") { |
| | print "$ARGV[$file]\n$object"; |
| | } |
| | # print "Object $obname (type $type) @ $x, $y is invisible\n"; |
| | $object=""; |
} | | } |
# This is what we are searching for. value will be put in $1 | | # This is what we are searching for. value will be put in $1 |
# Note that multile searches are certainly possible. | | # Note that multile searches are certainly possible. |