2008-12-03 09:05:17 +11:00
|
|
|
# Shows name for given level
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "usage: ./getname world_num level_num"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
WORLD=$1
|
|
|
|
LEVEL=$2
|
|
|
|
|
|
|
|
ADJWORLD=`expr $WORLD - 1`
|
|
|
|
ADJLEVEL=`expr $LEVEL - 1`
|
|
|
|
|
|
|
|
LINE1=`expr $ADJWORLD \* 20 + $ADJLEVEL`
|
|
|
|
LINE=`expr $LINE1 + 1`
|
|
|
|
|
2008-12-03 09:06:08 +11:00
|
|
|
NAMELINE=`head -n $LINE map.dat | tail -n 1`
|
2008-12-03 09:05:17 +11:00
|
|
|
NAME=`echo $NAMELINE | awk -F',' '{print $3}'`
|
|
|
|
|
|
|
|
#echo Level $WORLD-$LEVEL is $NAME
|
|
|
|
echo $NAME
|