This is a relativly simple SHOUTcast socket script which goes via dialog :D
NOTE:
IMPORTANT:
It didn't work on my mIRC client where my BOT is on.. But on my client (Omerta Script) it did so I hope it works for you guys :p
alias radiostatus {
/dialog -m rankstats rankstats
}
dialog rankstats {
title "Radio Stats"
size -1 -1 300 140
text Song: %nr.song,1,15 10 300 125
text Kbps: %nr.kbps kbps,2,15 25 250 125
text Listeners: %nr.listen,3,15 40 250 125
text Max: %nr.max,4,15 55 250 125
text Top: %nr.peak,5,15 70 250 125
text Unique: %nr.uni,6,15 85 250 125
button "Say!", 7,111 115 60 24
}
on *:dialog:rankstats:sclick:*: {
if ($did == 7) {
if ($active != #YOUR-RADIO-CHANNEL) {
/msg $active 4(Radio Stats) Listeners: %nr.listen 14( $+ %nr.peak top $+ , %nr.max max $+ , %nr.uni unique) 7Song: %nr.song 14(@ %nr.kbps $+ kbps)
}
}
}
on *:sockopen:nr.song: {
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: SHOUTcast Song Status (Mozilla Compatible)
sockwrite -n $sockname Host: 217.121.86.2:8001
sockwrite -n $sockname Connection: keep-alive
sockwrite -n $sockname $crlf
}
on *:sockread:nr.song: {
sockread -fn &bin
var %nr.fullline = $bvar(&bin,108,400).text
set %nr.serverStatus $gettok(%nr.fullline,2,44)
set %nr.kbps $gettok(%nr.fullline,6,44)
set %nr.listen $gettok(%nr.fullline,5,44)
set %nr.max $gettok(%nr.fullline,4,44)
set %nr.song $gettok(%nr.fullline,7,44)
set %nr.song $gettok(%nr.song,1,60)
set %nr.peak $gettok(%nr.fullline,3,44)
set %nr.uni $gettok(%nr.fullline,1,44)
sockclose nr.song
halt
}
else {
set %nr.song No stream was found!
}
sockclose nr.song
If you're trying to run the script on the same machine as the server, you'll want to use something called AMIP. It won't be as fancy, but it still works. http://amip.tools-for.net/wiki/
Then you can make !request and other scripts that don't use sockets for the server.
indeed so.. you have to stream to a dedicated server like viastreaming.net or streamingchoice.com via your SAM or winamp etc. then enter the servers details .. eg s7.viatreaming.net 7650 on the script. then the socket can pick it up direct from them from the bot that the script is on:)
if you use shoutcast's personal stream that runs on your pc, which is not recommended unless you have a T3 connection. most domestic isps will allow you 1meg max up which on a personal stream will give you at 56kbs roughly 20 people able to connect. not to mention the strain on ram and pc resources
try this one. it is what i am using on my server. mirc used was mirc v6.35, server was unrealircd 3.2.7
on *:TEXT:!on:#channel:if ($nick isop $chan) { enable #playsongpop | .timercheckop 0 10 songp }
on *:TEXT:!off:#channel:if ($nick isop $chan) { disable #playsongpop | .timercheckop off }
on *:TEXT:!playing:#:{ stime $chan }
#playsongpop off
alias -l songp {
sockopen songp stream details port
set %kanaal4 $1
}
on *:sockopen:songp: {
sockwrite -n $sockname GET /7 HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname
}
on *:sockread:songp:{
var %t
sockread %t
while ($sockbr) {
sockread -f %t
if ($regex(%t,/<body>(.*?)</body>/)) {
tokenize 44 $regml(1)
if (%last != $7-) {
.msg #channel 12 Current Song playing on your Radio: 4 $7-
set %last $7-
}
}
}
}
#playsongpop end
alias -l stime { enable #playsongpop | songp $1 | .timercheckuser 1 10 disable #playsongpop }
commands here are manual announcer (once per song) !playing
to trigger auto announce (ops only triggerable) !on / !off
any issues , let me know as this is a worker on my mirc