Commit a926830a authored by user472393's avatar user472393
Browse files

second pass

parent 04328dd6
......@@ -15,12 +15,9 @@ inwee=$HOME/bin/inwee
stream_url=https://twitch.tv/tetrisconcept_tv
site_url=https://tetrisconcept_tv
tmp_dir=$PWD/tmp
test -d "$db_dir" || mkdir "$db_dir"
declare -A elo_db
find_extract () {
# find the pid of the televised match
test -d "$tmp_dir/tv.lock" || quit "promoted without $tmp_dir/tv.lock"
promo_pid=$(find "$tmp_dir/tv.lock" -type f)
......@@ -35,21 +32,24 @@ find_extract () {
info "plers are ${players[0]} ${players[1]}"
}
elo_import () {
test -d "$db_dir" || mkdir "$db_dir"
# import elo ratings from file
for i in "${players[@]}"; do
elo_db[$i]=$(head -n 1 "$db_dir/$i" 2> /dev/null || \
elo_db[$i]=1500)
elo_db[$i]=$(head -n 1 "$db_dir/$i" 2> /dev/null) || \
elo_db[$i]=1500
done
}
spam () {
# spam these channels
# for i in "${advertising[@]}"; do
# printf '%s\n' "${players[0]} (${elo_db[${players[0]}]}) vs. ${players[1]} (${elo_db[${players[1]}]}) on $stream_url" |\
# $inwee -b "$i"
# done
# advertise player and ratings in channels
for i in "${advertising[@]}"; do
printf '%s\n' "${players[0]} (${elo_db[${players[0]}]%.*}) vs. ${players[1]} (${elo_db[${players[1]}]%.*}) on $stream_url" |\
$inwee -b "$i"
done
for i in "${players[@]}"; do
printf '%s\n' "${players[0]} (${elo_db[${players[0]}]}) vs. ${players[1]} (${elo_db[${players[1]}]}) on $site_url" |\
printf '%s\n' "${players[0]} (${elo_db[${players[0]}]%.*}) vs. ${players[1]} (${elo_db[${players[1]}]%.*}) on $site_url" |\
$inwee -b "irc.twitch.#$i"
done
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment