Last active
November 7, 2016 23:43
-
-
Save farmboy0/d5ac9f82b46d0722ce236015b683aae6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
typeset DATA_PATH="/mnt/work/Xoreos/unpacked" | |
typeset PROGRAM_PATH="/home/eho/programs/010editor" | |
typeset DEFAULT_LOG_FILE="$DATA_PATH/010analyze.txt" | |
typeset RESTART_COUNT=100 | |
#set -x | |
if [[ $# != 3 ]]; | |
then | |
echo "Usage: $0 <template> <start> <stop>" | |
exit 1 | |
fi | |
template=$1 | |
start=$2 | |
end=$3 | |
game=${template%"MDL.bt"} | |
game=${game,,} | |
#echo $game | |
logfile="010analyze_"$game"_"$(date +%Y-%m-%d_%H.%M.%S)".txt" | |
#echo $logfile | |
gamedir="$DATA_PATH/$game" | |
firstmdl=$(find $gamedir -name "*.mdl" -print -quit) | |
#echo $firstmdl | |
countStart=$start | |
while [ $countStart -lt $end ]; | |
do | |
countEnd=$[$countStart+$RESTART_COUNT] | |
if [[ $countEnd -gt $end ]]; | |
then | |
countEnd=$end | |
fi | |
$PROGRAM_PATH/010editor $firstmdl -template:$template -script:AnalyzeModels.1sc:\($template,$countStart,$countEnd\) -noui | |
cat $DEFAULT_LOG_FILE >> $logfile | |
countStart=$countEnd | |
done | |
cat $logfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment