Syntax : /path/to/cf_get_hiscore.sh <NAME>
Difficulties : Most clients should print
Code: Select all
watch drawinfo 0 76 22788402738 Zebulon
Code: Select all
watch drawextinfo 0 8 5 [Fixed] 76 22788402738[Print] Zebulon
Therefore, if there is nothing found in /tmp/cf_hiscore_list_"$PARM".lst ,
you may need to change the line
Code: Select all
echo watch drawinfo
Code: Select all
echo watch drawextinfo
Code: Select all
#!/bin/bash
# 2018-03-07
# cf_get_hiscore.sh :
# script to get hiscores from server
# and save to a file in /tmp
VERSION=0.0 # Initial version
test "$*" && PARM="$*" || PARM=$$
rm -f /tmp/cf_hiscore_list_"$PARM".lst
echo watch drawinfo
echo issue 1 1 hiscore "$@"
while :; do
unset REPLY
read -t ${TMOUT:-1}
echo "$REPLY" >> /tmp/cf_hiscore_list_"$PARM".lst
test "$REPLY" || break
sleep 0.001
done
echo unwatch