Created
May 13, 2013 01:10
-
-
Save JMatthewman/5565595 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 | |
if [ $# -lt 3 ] | |
then | |
echo "Useage: [string] [loops] [interval]" | |
else | |
STRING=$1 | |
COUNTER=$2 | |
INTERVAL=$3 | |
if [ "$(screen -ls | grep TS3client)" == "" ] | |
then | |
screen -A -m -d -S TS3name telnet 192.168.0.100 25639; | |
sleep 0.5; | |
fi | |
if [ $STRING == "COUNT" ] | |
then | |
while [ $COUNTER -gt 0 ] | |
do | |
screen -x TS3name -p 0 -X stuff "sendtextmessage targetmode=2 msg="$COUNTER"$(echo -ne '\r')" | |
COUNTER=$(( $COUNTER - 1 )) | |
sleep $INTERVAL | |
done | |
exit | |
fi | |
while [ $COUNTER -gt 0 ] | |
do | |
screen -x TS3name -p 0 -X stuff "sendtextmessage targetmode=2 msg="$STRING"$(echo -ne '\r')" | |
COUNTER=$(( $COUNTER - 1 )) | |
sleep $INTERVAL | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment