From: Matthias Krüger Date: Sun, 30 Aug 2015 09:01:38 +0000 (+0200) Subject: add script to change lights X-Git-Tag: xonotic-v0.8.2~181^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6fc15d9f066575c1ebc25fe24dbafad18871b8b3;p=xonotic%2Fxonotic-maps.pk3dir.git add script to change lights --- diff --git a/scripts/modify_lights.sh b/scripts/modify_lights.sh new file mode 100755 index 00000000..3482d208 --- /dev/null +++ b/scripts/modify_lights.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# run : script runningman.map + +FILE=$1 +FACTOR=$2 +IFS=$'\n' +set -f +for line in $(< $1 ); do + if [[ ${line} == *"light"* ]] && [[ `echo $line | awk '{print $1}' | grep -e "\\\\""light" | grep "\""` ]]; then + echo $line + VALUE=`echo $line | cut -d' ' -f2 | sed 's/"//g'` + echo $VALUE + echo '"light"' \"`calc -p ${VALUE}/${FACTOR} | sed s/~//g`\" >> tmp + else + echo $line >> tmp + fi + +done < $1 + +mv tmp $1