I do not take credit for this, It was on the old mangos forums waaaaay back, and I just stumpled upon the files on my server. Thought I wanted to share.
Note, this only works for linux, cause its using bash scripts.
First make sure you have the correct settings in mangos.conf (all the way in the bottom)
Ra.Enable = 1
Ra.IP = 127.0.0.1
Ra.Port = 3443
Ra.MinLevel = 3 (what gm levels that are allowed to connect to the telnet realm server
Ra.Secure = 1
Then you need to make 3 files
messages.sh
starttelnet.sh
telnet.sh
And they should look something like this
messages.sh
#!/bin/sh
/home/user/adscript/telnet.sh | /home/user/adscript/starttelnet.sh
echo Done
starttelnet.sh
#!/bin/sh
telnet -e X
telnet.sh
#!/bin/sh
host=127.0.0.1 #server hostname or IP address
port=3443
login="USER account" #RA console commands for login user
passwd="PASS password" #and the password
message1="This is the first message"
message2="This is the second message"
message3="This is the third message"
mess=$[ ( $RANDOM % 3 ) + 1 ] # replace "3" with real number of your messages
echo open $host $port
sleep 1
echo $login
sleep 1
echo $passwd
sleep 1
case $mess in
1)
echo "announce $message1";
;;
2)
echo "announce $message2";
;;
3)
echo "announce $message3";
;;
# and so on..
esac
sleep 1
echo X
sleep 1
echo quit
Then all you need to do, is add the script to crontab, if you want it to run automaticly every xx minutes
type crontab -e to get your crontab, and insert this line in the bottom.
*/15 * * * * /home/user/adscript/messages.sh > /dev/null 2>&1
and your done..
you can naturally test the script by typing
./home/user/adscript/messages.sh in shell
have fun with it..