<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/11909" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2006-05-26T12:59:32-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/11909</id>

		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2006-05-26T12:59:32-04:00</updated>

		<published>2006-05-26T12:59:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63431#p63431</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63431#p63431"/>
		<title type="html"><![CDATA[shoutcast script, some problem..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63431#p63431"><![CDATA[
If this is the script from the domsen.org website, then please report the problem to the author so he can fix the script for everyone.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri May 26, 2006 12:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dumbro]]></name></author>
		<updated>2006-05-26T12:47:51-04:00</updated>

		<published>2006-05-26T12:47:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63430#p63430</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63430#p63430"/>
		<title type="html"><![CDATA[shoutcast script, some problem..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63430#p63430"><![CDATA[
# shoutcast.tcl v1.03 by domsen &lt;<a href="mailto:domsen@domsen.org">domsen@domsen.org</a>&gt; (c)2oo5<br>#<br># comments? bugs? ideas? requests? money? beer? <br># plz mail me or visit my homepage @ <a href="http://www.domsen.org" class="postlink">www.domsen.org</a><br># visit #newsticker@ircnet<br>#<br>#<br># whats this script all about?<br># -----------------------------<br>#<br># this script is for all the online radio admins out there. it announces serveral<br># stuff like the status of your radio, the current song, new listener peaks,<br># the current listeners and much much more to the channels you want.<br># the users can get infos by public and msg command, too, like the stream url,<br># stream stats, the last played songs, the current song, the dj... and much much<br># more.<br># also the bot informs the users about the current dj, whenever he changes or<br># a certain command is triggered. the dj name doesnt need to be your nickname,<br># so you can also call yourself "goethe mc" even if your irc nickname is<br># [gay]michael. the good thing about this is: nobody knows your nickname, so <br># you wont get unwanted querys with wishes and greets. the dj can also change<br># his nickname and the wish- and greet-feature will still work fine.<br># only users with the flag +D can be djs, so make sure to give this flag to<br># your djs -&gt; .chattr djnick +D in the partyline.<br># <br># the script also changes the topic when your stream goes on or offline and<br># sends a public message, which is fully costumizeable. try it out yourself<br># and maybe it suits your needs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>#<br># it was tested with shoutcast 1.9.2 on debian linux.<br>#<br># NOTE 1: make sure youve got a good connection from your shellserver to your<br># streamserver - if its the same server then thats very very good. the bot<br># checks every minute if something happened, so if the connection is not fast<br># the bot will lag like hell or timeout. make sure to change your settings<br># for the eggdrop floodprotection.<br>#<br># NOTE 2: read the text here carefully, i get many many emails asking questions<br># which are acutally answered in this manual here. dont expect me to answer<br># these mails. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br>#<br>#<br># script history:<br># ----------------<br>#<br># v1.03 - different variables in the texts/topics possible<br>#       - possibility to unset the dj<br>#- splitted the scripts chans in 'radiochans' and 'adminchans'<br>#- 'advertiseonlyifonline'-function<br>#- possibility to get a msg if the bot goes down<br>#- more regexes<br>#- some bugfixes <br># v1.02 - added the .listener command, corrected some typos ;&gt;<br># v1.01 - fixed a string i forgot to replace<br># v1.0  - first public release<br>#<br>#<br>#<br># what does what config option mean/do?<br># --------------------------------------<br>#<br># radiochans - the channels the tcl is active in, "" for all, or "#chan1 #chan2"<br># adminchans - the channels the admin commands work in<br>#<br># streamip - the ip of your radio<br># streamport - the port of your radio<br># streampass - the admin pass of your radio<br>#<br># scstatstrigger - the trigger for the radio stats<br># scplayingtrigger - shows the song the radio is playing now<br># sclistenertrigger - shows the current listenercount<br># scdjtrigger - shows the current dj name<br># scstreamtrigger - shows your stream url -&gt; streamtext<br># scsetdjtrigger - sets the current dj name, this doesnt have to be your nickname.<br>#                  your nick will be saved too and all wishes and greets will be<br>#                  redirected to this nickname. only availavle for ppl with the +D<br>#                  flag.<br># scunsetdjtrigger - unsets the current dj, needs the +D flag<br># scwishtrigger - the command which the users can use if they wish a certain song<br># scgreettrigger - the command which users can use if the want to greet sb<br># sclastsongstrigger - the commands which users can use if they want to see the<br>#                      songhistory<br># schelptrigger - shows the available commands<br>#<br># alertadmin - the userhandle of the user who will get a msg if the server goes down<br># doalertadmin - 1 if you want to get a msg if the server goes offline, 0 if you<br># dont. this is done through the bots notes system because its<br># more comfortable and persistent this way.<br>#<br># announce - shall the bot announce any stuff? 1 for yes, 0 for no<br># urltopic - shall the bot change the topic everytime the radio goes on or off?<br># tellsongs - shall the bot post the songtitle to the channels everytime a<br>#             new song starts?<br># tellusers - shall the bot post the number of current users to the channel<br>#             everytime it changes or a new user maximum is reached?<br># tellbitrate - shall the bot announce bitrate changes?<br>#<br># offlinetext - the reason the bot says when the radio goes offline<br># offlinetopic - the topic which is set when the radio goes offline<br>#<br># onlinetext - the reason the bot says when the radio goes online<br># onlinetopic - the topic which is set when the radio goes online<br>#<br># streamtext - the text with your stream infos<br># advertise - shall the bot advertist the advertisetext?<br># advertiseonlyifonline - 1 if the bot only should advertise the radio if the stream<br>#  is up and running, 0 for all-the-time advertisement<br># advertisetext - the text the bot will post once every 10 minutes.<br>#<br>#<br>#<br># how do i put veriables in the different texts and topics?<br># ----------------------------------------------------------<br>#<br># the script knows the following variables which can be used in the offlinetext,<br># offlinetopic, onlinetext, onlinetopic, streamtext and advertisetext:<br># <br># /dj/ - the djnickname<br># /sgenre/ - the servers music genre<br># /stitle/ - the streamtitle<br># /surl/ - the servers url<br># /bitrate/ - the current streaming bitrate<br># /curlist/ - current listeners<br># /curhigh/ - current listener peak<br># /cursong/ - the current song<br># $streamip - the streams ip<br># $streamport - the streams port<br># <br>#<br>#<br># known bugs:<br># ------------<br>#<br># -numbers in the songhistory are killed, this is a xml sourcecode problem<br># -öäü are not shown correctly in the songtitles, because xml replaces each<br>#  of them with the same chars, so i cant fix it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> bitnapper told me it<br>#  would work anyway, but i cant confirm it. maybe my shoutcast version sucks.<br>#  the string replacements are included, so if it works youre a lucky guy.<br>#<br>#<br># loser of the day:<br># ------------------<br>#<br># loops aka edema for ripping the whole script, removing all of my copyright<br># infos and comments and putting his name under it. yeah, thats the open source<br># spirit...<br>#<br>#<br>#<br># config ##########################<br><br>set radiochans "#mainsports"<br>set adminchans "#mainsports"<br>set streamip "sh3.audio-stream.com"<br>set streamport "8075"<br>set streampass "***"<br>set scstatstrigger ".stats"<br>set scstreamtrigger ".stream"<br>set scplayingtrigger ".playing"<br>set sclistenertrigger ".listener"<br>set scdjtrigger ".dj"<br>set scsetdjtrigger ".setdj"<br>set scunsetdjtrigger ".unsetdj"<br>set scwishtrigger ".wish"<br>set scgreettrigger ".greet"<br>set sclastsongstrigger ".lastsongs"<br>set schelptrigger ".help"<br><br>set alertadmin ""<br>set doalertadmin "1"<br><br>set announce "1"<br><br>set urltopic "1"<br>set ctodjc "1"<br>set tellsongs "1"<br>set tellusers "1"<br>set tellbitrate "1"<br><br>set advertise "1"<br>set advertiseonlyifonline "1"<br><br>set offlinetext "0,1·7×0·0 15 going offline now 0,1·7×0·0 15"<br>set offlinetopic "·×· MainSports ·×· Broadcasting.Multigames ·×· <a href="http://www.MainSports-Broadcasting.net" class="postlink">www.MainSports-Broadcasting.net</a> Tournament starting on the 28th go to website for details ::  ·×·"<br><br>set onlinetext "0,1·7×0·0 15 /stitle/ now online @ /surl/ with /bitrate/kbits 0,1·7×0·0 15"<br>set onlinetopic "0,1·7×0·0 15 /dj/@/stitle/ @ /surl/ streaming at /bitrate/kbits 0,1·7×0·0 15"<br><br>set streamtext "0,1·7×0·0 15 tune in /dj/ @ http://$streamip:$streamport/listen.pls 0,1·7×0·0 15"<br><br>set advertisetext "0,1·7×0·0 15 stream @ http://$streamip:$streamport/listen.pls - powered by <a href="http://www.mainsports-broadcasting.net" class="postlink">www.mainsports-broadcasting.net</a> 0,1·7×0·0 15"<br><br># end of config #####################<br><br>bind pub - $scstatstrigger  pub_scstat<br>bind msg - $scstatstrigger  msg_scstat<br><br>bind pub - $scplayingtrigger  pub_playing<br>bind msg - $scplayingtrigger  msg_playing<br><br>bind pub - $scdjtrigger  pub_dj<br>bind msg - $scdjtrigger  msg_dj<br><br>bind pub D $scsetdjtrigger  pub_setdj<br>bind msg D $scsetdjtrigger  msg_setdj<br><br>bind pub D $scunsetdjtrigger  pub_unsetdj<br>bind msg D $scunsetdjtrigger  msg_unsetdj<br><br>bind pub - $scwishtrigger  pub_wish<br>bind msg - $scwishtrigger  msg_wish<br><br>bind pub - $scgreettrigger  pub_greet<br>bind msg - $scgreettrigger  msg_greet<br><br>bind pub - $scstreamtrigger pub_stream<br>bind msg - $scstreamtrigger msg_stream<br><br>bind pub - $sclastsongstrigger pub_lastsongs<br>bind msg - $sclastsongstrigger msg_lastsongs<br><br>bind pub - $sclistenertrigger pub_listener<br>bind msg - $sclistenertrigger msg_listener<br><br>bind pub - $schelptrigger pub_help<br>bind msg - $schelptrigger msg_help<br><br>bind time - "* * * * *" isonline<br>bind time - "?0 * * * *" advertise<br>bind nick D * djnickchange<br><br><br>set dj ""<br>set surl ""<br>set bitrate ""<br>set stitle ""<br><br>if {[file exists dj]} {<br>set temp [open "dj" r]<br>set dj [gets $temp]<br>close $temp<br>}<br><br>proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }<br><br><br>proc status { } {<br>global streamip streamport streampass<br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0 } else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]<br>}}<br>close $sock<br>} <br>if { $streamstatus == "1" } { return 1 } else { return 0 }<br>}<br><br><br><br><br>proc poststuff { mode text } {<br>global radiochans dj<br>set curlist "0"<br>set curhigh "0"<br>set surl ""<br>set cursong ""<br>set sgenre ""<br>set bitrate "0"<br>set stitle ""<br><br>set temp [open "isonline" r]<br>while {[eof $temp] != 1} {<br>set zeile [gets $temp]<br>if {[string first "curlist:" $zeile] != -1 } { set curlist $zeile }<br>if {[string first "curhigh:" $zeile] != -1 } { set curhigh $zeile }<br>if {[string first "cursong:" $zeile] != -1 } { set cursong [lrange $zeile 1 [llength $zeile]]] }<br>if {[string first "sgenre:" $zeile] != -1 } { set sgenre [lrange $zeile 1 [llength $zeile]]}<br>if {[string first "serverurl:" $zeile] != -1 } { set surl [lindex $zeile 1] }<br>if {[string first "bitrate:" $zeile] != -1 } { set bitrate [lindex $zeile 1] }<br>if {[string first "stitle:" $zeile] != -1 } { set stitle [lindex $zeile 1] }<br>}<br>close $temp<br><br>regsub -all "/stitle/" $text "$stitle" text<br>regsub -all "/curlist/" $text "$curlist" text<br>regsub -all "/curhigh/" $text "$curhigh" text<br>regsub -all "/cursong/" $text "$cursong" text<br>regsub -all "/sgenre/" $text "$sgenre" text<br>regsub -all "/surl/" $text "$surl" text<br>regsub -all "/bitrate/" $text "$bitrate" text<br>regsub -all "/dj/" $text "$dj" text<br><br>foreach chan [channels] {<br>if {$radiochans == "" } { putserv "$mode $chan :$text" }<br>if {$radiochans != "" } {<br>if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1)} {putserv "$mode $chan :$text"}<br>}}}<br><br><br>proc schelp { target } {<br>global scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sclastsongstrigger scwishtrigger scgreettrigger sclistenertrigger<br>putserv "notice $target :0,1·7×0·0 15the following commands are available: 0,1·7×0·0 15"<br>putserv "notice $target :0,1·7×0·0 15$scstatstrigger - $scstreamtrigger - $scplayingtrigger - $scdjtrigger - $sclastsongstrigger - $scwishtrigger - $scgreettrigger - $sclistenertrigger 0,1·7×0·0 15"<br>}<br><br>proc pub_help {nick uhost hand chan arg} {<br>global radiochans<br>if {$radiochans == "" } { schelp $nick }<br>if {$radiochans != "" } {<br>if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick}<br>}}<br><br>proc advertise { nick uhost hand chan arg } {<br>global advertisetext advertise advertiseonlyifonline<br>if {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "0"} { poststuff privmsg "$advertisetext" }<br>if {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "1" &amp;&amp; [status] == 1} { poststuff privmsg "$advertisetext" }<br>}<br><br><br>proc setdj {nickname djnickname } {<br>if {$djnickname == "" } { set djnickname $nickname }<br>global streamip streamport streampass dj <br>putlog "shoutcast: new dj: $djnickname ($nickname)"<br>set temp [open "dj" w+]<br>puts $temp $djnickname<br>close $temp<br>set temp [open "djnick" w+]<br>puts $temp $nickname<br>close $temp<br>if { [status] == "1" } { poststuff privmsg "0,1·7×0·0 15 $djnickname is now rocking the turntables, enjoy. 0,1·7×0·0 15"<br>if { $ctodjc == "1" } {<br>set temp [open "isonline" r]<br>while {[eof $temp] != 1} {<br>set zeile [gets $temp]<br>if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }<br>if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }<br>if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }<br>if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }<br>if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }<br>}<br>close $temp<br>}<br>} else {<br>putserv "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }<br>}<br><br><br>proc msg_setdj { nick uhost hand arg } { setdj $nick $arg }<br>proc pub_setdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} { setdj $nick $arg }}<br><br>proc unsetdj { nick } {<br>global dj<br>set dj ""<br>file delete dj<br>putserv "notice $nick :dj deleted"<br>}<br><br><br><br>proc msg_unsetdj { nick uhost hand arg } { unsetdj $nick }<br>proc pub_unsetdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string tolower $chan]] != -1) || ($adminchans == "")} { unsetdj $nick }}<br><br><br>proc listener { target } {<br>global streamip streamport streampass<br>putlog "shoutcast: $target requested listener count"<br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0 } else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set repl [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]<br>set curhigh [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]<br>set maxl [string range $bl [shrink + 14 "&lt;MAXLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/MAXLISTENERS&gt;" 0 $bl]]<br>set avgtime [string range $bl [shrink + 13 "&lt;AVERAGETIME&gt;" 0 $bl] [shrink - 1 "&lt;/AVERAGETIME&gt;" 0 $bl]]<br>}}<br>close $sock<br>putserv "notice $target :0,1·7×0·0 15there are currently $repl unique people listening, the listener maximum is $maxl, our user peak was at $curhigh listeners, the listening time average is $avgtime0,1·7×0·0 15"<br>}}<br><br>proc msg_listener { nick uhost hand arg } { listener $nick }<br>proc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $nick  }}<br><br>proc wish { nick arg } {<br>if {$arg == ""} { putserv "notice $nick :you forgot to add your wish"; return 0}<br>if { [status] == "1" } { <br>set temp [open "djnick" r]<br>set djnick [gets $temp]<br>close $temp<br>putserv "privmsg $djnick :(WISH) - $nick - $arg"<br>} else {<br>putserv "notice $nick :sorry radio is currently offline" }<br>}<br><br><br>proc msg_wish { nick uhost hand arg } { wish $nick $arg }<br>proc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { wish $nick $arg }}<br><br><br><br><br>proc sclastsongs { target } {<br>global streamip streamport streampass<br>putlog "shoutcast: $target requested songhistory"<br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0 } else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set songs [string range $bl [string first "&lt;TITLE&gt;" $bl] [expr [string last "&lt;/TITLE&gt;" $bl] + 7]]<br><br>regsub -all "&lt;" $songs "&lt;" songs<br>regsub -all "&gt;" $songs "&gt;" songs<br>regsub -all "&amp;" $songs "+" songs<br>regsub -all """ $songs "\"" songs<br>regsub -all "'" $songs "'" songs<br>regsub -all "ÿ" $songs "" songs<br>regsub -all "&lt;TITLE&gt;" $songs "(" songs<br>regsub -all "&lt;/TITLE&gt;" $songs ")" songs<br>regsub -all "&lt;SONG&gt;" $songs "" songs<br>regsub -all "&lt;/SONG&gt;" $songs " - " songs<br>regsub -all "&lt;PLAYEDAT&gt;" $songs "" songs<br>regsub -all "&lt;/PLAYEDAT&gt;" $songs "" songs<br>regsub -all {\d} $songs "" songs<br><br>regsub -all "´" $songs "´" songs<br>regsub -all "&amp;#x96;" $songs "-" songs<br>regsub -all "ö" $songs "ö" songs<br>regsub -all "ä" $songs "ä" songs<br>regsub -all "ü" $songs "ü" songs<br>regsub -all "Ö" $songs "Ö" songs<br>regsub -all "Ä" $songs "Ä" songs<br>regsub -all "Ü" $songs "Ü" songs<br>regsub -all "ß" $songs "ß" songs<br><br><br><br>}}<br>close $sock<br>putserv "notice $target :$songs"<br>}}<br><br><br>proc msg_lastsongs { nick uhost hand arg } { sclastsongs $nick }<br>proc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { sclastsongs $nick }}<br><br><br><br>proc scstream { target } {<br>global streamip streamport streamtext<br>putlog "shoutcast: streaminfo requested by $target"<br>putserv "notice $target :$streamtext"<br>}<br><br>proc msg_stream { nick uhost hand arg } { scstream $nick }<br>proc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstream $nick }}<br><br>proc scgreet { nick arg } {<br>if {$arg == ""} { putserv "notice $nick :0,1·7×0·0 15 you forgot to add your greetmessage 0,1·7×0·0 15"; return 0}<br>if { [status] == "1" } { <br>set temp [open "djnick" r]<br>set djnick [gets $temp]<br>close $temp<br>putserv "privmsg $djnick :(GREET) - $nick - $arg"<br>} else {<br>putserv "notice $nick :0,1·7×0·0 15 sorry radio is currently offline 0,1·7×0·0 15" }<br>}<br><br><br>proc msg_greet { nick uhost hand arg } { scgreet $nick $arg }<br>proc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scgreet $nick $arg }}<br><br><br><br>proc djnickchange { oldnick uhost hand chan newnick } {<br>set temp [open "djnick" r]<br>set djnick [gets $temp]<br>close $temp<br>if {$oldnick == $djnick} {<br>putlog "shoutcast: dj nickchange $oldnick -&gt; $newnick"<br>set temp [open "djnick" w+]<br>puts $temp $newnick<br>close $temp<br>}}<br><br><br><br><br><br>proc dj { target } {<br>global streamip streamport streampass dj<br>putlog "shoutcast: $target asked for dj info" <br>if {[status] == 1} {<br>if {[file exists dj]} {<br>set temp [open "dj" r]<br>set dj [gets $temp]<br>close $temp<br>putserv "notice $target :$dj is at the turntables!"<br>} else { putserv "notice $target :0,1·7×0·0 15 sorry, no dj name available 0,1·7×0·0 15 " }<br>} else { putserv "notice $target :0,1·7×0·0 15 sorry radio is currently offline 0,1·7×0·0 15" }<br>}<br><br><br><br>proc msg_dj { nick uhost hand arg } { dj $nick"}<br>proc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { dj $nick  }}<br><br><br><br>proc scstat {target} {<br>global streamip streamport streampass<br>putlog "shoutcast: $target asked for serverstats"<br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0 } else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]<br>set repl [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]<br>set curhigh [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]<br>set currentl [string range $bl [shrink + 18 "&lt;CURRENTLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/CURRENTLISTENERS&gt;" 0 $bl]]<br>set surl [string range $bl [shrink + 11 "&lt;SERVERURL&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERURL&gt;" 0 $bl]]<br>set maxl [string range $bl [shrink + 14 "&lt;MAXLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/MAXLISTENERS&gt;" 0 $bl]]<br>set bitrate [string range $bl [shrink + 9 "&lt;BITRATE&gt;" 0 $bl] [shrink - 1 "&lt;/BITRATE&gt;" 0 $bl]]<br>set stitle [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]<br>set sgenre [string range $bl [shrink + 13 "&lt;SERVERGENRE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERGENRE&gt;" 0 $bl]]<br>if {$sgenre != ""} {set sgenre " ($sgenre)"}<br>set avgtime [string range $bl [shrink + 13 "&lt;AVERAGETIME&gt;" 0 $bl] [shrink - 1 "&lt;/AVERAGETIME&gt;" 0 $bl]]<br>set irc [string range $bl [shrink + 5 "&lt;IRC&gt;" 0 $bl] [shrink - 1 "&lt;/IRC&gt;" 0 $bl]]<br>set icq [string range $bl [shrink + 5 "&lt;ICQ&gt;" 0 $bl] [shrink - 1 "&lt;/ICQ&gt;" 0 $bl]]<br>if {$icq == 0} { set icq "N/A" }<br>set aim [string range $bl [shrink + 5 "&lt;AIM&gt;" 0 $bl] [shrink - 1 "&lt;/AIM&gt;" 0 $bl]]<br>set webhits [string range $bl [shrink + 9 "&lt;WEBHITS&gt;" 0 $bl] [shrink - 1 "&lt;/WEBHITS&gt;" 0 $bl]]<br>set streamhits [string range $bl [shrink + 12 "&lt;STREAMHITS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMHITS&gt;" 0 $bl]]<br>set version [string range $bl [shrink + 9 "&lt;VERSION&gt;" 0 $bl] [shrink - 1 "&lt;/VERSION&gt;" 0 $bl]]<br>if {$streamstatus == 1} {<br>if {[file exists dj]} {<br>set temp [open "dj" r]<br>set dj [gets $temp]<br>close $temp<br>} else { set dj "none" }<br>putserv "notice $target :0,1·7×0·0 15$stitle$sgenre is online, running shoutcast $version and streaming at $bitrate kbps,  your dj is $dj. please visit $surl 0·7×0·0 15"<br>} else {<br>putserv "notice $target :0,1·7×0·0 15$stitle$sgenre is currenty offline, running shoutcast $version and streaming at $bitrate kbps, check out $surl 0,1·7×0·0 15" }<br>putserv "notice $target :0,1·7×0·0 15there are currently $repl unique people listening, the listener maximum is $maxl, our user peak was at $curhigh listeners. 0,1·7×0·0 15"<br>putserv "notice $target :0,1·7×0·0 15the average user is listening $avgtime seconds, our stream had $webhits webhits and $streamhits streamhits. 0,1·7×0·0 15"<br>putserv "notice $target :0,1·7×0·0 15you can contact the team by irc on $irc, via aim at $aim and with icq by the uin $icq. 0,1·7×0·0 15"<br>}}<br>close $sock<br>}}<br><br><br>proc msg_scstat { nick uhost hand arg } { scstat $nick}<br>proc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstat $nick  }}<br><br><br>proc playing {target} {<br>global streamip streamport streampass dj<br>putlog "shoutcast: $target asked for current song"<br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0 } else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]<br>set songtitle [string range $bl [shrink + 11 "&lt;SONGTITLE" 0 $bl] [shrink - 1 "&lt;/SONGTITLE&gt;" 0 $bl]]<br>set songurl [string range $bl [shrink + 9 "&lt;SONGURL&gt;" 0 $bl] [shrink - 1 "&lt;/SONGURL&gt;" 0 $bl]]<br>if {$songurl != ""} { set songurl " ($songurl)"}<br>regsub -all "&lt;" $songtitle "&lt;" songtitle<br>regsub -all "&gt;" $songtitle "&gt;" songtitle<br>regsub -all "&amp;" $songtitle "+" songtitle  <br>regsub -all """ $songtitle "\"" songtitle<br>regsub -all "'" $songtitle "'" songtitle<br>regsub -all "ÿ" $songtitle "" songtitle<br>regsub -all "´" $songtitle "´" songtitle<br>regsub -all "&amp;#x96;" $songtitle "-" songtitle<br>regsub -all "ö" $songtitle "ö" songtitle<br>regsub -all "ä" $songtitle "ä" songtitle<br>regsub -all "ü" $songtitle "ü" songtitle<br>regsub -all "Ö" $songtitle "Ö" songtitle<br>regsub -all "Ä" $songtitle "Ä" songtitle<br>regsub -all "Ü" $songtitle "Ü" songtitle<br>regsub -all "ß" $songtitle "ß" songtitle<br><br>if {$streamstatus == 1} {<br>putserv "notice $target :0,1·7×0·0 15now playing $songtitle$songurl 0·7×0·0 15"<br>} else {<br>putserv "notice $target :0,1·7×0·0 15server is currently offline, sorry 0·7×0·0 15"<br>}}}<br>close $sock<br>}}<br><br>proc msg_playing { nick uhost hand arg } { playing $nick}<br>proc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { playing $nick  }}<br><br><br><br>proc isonline { nick uhost hand chan arg } {<br>global radiochans announce tellusers tellsongs tellbitrate urltopic dj<br>global offlinetext offlinetopic onlinetext onlinetopic<br>global streamip streampass streamport dj<br>global doalertadmin alertadmin<br><br>if {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {<br>set isonlinefile "isonline"<br>set oldisonline "isonline: 0"<br>set oldcurlist "curlist: 0"<br>set oldcurhigh "curhigh: 0"<br>set oldsong "cursong: 0"<br>set oldbitrate "bitrate: 0"<br>if {[file exists $isonlinefile]} {<br>putlog "shoutcast: checking if stream is online"<br>set temp [open "isonline" r]<br>while {[eof $temp] != 1} {<br>set zeile [gets $temp]<br>if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }<br>if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }<br>if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }<br>if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }<br>if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }<br>}<br>close $temp<br>}<br><br><br>if {[catch {set sock [socket $streamip $streamport] } sockerror]} {<br>putlog "error: $sockerror"<br>return 0} else {<br>puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"<br>puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"<br>puts $sock "Host: $streamip"<br>puts $sock "Connection: close"<br>puts $sock ""<br>flush $sock<br>while {[eof $sock] != 1} {<br>set bl [gets $sock]<br>if { [string first "standalone" $bl] != -1 } {<br>set streamstatus "isonline: [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]"<br>set repl "curlist: [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]"<br>set curhigh "curhigh: [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]"<br>set currentl [string range $bl [shrink + 18 "&lt;CURRENTLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/CURRENTLISTENERS&gt;" 0 $bl]]<br>set surl "serverurl: [string range $bl [shrink + 11 "&lt;SERVERURL&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERURL&gt;" 0 $bl]]"<br>set cursong "cursong: [string range $bl [shrink + 11 "&lt;SONGTITLE" 0 $bl] [shrink - 1 "&lt;/SONGTITLE&gt;" 0 $bl]]"<br>set songurl [string range $bl [shrink + 9 "&lt;SONGURL&gt;" 0 $bl] [shrink - 1 "&lt;/SONGURL&gt;" 0 $bl]]<br>set bitrate "bitrate: [string range $bl [shrink + 9 "&lt;BITRATE&gt;" 0 $bl] [shrink - 1 "&lt;/BITRATE&gt;" 0 $bl]]"<br>set stitle "stitle: [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]"<br>set sgenre "sgenre: [string range $bl [shrink + 13 "&lt;SERVERGENRE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERGENRE&gt;" 0 $bl]]"<br>}}<br>close $sock<br>}<br><br>set temp [open "isonline" w+]<br>puts $temp "$streamstatus\n$repl\n$curhigh\n$cursong\n$bitrate\n$stitle\n$sgenre\n$surl"<br>close $temp<br>if {$announce == 1 } {<br>if {$streamstatus == "isonline: 0" &amp;&amp; $oldisonline == "isonline: 1"} {<br>poststuff privmsg $offlinetext<br>if {$doalertadmin == "1"} { sendnote domsen $alertadmin "0,1·7×0·0 15 radio is now offline 0,1·7×0·0 15" }<br>if {$urltopic == 1} { poststuff topic $offlinetopic }<br>}<br>if {$streamstatus == "isonline: 1" &amp;&amp; $oldisonline == "isonline: 0" } {<br>if {$sgenre != ""} {<br>set sgenre " ([lrange $sgenre 1 [llength $sgenre]] )"<br>}<br>poststuff privmsg "$onlinetext"<br>if {$urltopic == 1} { poststuff topic "$onlinetopic" }<br>}}<br>if {($tellusers == 1) &amp;&amp; ($streamstatus == "isonline: 1") &amp;&amp; ($oldcurhigh != "curhigh: 0") } {<br>if {$oldcurhigh != $curhigh} {<br>poststuff privmsg "new listener peak: [lindex $curhigh 1]"<br>}<br>if {$oldcurlist != $repl} {<br>poststuff privmsg "0,1·7×0·0 15 there are currently [lindex $repl 1] ($currentl) people listening 0·7×0·0 15"<br>}}<br>if {($tellsongs == 1) &amp;&amp; ($oldsong != $cursong) &amp;&amp; ($streamstatus == "isonline: 1") } {<br>if {$songurl != ""} { set songurl " ($songurl)"}<br>regsub -all "&lt;" $cursong "&lt;" cursong<br>regsub -all "&gt;" $cursong "&gt;" cursong<br>regsub -all "&amp;" $cursong "+" cursong  <br>regsub -all """ $cursong "\"" cursong<br>regsub -all "'" $cursong "'" cursong<br>regsub -all "ÿ" $cursong "" cursong<br>regsub -all "´" $cursong "´" cursong<br>regsub -all "&amp;#x96;" $cursong "-" cursong<br>regsub -all "ö" $cursong "ö" cursong<br>regsub -all "ä" $cursong "ä" cursong<br>regsub -all "ü" $cursong "ü" cursong<br>regsub -all "Ö" $cursong "Ö" cursong<br>regsub -all "Ä" $cursong "Ä" cursong<br>regsub -all "Ü" $cursong "Ü" cursong<br>regsub -all "ß" $cursong "ß" cursong<br>putlog $cursong<br>poststuff privmsg "0,1·7×0·0 7n15ow playing: [lrange $cursong 1 [llength $cursong]] 0·7×0·0"<br>}<br><br>if {($tellbitrate == 1) &amp;&amp; ($oldbitrate != $bitrate) &amp;&amp; ($streamstatus == "isonline: 1") &amp;&amp; ($oldbitrate != "bitrate: 0")} {<br>poststuff privmsg "bitrate switched to [lindex $bitrate 1]kbps"<br>}}}<br><br>putlog "0,1·7×0·0 15 *** shoutcast.tcl v1.03 by domsen &lt;<a href="mailto:domsen@domsen.org">domsen@domsen.org</a>&gt; succesfully loaded. turn it up baby. 0,1·7×0·0 15"<br><br>The .unsetdj have some problem... anyone can help me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7780">dumbro</a> — Fri May 26, 2006 12:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
