ratcatcher/website/getname.sh

22 lines
387 B
Bash
Executable File

# 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`
NAMELINE=`head -n $LINE map.dat | tail -n 1`
NAME=`echo $NAMELINE | awk -F',' '{print $3}'`
#echo Level $WORLD-$LEVEL is $NAME
echo $NAME