rendered paste bodyon *:LOAD:{
set %shoutcast.website http://www.change.me
set %shoutcast.name Change me
set %shoutcast.server Change me
set %shoutcast.currentdj None
set %shoutcast.news Change me
set %shoutcast.trigger @
set %shoutcast.port Change me
set %shoutcast.channel #Change Me
set %shoutcast.colour1 0,1
set %shoutcast.colour2 1,0
set %shoutcast.channeltopic Welcome to <StationName> - Current DJ: <CurrentDJ> - Server: <Server> Website: <website> News: <news>
set %shoutcast.commandformat <CommandTopic>: <CommandValue>
set %shoutcast.method 1
echo -a Succesfully loaded ShoutCast addon (By zardoz) (Moded by Platinum)
echo -a If you have any questions about this addon /msg platinum @ Qnet #GamersDatabase
echo -a Send buggs to ufo391@hotmail.com or /msg Platinum-
timer1 1 3 dialog -mr shoutcast shoutcast
}
;;;END
;;;DIALOGS
dialog shoutcast {
title Shoutcast $shoutcast.version - (Zardoz) (Moded by Platinum)
size -1 -1 210 110
option dbu
button "&OK", 13, 161 90 37 12, ok
button "&Cancel", 14, 119 90 37 12, cancel
tab "Config", 1, 4 2 193 82
edit %shoutcast.name, 2, 6 27 188 10, tab 1 autohs
edit %shoutcast.server, 3, 6 48 111 10, tab 1 autohs
edit %shoutcast.port, 4, 120 48 40 10, tab 1 autohs
edit %shoutcast.trigger, 5, 163 48 31 10, tab 1
edit %shoutcast.website, 6, 6 69 121 10, tab 1 autohs
edit %shoutcast.channel, 7, 130 69 65 10, tab 1 autohs
text "IRC Channel:", 55, 130 61 41 8, tab 1
text "Website:", 54, 7 61 54 8, tab 1
text "Port:", 52, 121 40 16 8, tab 1
text "Server Address:", 51, 7 40 63 8, tab 1
text "Station Name:", 50, 7 19 71 8, tab 1
text "Trigger:", 53, 164 40 25 8, tab 1
tab "Format", 34
text "Channel Topic:", 56, 8 18 51 8, tab 34
edit %shoutcast.channeltopic, 8, 7 26 188 10, tab 34 autohs
text "Variables: <StationName> <CurrentDJ> <Server> <News> <website>", 57, 7 38 188 8, tab 34
text "Command Responses:", 58, 7 51 80 8, tab 34
edit %shoutcast.commandformat, 9, 7 59 187 10, tab 34 autohs
text "Variables: <CommandTopic> <CommandValue>", 59, 8 70 124 8, tab 34
tab "News", 44
text "Change news:", 40, 8 18 48 8, tab 44 autohs
edit %shoutcast.news, 10, 7 26 187 10, tab 44 autohs
tab "Colours", 61
text "Colour Two:", 62, 7 40 63 8, tab 61
text "Colour one:", 63, 7 19 71 8, tab 61
edit %shoutcast.colour1, 64, 6 27 60 10, tab 61 autohs %shoutcast.colour1
edit %shoutcast.colour2, 65, 6 48 60 10, tab 61 autohs %shoutcast.colour2
link "_zardoz Website", 32, 7 96 66 8
text "Author: zardoz", 33, 7 89 60 8
link "Platinums Website", 100, 55 96 50 8
text "Moder: Platinum", 101, 55 89 50 8
}
ON *:DIALOG:shoutcast:sclick:13:{
set %shoutcast.name $did(shoutcast,2)
set %shoutcast.server $did(shoutcast,3)
set %shoutcast.port $did(shoutcast,4)
set %shoutcast.trigger $did(shoutcast,5)
set %shoutcast.website $did(shoutcast,6)
set %shoutcast.channel $did(shoutcast,7)
set %shoutcast.channeltopic $did(shoutcast,8)
set %shoutcast.commandformat $did(shoutcast,9)
set %shoutcast.news $did(shoutcast,10)
}
on *:DIALOG:shoutcast:sclick:32:{ url http://www.zard0z.org }
on *:DIALOG:shoutcast:sclick:101:{ url http://www.GamersDatabase.com }
;;;END
;;;MENU
menu channel,menubar,query,status,nicklist {
Shoutcast $shoutcast.version
.Configure:dialog -mr shoutcast shoutcast
}
;;;END
;;; NICK & QUIT
on *:NICK:{
if ( $nick == %shoutcast.currentdj ) {
set %shoutcast.currentdj $newnick
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,%shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 9Onair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
}
on *:QUIT:{
if ( $nick == %shoutcast.currentdj ) {
set %shoutcast.currentdj None
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,%shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 4Offair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
}
;;;END
;;VERSION
alias shoutcast.version { return v2.0 }
;;END
;;DJ Login
;DJ Login
on *:TEXT:$(%shoutcast.trigger $+ onair):%shoutcast.channel:{
if ( $nick isop %shoutcast.channel ) {
if ( %shoutcast.currentdj == None ) {
set %shoutcast.currentdj $nick
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 9Onair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
else { .msg $nick Error: Someone else is already logged in! }
}
else { .msg $nick 4Access Denied! }
}
on *:TEXT:$(%shoutcast.trigger $+ override):%shoutcast.channel:{
if ( $nick == [Kr]AmoS[aP] ) {
set %shoutcast.currentdj $nick
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 9Onair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
else { .notice $nick 4Access Denied! }
}
on *:TEXT:$(%shoutcast.trigger $+ offair):%shoutcast.channel:{
if ( %shoutcast.currentdj == $nick ) {
set %shoutcast.currentdj None
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,%shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 4Offair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
else if ( $address == amos-sik@kG`AmoS.plays-countar-skript.gamesurge ) {
set %shoutcast.currentdj None
set %shoutcast.currenttopic %shoutcast.channeltopic
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<StationName>,%shoutcast.colour1 %shoutcast.name)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<CurrentDJ>,%shoutcast.colour2 %shoutcast.currentdj)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Server>,%shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<News>,%shoutcast.colour2 %shoutcast.news)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<Website>,%shoutcast.colour2 %shoutcast.website)
set %shoutcast.currenttopic $replace(%shoutcast.currenttopic,<air>,%shoutcast.colour2 4Offair0)
topic %shoutcast.channel %shoutcast.currenttopic
}
else { .notice $nick Error: You are not logged in as the current dj. }
}
;;END
;;;Normal Commands
on *:TEXT:$(%shoutcast.trigger $+ dj):*:{
set %shoutcast.djcommand %shoutcast.commandformat
set %shoutcast.djcommand $replace(%shoutcast.djcommand,<CommandTopic>, %shoutcast.colour1 Current DJ)
set %shoutcast.djcommand $replace(%shoutcast.djcommand,<CommandValue>,%shoutcast.colour2 %shoutcast.currentdj)
notice $nick %shoutcast.djcommand
}
on *:TEXT:$(%shoutcast.trigger $+ website):%shoutcast.channel:{
set %shoutcast.websitecommand %shoutcast.commandformat
set %shoutcast.websitecommand $replace(%shoutcast.websitecommand,<CommandTopic>,%shoutcast.colour1 Website)
set %shoutcast.websitecommand $replace(%shoutcast.websitecommand,<CommandValue>,%shoutcast.colour2 %shoutcast.website)
notice $nick %shoutcast.websitecommand
}
on *:TEXT:$(%shoutcast.trigger $+ server):*:{
set %shoutcast.servercommand %shoutcast.commandformat
set %shoutcast.servercommand $replace(%shoutcast.servercommand,<CommandTopic>,%shoutcast.colour1 Server)
set %shoutcast.servercommand $replace(%shoutcast.servercommand,<CommandValue>,%shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
notice $nick %shoutcast.servercommand
}
on *:text:$(%shoutcast.trigger $+ server):%shoutcast.channel:{ notice $nick %shoutcast.colour1 Server : %shoutcast.colour2 http:// $+ %shoutcast.server $+ : $+ %shoutcast.port $+ /listen.pls)
}
on *:TEXT:$(%shoutcast.trigger $+ commands):%shoutcast.channel:{
set %shoutcast.commscommand %shoutcast.commandformat
set %shoutcast.commscommand $replace(%shoutcast.commscommand,<CommandTopic>,Commands)
if (%shoutcast.method == 1 ) { set %shoutcast.commscommand $replace(%shoutcast.commscommand,<CommandValue>,%shoutcast.trigger $+ server %shoutcast.trigger $+ dj %shoutcast.trigger $+ listeners %shoutcast.trigger $+ peak %shoutcast.trigger $+ song %shoutcast.trigger $+ bitrate %shoutcast.trigger $+ shoutout %shoutcast.trigger $+ request %shoutcast.trigger $+ website %shoutcast.trigger $+ djs %shoutcast.trigger $+ news) }
elseif (%shoutcast.method == 0 ) { set %shoutcast.commscommand $replace(%shoutcast.commscommand,<CommandValue>,%shoutcast.trigger $+ server %shoutcast.trigger $+ dj %shoutcast.trigger $+ listeners %shoutcast.trigger $+ peak %shoutcast.trigger $+ song %shoutcast.trigger $+ bitrate %shoutcast.trigger $+ shoutout %shoutcast.trigger $+ request %shoutcast.trigger $+ website %shoutcast.trigger $+ news) }
notice $nick %shoutcast.commscommand
}
on *:TEXT:$(%shoutcast.trigger $+ news):%shoutcast.channel:{ notice $nick %shoutcast.colour1 %shoutcast.newscommand
}
on *:TEXT:$(%shoutcast.trigger $+ addnews*):%shoutcast.channel:{
if ($nick isvoice $chan) { set %shoutcast.newscommand $2- | notice $nick News Added: $2- | topic %shoutcast.channel %shoutcast.currenttopic }
else { notice $nick Access denied | onotice $chan $nick Tryed to use a @ command } }
;;;END
;;;Shoutout
on *:TEXT:$(%shoutcast.trigger $+ shoutout*):%shoutcast.channel:{
if ( %shoutcast.currentdj == None ) { .notice $nick Error: No DJ is on air to send shoutout to. }
else {
.notice $nick Your shoutout " $+ $2- $+ " has been sent.
set %shoutcast.shoutoutcommand %shoutcast.commandformat
set %shoutcast.shoutoutcommand $replace(%shoutcast.shoutoutcommand ,<CommandTopic>,%shoutcast.colour1 Shoutout From $nick)
set %shoutcast.shoutoutcommand $replace(%shoutcast.shoutoutcommand ,<CommandValue>,%shoutcast.colour2 $2-)
msg %shoutcast.currentdj %shoutcast.shoutoutcommand
}
}
;;;END
;;;Request
on *:TEXT:$(%shoutcast.trigger $+ request*):%shoutcast.channel:{
if ( %shoutcast.currentdj == None ) { .notice $nick Error: No DJ is on air to send request to. }
else {
.notice $nick Your request " $+ $2- $+ " has been sent.
set %shoutcast.requestcommand %shoutcast.commandformat
set %shoutcast.requestcommand $replace(%shoutcast.requestcommand,<CommandTopic>,%shoutcast.colour1 Request From $nick)
set %shoutcast.requestcommand $replace(%shoutcast.requestcommand,<CommandValue>,%shoutcast.colour2 $2-)
msg %shoutcast.currentdj %shoutcast.requestcommand
}
}
;;;END
;;;Listeners Query
on *:TEXT:$(%shoutcast.trigger $+ listeners):%shoutcast.channel:{
sockclose shoutcast.listeners
sockopen shoutcast.listeners %shoutcast.server %shoutcast.port
}
on *:SOCKOPEN:shoutcast.listeners:{
if ($sockerr > 0) {
set %shoutcast.errorformat %shoutcast.commandformat
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandValue>,%shoutcast.colour2 No Connection To Server!)
msg %shoutcast.channel %shoutcast.errorformat
return
}
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname $crlf
}
on *:sockread:shoutcast.listeners:{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $remove(%scasttemp,<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html> )
if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) {
set %shoutcast.status $gettok(%scasttemp,2,44)
set %shoutcast.listeners $gettok(%scasttemp,1,44)
set %shoutcast.maxlisteners $gettok(%scasttemp,4,44)
set %shoutcast.peaklisteners $gettok(%scasttemp,3,44)
}
goto nextread
}
on *:sockclose:shoutcast.listeners:{
if ( %shoutcast.status == 0 ) {
set %shoutcast.clisteners $+(%shoutcast.listeners,/,%shoutcast.maxlisteners)
set %shoutcast.listenerscommand %shoutcast.commandformat
set %shoutcast.listenerscommand $replace(%shoutcast.listenerscommand,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.listenerscommand $replace(%shoutcast.listenerscommand,<CommandValue>,%shoutcast.colour2 Stream Is Down!)
msg %shoutcast.channel %shoutcast.listenerscommand
}
else {
set %shoutcast.clisteners $+(%shoutcast.listeners,/,%shoutcast.maxlisteners)
set %shoutcast.listenerscommand %shoutcast.commandformat
set %shoutcast.listenerscommand $replace(%shoutcast.listenerscommand,<CommandTopic>,%shoutcast.colour1 Listeners)
set %shoutcast.listenerscommand $replace(%shoutcast.listenerscommand,<CommandValue>,%shoutcast.colour2 %shoutcast.clisteners)
msg %shoutcast.channel %shoutcast.listenerscommand
}
}
on *:TEXT:$(%shoutcast.trigger $+ peak):%shoutcast.channel:{
sockclose shoutcast.peaklist
sockopen shoutcast.peaklist %shoutcast.server %shoutcast.port
}
on *:SOCKOPEN:shoutcast.peaklist:{
if ($sockerr > 0) {
set %shoutcast.errorformat %shoutcast.commandformat
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandValue>,%shoutcast.colour2 No Connection To Server!)
msg %shoutcast.channel %shoutcast.errorformat
return
}
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname $crlf
}
on *:sockread:shoutcast.peaklist:{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $remove(%scasttemp,<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html> )
if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) {
set %shoutcast.status $gettok(%scasttemp,2,44)
set %shoutcast.peak $gettok(%scasttemp,3,44)
}
goto nextread
}
on *:sockclose:shoutcast.peaklist:{
if ( %shoutcast.status == 0 ) {
set %shoutcast.peakcommand %shoutcast.commandformat
set %shoutcast.peakcommand $replace(%shoutcast.peakcommand,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.peakcommand $replace(%shoutcast.peakcommand,<CommandValue>,%shoutcast.colour2 Stream Is Down!)
msg %shoutcast.channel %shoutcast.peakcommand
}
else {
set %shoutcast.peakcommand %shoutcast.commandformat
set %shoutcast.peakcommand $replace(%shoutcast.peakcommand,<CommandTopic>,%shoutcast.colour1 Peak Listeners)
set %shoutcast.peakcommand $replace(%shoutcast.peakcommand,<CommandValue>,%shoutcast.colour2 %shoutcast.peak)
msg %shoutcast.channel %shoutcast.peakcommand
}
}
on *:TEXT:$(%shoutcast.trigger $+ bitrate):%shoutcast.channel:{
sockclose shoutcast.bitrate
sockopen shoutcast.bitrate %shoutcast.server %shoutcast.port
}
on *:SOCKOPEN:shoutcast.bitrate:{
if ($sockerr > 0) {
set %shoutcast.errorformat %shoutcast.commandformat
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandValue>,%shoutcast.colour2 No Connection To Server!)
notice $nick %shoutcast.errorformat
return
}
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname $crlf
}
on *:sockread:shoutcast.bitrate:{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $remove(%scasttemp,<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html> )
if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) {
set %shoutcast.bitrate $gettok(%scasttemp,6,44)
set %shoutcast.status $gettok(%scasttemp,2,44)
}
goto nextread
}
on *:sockclose:shoutcast.bitrate:{
if ( %shoutcast.status == 0 ) {
set %shoutcast.bitratecommand %shoutcast.commandformat
set %shoutcast.bitratecommand $replace(%shoutcast.bitratecommand,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.bitratecommand $replace(%shoutcast.bitratecommand,<CommandValue>,%shoutcast.colour2 Stream Is Down!)
msg %shoutcast.channel %shoutcast.bitratecommand
}
else {
set %shoutcast.bitratecommand %shoutcast.commandformat
set %shoutcast.bitratecommand $replace(%shoutcast.bitratecommand,<CommandTopic>,%shoutcast.colour1 Bitrate)
set %shoutcast.bitratecommand $replace(%shoutcast.bitratecommand,<CommandValue>,%shoutcast.colour2 %shoutcast.bitrate $+ kbps)
msg %shoutcast.channel %shoutcast.bitratecommand
}
}
on *:TEXT:$(%shoutcast.trigger $+ song):*:{
sockclose shoutcast.song
sockopen shoutcast.song %shoutcast.server %shoutcast.port
}
on *:SOCKOPEN:shoutcast.song:{
if ($sockerr > 0) {
set %shoutcast.errorformat %shoutcast.commandformat
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.errorformat $replace(%shoutcast.errorformat,<CommandValue>,%shoutcast.colour2 No Connection To Server!)
notice $nick %shoutcast.errorformat
return
}
sockwrite -n $sockname GET /7.html HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla
sockwrite -n $sockname $crlf
}
on *:sockread:shoutcast.song:{
if ($sockerr > 0) return
:nextread
sockread -f %scasttemp
if ($sockbr == 0) return
if (%scasttemp == $null) %scasttemp = empty
set %scasttemp $remove(%scasttemp,<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html> )
if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) {
set %shoutcast.song $gettok(%scasttemp,7-,44)
set %shoutcast.status $gettok(%scasttemp,2,44)
set %shoutcast.song $replace(%shoutcast.song,&,$chr(3,',$chr(39)))
}
goto nextread
}
on *:sockclose:shoutcast.song:{
if ( %shoutcast.status == 0 ) {
set %shoutcast.songcommand %shoutcast.commandformat
set %shoutcast.songcommand $replace(%shoutcast.songcommand,<CommandTopic>,%shoutcast.colour1 Error)
set %shoutcast.songcommand $replace(%shoutcast.songcommand,<CommandValue>,%shoutcast.colour2 Stream Is Down!)
msg %shoutcast.channel %shoutcast.songcommand
}
else {
set %shoutcast.songcommand %shoutcast.commandformat
set %shoutcast.songcommand $replace(%shoutcast.songcommand,<CommandTopic>,%shoutcast.colour1 Song)
set %shoutcast.songcommand $replace(%shoutcast.songcommand,<CommandValue>,%shoutcast.colour2 %shoutcast.song)
msg %shoutcast.channel %shoutcast.songcommand
}
}
on *:UNLOAD:{
echo -a You have now unloaded Shoutcast addon $shoutcast.version (By Zardoz)(moded by platinum)