#!/bin/bash

source ~/.gamerc

echo "Get gold farmer list ..." | colorize cyan
sendscript allwz nosave nohostname -p < ~/bin/gold_farmer_list

mkdir -p ~/www/goldfarmer

echo "Get back the list ..." | colorize cyan
sendscript allwz nosave <<< "scp /tmp/gold_farmer-* $TEST_SERVER_USER@test:~/www/goldfarmer"

echo -n "Generate list for GMTool ... " | colorize cyan
for set in $SET_NUMBER_LIST ; do
	echo -n "$set " | colorize green
	awk -F, '{print $3"|in 3 hours, kill "$1" mobs that got no exp(map "$4", char_id "$2")|"}' ~/www/goldfarmer/gold_farmer-set_$set-channel_* \
	| sort -gr -k 5 > ~/www/goldfarmer/get_in_jail-set_$set.txt
done
echo
