DarkSideRO Posted April 13, 2012 Posted April 13, 2012 Hi all, recently i had some problem with maps and I need know the Gravity map that best fit my custom map. This is a simple bash script that generate a txt file with maps sorted by width and height. I hope is usefull for someone #!/bin/bash svn co https://openkore.svn.sourceforge.net/svnroot/openkore/fieldpack/trunk/fields/ echo -e Width \\t Height \\t Map > "Maps Dimensions.tmp" for m in $(ls fields | grep fld); do name=$(basename $m ".fld") w=$(cat "fields/$m" | head -c 2 | od -d -An | tr -dc '[:alnum:],\n') h=$(cat "fields/$m" | head -c 4 | tail -c 2| od -d -An | tr -dc '[:alnum:],\n') echo -e $w \\t $h \\t $name >> "Maps Dimensions.tmp" done rm -rf fields sort -t $'\t' -k 1n -k 2n "Maps Dimensions.tmp" > "Maps Dimensions.txt" rm "Maps Dimensions.tmp" Quote
Meroy Posted May 4, 2012 Posted May 4, 2012 Hi, could you specify a little bit? what's the purpose of this 'batch' Thank you! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.