/usr/share/games/crossfire/adm/archsearch.pl is in crossfire-common 1.70.0-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #!/usr/bin/perl
#
# Usage: archsearch.pl file
#
# This script searches a file (either archetypes or maps) for certain
# desired values. It is better than grep in that it keeps track of the
# the archetype it occurs in and does smarter searches (ie, certain
# bitmask values you can search for specific bit sets, which is not
# easy to do with grep)
#
# Originally written to find all the creatures that use ghosthit.
# Modified to find all object types that are being set invisible
# in pupland
#
die("Usage: archsearch.pl file\n") if ($#ARGV < 0);
for ($file=0; $file<=$#ARGV; $file++) {
# print "Proccessing $ARGV[$file]\n";
if (!open(INFILE, "<$ARGV[$file]")) {
print "Can not open $ARGV[$file] - skipping\n";
next;
}
while (<INFILE>) {
if (/^Object (\S+)/ || /^arch (\S+)/) {
$obname = $1;
$invisible=0;
$type=-1;
$x = -1;
$y = -1;
$title="";
}
$object .= $_;
$type = $1 if (/^type (\S+)/);
$title = $1 if (/^title (\S+)/);
$invisible = $1 if (/^invisible (\S+)/);
$x = $1 if (/^x (\S+)/);
$y = $1 if (/^y (\S+)/);
if (/^end$/ ) {
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
# Note that multile searches are certainly possible.
# elsif (/^attacktype (\S+)/) {
# if ($1 & 0x200) {
# print "Found match, object $obname, line $.\n";
# }
# }
} # While loop
}
|