<?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/18520" />

	<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>2011-06-27T01:43:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[yelow79]]></name></author>
		<updated>2011-06-27T01:43:12-04:00</updated>

		<published>2011-06-27T01:43:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97101#p97101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97101#p97101"/>
		<title type="html"><![CDATA[shoutcast.tcl v1.03 by domsen]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97101#p97101"><![CDATA[
Thank you for sorting that out for me speechles, <br><br>and yes I remember now that || equals or, I knew that &amp;&amp; equals and, != means doesn't equal, and == equals<br><div class="codebox"><p>Code: </p><pre><code>proc sc_ad { nick uhost hand chan arg } {global advertisetext advertiseputlog "shoutcast: ad requested by $nick"if { [isvoice $nick $chan] } { putserv "privmsg $chan $advertisetext" }} </code></pre></div>actually worked without the colon as you say. Tho it will probably be better added in.<br><br>This is the first TCL script I have ever attempted at all. I have done some mIRC scripting and C++ but never TCL.<br><br>Thanks for help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11701">yelow79</a> — Mon Jun 27, 2011 1:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2011-06-27T01:19:24-04:00</updated>

		<published>2011-06-27T01:19:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97100#p97100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97100#p97100"/>
		<title type="html"><![CDATA[shoutcast.tcl v1.03 by domsen]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97100#p97100"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if { [isop $nick $chan] } { putserv "privmsg $chan $advertisetext" }if { $nick == "dj*" } { putserv "privmsg $chan $advertisetext" } </code></pre></div>Change that to look like this:<div class="codebox"><p>Code: </p><pre><code>if {[isop $nick $chan] || [string match -nocase "dj*" $nick]} { putserv "privmsg $chan :$advertisetext" }</code></pre></div>Within an if construct, || equals OR, &amp;&amp; equals AND.<br><br>The reason it didn't output anything, was you've forgotten the : (colon) to seperate the target ($chan) from the message ($advertisetext) when the privmsg was interpreted by the IRCD.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jun 27, 2011 1:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[yelow79]]></name></author>
		<updated>2011-06-27T01:01:08-04:00</updated>

		<published>2011-06-27T01:01:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97099#p97099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97099#p97099"/>
		<title type="html"><![CDATA[shoutcast.tcl v1.03 by domsen]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97099#p97099"><![CDATA[
Solved thank you<br><br>I had tried changing this line but changing it alone didn't work<br><div class="codebox"><p>Code: </p><pre><code>bind time - "?0 * * * *" advertise </code></pre></div>I had to do like you said <br><div class="codebox"><p>Code: </p><pre><code> bind time - "0 * * * *" advertisebind time - "30 * * * *" advertise </code></pre></div>and here is what I ended up with for the sc_ad command<br><div class="codebox"><p>Code: </p><pre><code>proc sc_ad { nick uhost hand chan arg } {global advertisetext advertiseputlog "shoutcast: ad requested by $nick"if { [isvoice $nick $chan] } { putserv "privmsg $chan $advertisetext" }}</code></pre></div>I know that I had asked about adding isop, which is what I had intended but then needed to change it so that voiced dj's could trigger the add. <br>I was going to set it so that it would trigger for ops or anyone with DJ in their nick however I couldn't remember the "or" command and this didn't work<br><div class="codebox"><p>Code: </p><pre><code>proc sc_ad { nick uhost hand chan arg } {global advertisetext advertiseputlog "shoutcast: ad requested by $nick"if { [isop $nick $chan] } { putserv "privmsg $chan $advertisetext" }if { $nick == "dj*" } { putserv "privmsg $chan $advertisetext" }}</code></pre></div>this is what I was getting from the bot <br><blockquote class="uncited"><div> [23:34:34] shoutcast: ad requested by dj-yelow </div></blockquote>But nothing in the channel.<br><br>Hopes this helps out those who may have similar issues and Thanks again for the help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11701">yelow79</a> — Mon Jun 27, 2011 1:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[x-y-no]]></name></author>
		<updated>2011-06-26T20:58:16-04:00</updated>

		<published>2011-06-26T20:58:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97097#p97097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97097#p97097"/>
		<title type="html"><![CDATA[shoutcast.tcl v1.03 by domsen]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97097#p97097"><![CDATA[
This line:<br><div class="codebox"><p>Code: </p><pre><code>bind time - "?0 * * * *" advertise</code></pre></div>is what's making the ad go every 10 minutes.  I don't think you can do complicated stuff in the mask, so I'd just make this two lines:<br><div class="codebox"><p>Code: </p><pre><code>bind time - "0 * * * *" advertisebind time - "30 * * * *" advertise</code></pre></div>Put the isop check in the top of your procedure:<br><div class="codebox"><p>Code: </p><pre><code>proc sc_ad { nick uhost hand chan arg } {     if {![isop $nick $chan]} {      putserv "PRIVMSG $chan : You do not have permission."      return   }...</code></pre></div>or something like that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10800">x-y-no</a> — Sun Jun 26, 2011 8:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[yelow79]]></name></author>
		<updated>2011-06-27T01:11:40-04:00</updated>

		<published>2011-06-26T01:42:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97094#p97094</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97094#p97094"/>
		<title type="html"><![CDATA[one more question about using isop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97094#p97094"><![CDATA[
Where would I add the isop $nick to make this only work for ops<br><br>the section of the script for the trigger is all i will post here. To avoid confusion I won't post where I have tried to add isop. Thank you again for any help.<div class="codebox"><p>Code: </p><pre><code>set scadtrigger "!radio"bind pub - $scadtrigger sc_adbind msg - $scadtrigger sc_adproc sc_ad { nick uhost hand chan arg } {global radiochans advertisetext advertise advertiseonlyifonlineputlog "shoutcast: ad requested by $nick"if { $advertise == "1" &amp;&amp; $advertiseonlyifonline == "1" &amp;&amp; [status] != 1} { poststuff privmsg "Radio is currently offline" }if { $advertise == "1" &amp;&amp; $advertiseonlyifonline == "1" &amp;&amp; [status] == 1} { poststuff privmsg "$advertisetext" }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11701">yelow79</a> — Sun Jun 26, 2011 1:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[yelow79]]></name></author>
		<updated>2011-06-26T01:45:44-04:00</updated>

		<published>2011-06-26T00:13:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97093#p97093</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97093#p97093"/>
		<title type="html"><![CDATA[shoutcast.tcl v1.03 by domsen]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97093#p97093"><![CDATA[
This script is a Great script on it's own. However for my needs I have needed to change a few things. I am trying to learn a little bit of tcl on my own for this project. <br><br>Here is what I am looking for at the moment. The script runs the advertisement every 10 minutes. I can't for the life of me figure out how to change that to like say every 30 minutes. Thank you in advance here is what I am working with<div class="codebox"><p>Code: </p><pre><code># config ##########################set radiochans "#sawit-chat #radio-staff"set adminchans "#radio-staff"set streamip "127.0.0.1"set streamurl "Radio.MisFits-irc.net"set streamport "8004"set streampass "password"set scstatstrigger ".stats"set scstreamtrigger ".stream"set scplayingtrigger ".playing"set sclistenertrigger ".listener"set scdjtrigger ".dj"set scsetdjtrigger ".setdj"set scunsetdjtrigger ".unsetdj"set scwishtrigger ".request"set scgreettrigger ".greet"set sclastsongstrigger ".lastsongs"set schelptrigger ".help"set scadtrigger ".radio"set alertadmin ""set doalertadmin "0"set announce "1"set urltopic "0"set ctodjc "1"set tellsongs "1"set tellusers "1"set tellbitrate "1"set advertise "1"set advertiseonlyifonline "1"set offlinetext "going offline now"set offlinetopic "MisFits-Radio is OFFLINE"set onlinetext "\0039 .:|:. MisFits-Radio .:|:. Playing: /cursong/@/bitrate/kbps .:|:. \00311 /listeners/ \0039 .:|:. /peak/$set onlinetopic "\0038...\0037:::\0034MisFits-Radio is ONLINE\0037:::\0038... \00310If you are interested in being a DJ or i$set streamtext "listen by clicking http://$streamurl:$streamport/listen.pls"set advertisetext "\0039 .:|:. MisFits-Radio .:|:. Playing: /cursong/@/bitrate/kbps .:|:. \00311 /listeners/ \0039 .:|:. /pe$# end of config #####################bind pub - $scstatstrigger  pub_scstat#bind msg - $scstatstrigger  msg_scstatbind pub - $scplayingtrigger  pub_playing#bind msg - $scplayingtrigger  msg_playingbind pub - $scdjtrigger  pub_dj#bind msg - $scdjtrigger  msg_djbind pub D $scsetdjtrigger  pub_setdj#bind msg D $scsetdjtrigger  msg_setdjbind pub D $scunsetdjtrigger  pub_unsetdj#bind msg D $scunsetdjtrigger  msg_unsetdjbind pub - $scwishtrigger  pub_wish#bind msg - $scwishtrigger  msg_wishbind pub - $scgreettrigger  pub_greet#bind msg - $scgreettrigger  msg_greetbind pub - $scstreamtrigger pub_stream#bind msg - $scstreamtrigger msg_streambind pub - $sclastsongstrigger pub_lastsongs#bind msg - $sclastsongstrigger msg_lastsongsbind pub - $sclistenertrigger pub_listener#bind msg - $sclistenertrigger msg_listenerbind pub - $schelptrigger pub_help#bind msg - $schelptrigger msg_helpbind pub - $scadtrigger pub_ad#bind msg - $scadtrigger msg_adbind time - "* * * * *" isonlinebind time - "?0 * * * *" advertisebind nick D * djnickchangeset dj ""set surl ""set bitrate ""set stitle ""if {[file exists dj]} {set temp [open "dj" r]set dj [gets $temp]close $temp}proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }proc status { } {global streamip streamport streampassif {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]}}close $sock}if { $streamstatus == "1" } { return 1 } else { return 0 }}proc poststuff { mode text } {global radiochans djset listeners "0"set peak "0"set surl ""set cursong ""set sgenre ""set bitrate "0"set stitle ""set temp [open "isonline" r]while {[eof $temp] != 1} {set zeile [gets $temp]if {[string first "listeners:" $zeile] != -1 } { set listeners $zeile }if {[string first "peak:" $zeile] != -1 } { set peak $zeile }if {[string first "cursong:" $zeile] != -1 } { set cursong [lrange $zeile 1 [llength $zeile]]}if {[string first "sgenre:" $zeile] != -1 } { set sgenre [lrange $zeile 1 [llength $zeile]]}if {[string first "serverurl:" $zeile] != -1 } { set surl [lindex $zeile 1] }if {[string first "bitrate:" $zeile] != -1 } { set bitrate [lindex $zeile 1] }if {[string first "stitle:" $zeile] != -1 } { set stitle [lindex $zeile 1] }}close $tempregsub -all "/stitle/" $text "$stitle" textregsub -all "/listeners/" $text "$listeners" textregsub -all "/peak/" $text "$peak" textregsub -all "/cursong/" $text "$cursong" textregsub -all "/sgenre/" $text "$sgenre" textregsub -all "/surl/" $text "$surl" textregsub -all "/bitrate/" $text "$bitrate" textregsub -all "/dj/" $text "$dj" textforeach chan [channels] {if {$radiochans == "" } { putserv "$mode $chan :$text" }if {$radiochans != "" } {if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1)} {putserv "$mode $chan :$text"}}}}proc schelp { target } {global scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sclastsongstrigger scwishtrigger scgreettrigger sclistene$putserv "notice $target :the following commands are available:"putserv "notice $target :$scstreamtrigger - $scplayingtrigger - $scdjtrigger - $sclastsongstrigger - $scwishtrigger - $sclis$}proc pub_help {nick uhost hand chan arg} {global radiochansif {$radiochans == "" } { schelp $nick }if {$radiochans != "" } {if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick}}}proc advertise { nick uhost hand chan arg } {global advertisetext advertise advertiseonlyifonlineif {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "0"} { poststuff privmsg "$advertisetext" }if {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "1" &amp;&amp; [status] == 1} { poststuff privmsg "$advertisetext" }}proc setdj {nickname djnickname } {if {$djnickname == "" } { set djnickname $nickname }global streamip streamport streampass djputlog "shoutcast: new dj: $djnickname ($nickname)"set temp [open "dj" w+]puts $temp $djnicknameclose $tempset temp [open "djnick" w+]puts $temp $nicknameclose $tempif { [status] == "1" } { poststuff privmsg "$djnickname is now rocking the turntables, enjoy."if { $ctodjc == "1" } {set temp [open "isonline" r]while {[eof $temp] != 1} {set zeile [gets $temp]if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }if {[string first "listeners:" $zeile] != -1 } { set oldlisteners $zeile }if {[string first "peak:" $zeile] != -1 } { set oldpeak $zeile }if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }}close $temp}} else {putserv "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }}proc msg_setdj { nick uhost hand arg } { setdj $nick $arg }proc pub_setdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string t$proc unsetdj { nick } {global djset dj ""file delete djputserv "notice $nick :dj deleted"}proc msg_unsetdj { nick uhost hand arg } { unsetdj $nick }proc pub_unsetdj { nick uhost hand chan arg } { global adminchans; if {([lsearch -exact [string tolower $adminchans] [string$proc listener { target } {global streamip streamport streampassputlog "shoutcast: $target requested listener count"if {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set repl [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]set peak [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]set maxl [string range $bl [shrink + 14 "&lt;MAXLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/MAXLISTENERS&gt;" 0 $bl]]set avgtime [string range $bl [shrink + 13 "&lt;AVERAGETIME&gt;" 0 $bl] [shrink - 1 "&lt;/AVERAGETIME&gt;" 0 $bl]]}}close $sockputserv "notice $target :there are currently $repl unique people listening, the listener maximum is $maxl, our user peak was$}}proc msg_listener { nick uhost hand arg } { listener $nick }proc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [strin$proc wish { nick arg } {if {$arg == ""} { putserv "notice $nick :you forgot to add your request (song title - artist)"; return 0}if { [status] == "1" } {set temp [open "djnick" r]set djnick [gets $temp]close $tempputserv "privmsg $djnick :(request) - $nick - $arg"} else {putserv "notice $nick :sorry radio is currently offline" }}proc msg_wish { nick uhost hand arg } { wish $nick $arg }proc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string to$proc sclastsongs { target } {global streamip streamport streampassputlog "shoutcast: $target requested songhistory"if {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set songs [string range $bl [string first "&lt;TITLE&gt;" $bl] [expr [string last "&lt;/TITLE&gt;" $bl] + 7]]regsub -all "&lt;" $songs "&lt;" songsregsub -all "&gt;" $songs "&gt;" songsregsub -all "&amp;" $songs "+" songsregsub -all """ $songs "\"" songsregsub -all "'" $songs "'" songsregsub -all "ÿ" $songs "" songsregsub -all "&lt;TITLE&gt;" $songs "(" songsregsub -all "&lt;/TITLE&gt;" $songs ")" songsregsub -all "&lt;SONG&gt;" $songs "" songsregsub -all "&lt;/SONG&gt;" $songs " - " songsregsub -all "&lt;PLAYEDAT&gt;" $songs "" songsregsub -all "&lt;/PLAYEDAT&gt;" $songs "" songsregsub -all {\d} $songs "" songsregsub -all "´" $songs "´" songsregsub -all "&amp;#x96;" $songs "-" songsregsub -all "ö" $songs "ö" songsregsub -all "ä" $songs "ä" songsregsub -all "ü" $songs "ü" songsregsub -all "Ö" $songs "Ö" songsregsub -all "Ä" $songs "Ä" songsregsub -all "Ü" $songs "Ü" songsregsub -all "ß" $songs "ß" songs}}close $sockputserv "notice $target :$songs"}}proc msg_lastsongs { nick uhost hand arg } { sclastsongs $nick }proc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [stri$proc scad { target } {global advertisetext advertise advertiseonlyifonlineputlog "shoutcast: ad requested by $target"if {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "0" &amp;&amp; [status] != 1} { putserv "notice $target Radio is currently offlin$if {$advertise == "1" &amp;&amp; $advertiseonlyifonline == "1" &amp;&amp; [status] == 1} { putserv "notice $target $advertisetext" }}proc scstream { target } {global streamip streamport streamtextputlog "shoutcast: streaminfo requested by $target"putserv "notice $target :$streamtext"}proc msg_stream { nick uhost hand arg } { scstream $nick }proc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string $proc scgreet { nick arg } {if {$arg == ""} { putserv "notice $nick :you forgot to add your greetmessage"; return 0}if { [status] == "1" } {set temp [open "djnick" r]set djnick [gets $temp]close $tempputserv "privmsg $djnick :(GREET) - $nick - $arg"} else {putserv "notice $nick :sorry radio is currently offline" }}proc msg_greet { nick uhost hand arg } { scgreet $nick $arg }proc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string t$proc djnickchange { oldnick uhost hand chan newnick } {set temp [open "djnick" r]set djnick [gets $temp]close $tempif {$oldnick == $djnick} {putlog "shoutcast: dj nickchange $oldnick -&gt; $newnick"set temp [open "djnick" w+]puts $temp $newnickclose $temp}}proc dj { target } {global streamip streamport streampass djputlog "shoutcast: $target asked for dj info"if {[status] == 1} {if {[file exists dj]} {set temp [open "dj" r]set dj [gets $temp]close $tempputserv "notice $target :$dj is at the turntables!"} else { putserv "notice $target :sorry, no dj name available" }} else { putserv "notice $target :sorry radio is currently offline" }}proc msg_dj { nick uhost hand arg } { dj $nick"}proc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolo$proc scstat {target} {global streamip streamport streampassputlog "shoutcast: $target asked for serverstats"if {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]set repl [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]set peak [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]set currentl [string range $bl [shrink + 18 "&lt;CURRENTLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/CURRENTLISTENERS&gt;" 0 $bl]]set surl [string range $bl [shrink + 11 "&lt;SERVERURL&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERURL&gt;" 0 $bl]]set maxl [string range $bl [shrink + 14 "&lt;MAXLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/MAXLISTENERS&gt;" 0 $bl]]set bitrate [string range $bl [shrink + 9 "&lt;BITRATE&gt;" 0 $bl] [shrink - 1 "&lt;/BITRATE&gt;" 0 $bl]]set stitle [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]set sgenre [string range $bl [shrink + 13 "&lt;SERVERGENRE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERGENRE&gt;" 0 $bl]]if {$sgenre != ""} {set sgenre " ($sgenre)"}set avgtime [string range $bl [shrink + 13 "&lt;AVERAGETIME&gt;" 0 $bl] [shrink - 1 "&lt;/AVERAGETIME&gt;" 0 $bl]]set irc [string range $bl [shrink + 5 "&lt;IRC&gt;" 0 $bl] [shrink - 1 "&lt;/IRC&gt;" 0 $bl]]set icq [string range $bl [shrink + 5 "&lt;ICQ&gt;" 0 $bl] [shrink - 1 "&lt;/ICQ&gt;" 0 $bl]]if {$icq == 0} { set icq "N/A" }set aim [string range $bl [shrink + 5 "&lt;AIM&gt;" 0 $bl] [shrink - 1 "&lt;/AIM&gt;" 0 $bl]]set webhits [string range $bl [shrink + 9 "&lt;WEBHITS&gt;" 0 $bl] [shrink - 1 "&lt;/WEBHITS&gt;" 0 $bl]]set streamhits [string range $bl [shrink + 12 "&lt;STREAMHITS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMHITS&gt;" 0 $bl]]set version [string range $bl [shrink + 9 "&lt;VERSION&gt;" 0 $bl] [shrink - 1 "&lt;/VERSION&gt;" 0 $bl]]if {$streamstatus == 1} {if {[file exists dj]} {set temp [open "dj" r]set dj [gets $temp]close $temp} else { set dj "none" }putserv "notice $target :$stitle$sgenre is online, running shoutcast $version and streaming at $bitrate kbps,  your dj is $d$} else {putserv "notice $target :$stitle$sgenre is currenty offline, running shoutcast $version and streaming at $bitrate kbps, chec$putserv "notice $target :there are currently $repl unique people listening, the listener maximum is $maxl, our user peak was$putserv "notice $target :the average user is listening $avgtime seconds, our stream had $webhits webhits and $streamhits str$putserv "notice $target :you can contact the team by irc on $irc"}}close $sock}}proc msg_scstat { nick uhost hand arg } { scstat $nick}proc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string $proc playing {target} {global streamip streamport streampass djputlog "shoutcast: $target asked for current song"if {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set streamstatus [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]set songtitle [string range $bl [shrink + 11 "&lt;SONGTITLE" 0 $bl] [shrink - 1 "&lt;/SONGTITLE&gt;" 0 $bl]]set songurl [string range $bl [shrink + 9 "&lt;SONGURL&gt;" 0 $bl] [shrink - 1 "&lt;/SONGURL&gt;" 0 $bl]]if {$songurl != ""} { set songurl " ($songurl)"}regsub -all "&lt;" $songtitle "&lt;" songtitleregsub -all "&gt;" $songtitle "&gt;" songtitleregsub -all "&amp;" $songtitle "+" songtitleregsub -all """ $songtitle "\"" songtitleregsub -all "'" $songtitle "'" songtitleregsub -all "ÿ" $songtitle "" songtitleregsub -all "´" $songtitle "´" songtitleregsub -all "&amp;#x96;" $songtitle "-" songtitleregsub -all "ö" $songtitle "ö" songtitleregsub -all "ä" $songtitle "ä" songtitleregsub -all "ü" $songtitle "ü" songtitleregsub -all "Ö" $songtitle "Ö" songtitleregsub -all "Ä" $songtitle "Ä" songtitleregsub -all "Ü" $songtitle "Ü" songtitleregsub -all "ß" $songtitle "ß" songtitleif {$streamstatus == 1} {putserv "notice $target :now playing $songtitle"} else {putserv "notice $target :server is currently offline, sorry"}}}close $sock}}proc msg_playing { nick uhost hand arg } { playing $nick}proc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string$proc isonline { nick uhost hand chan arg } {global radiochans announce tellusers tellsongs tellbitrate urltopic djglobal offlinetext offlinetopic onlinetext onlinetopicglobal streamip streampass streamport djglobal doalertadmin alertadminif {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {set isonlinefile "isonline"set oldisonline "isonline: 0"set oldlisteners "listeners: 0"set oldpeak "peak: 0"set oldsong "cursong: 0"set oldbitrate "bitrate: 0"if {[file exists $isonlinefile]} {putlog "shoutcast: checking if stream is online"set temp [open "isonline" r]while {[eof $temp] != 1} {set zeile [gets $temp]if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }if {[string first "listeners:" $zeile] != -1 } { set oldlisteners $zeile }if {[string first "peak:" $zeile] != -1 } { set oldpeak $zeile }if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }}close $temp}if {[catch {set sock [socket $streamip $streamport] } sockerror]} {putlog "error: $sockerror"return 0} else {puts $sock "GET /admin.cgi?pass=$streampass&amp;mode=viewxml&amp;page=0 HTTP/1.0"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: $streamip"puts $sock "Connection: close"puts $sock ""flush $sockwhile {[eof $sock] != 1} {set bl [gets $sock]if { [string first "standalone" $bl] != -1 } {set streamstatus "isonline: [string range $bl [shrink + 14 "&lt;STREAMSTATUS&gt;" 0 $bl] [shrink - 1 "&lt;/STREAMSTATUS&gt;" 0 $bl]]"set repl "listeners: [string range $bl [shrink + 19 "&lt;REPORTEDLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/REPORTEDLISTENERS&gt;" 0 $bl]]"set peak "peak: [string range $bl [shrink + 15 "&lt;PEAKLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/PEAKLISTENERS&gt;" 0 $bl]]"set currentl [string range $bl [shrink + 18 "&lt;CURRENTLISTENERS&gt;" 0 $bl] [shrink - 1 "&lt;/CURRENTLISTENERS&gt;" 0 $bl]]set surl "serverurl: [string range $bl [shrink + 11 "&lt;SERVERURL&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERURL&gt;" 0 $bl]]"set cursong "cursong: [string range $bl [shrink + 11 "&lt;SONGTITLE" 0 $bl] [shrink - 1 "&lt;/SONGTITLE&gt;" 0 $bl]]"set songurl [string range $bl [shrink + 9 "&lt;SONGURL&gt;" 0 $bl] [shrink - 1 "&lt;/SONGURL&gt;" 0 $bl]]set bitrate "bitrate: [string range $bl [shrink + 9 "&lt;BITRATE&gt;" 0 $bl] [shrink - 1 "&lt;/BITRATE&gt;" 0 $bl]]"set stitle "stitle: [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]"set sgenre "sgenre: [string range $bl [shrink + 13 "&lt;SERVERGENRE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERGENRE&gt;" 0 $bl]]"}}close $sock}set temp [open "isonline" w+]puts $temp "$streamstatus\n$repl\n$peak\n$cursong\n$bitrate\n$stitle\n$sgenre\n$surl"close $tempif {$announce == 1 } {if {$streamstatus == "isonline: 0" &amp;&amp; $oldisonline == "isonline: 1"} {        poststuff privmsg $offlinetext        if {$doalertadmin == "1"} { sendnote domsen $alertadmin "radio is now offline" }        if {$urltopic == 1} { poststuff topic $offlinetopic }}if {$streamstatus == "isonline: 1" &amp;&amp; $oldisonline == "isonline: 0" } {if {$sgenre != ""} {set sgenre " ([lrange $sgenre 1 [llength $sgenre]] )"}poststuff privmsg "$onlinetext"if {$urltopic == 1} { poststuff topic "$onlinetopic" }}}if {($tellusers == 1) &amp;&amp; ($streamstatus == "isonline: 1") &amp;&amp; ($oldpeak != "peak: 0") } {if {$oldpeak != $peak} {poststuff privmsg "new listener peak: [lindex $peak 1]"}if {$oldlisteners != $repl} {poststuff privmsg "there are currently [lindex $repl 1] ($currentl) people listening"}}if {($tellsongs == 1) &amp;&amp; ($oldsong != $cursong) &amp;&amp; ($streamstatus == "isonline: 1") } {if {$songurl != ""} { set songurl " ($songurl)"}regsub -all "&lt;" $cursong "&lt;" cursongregsub -all "&gt;" $cursong "&gt;" cursongregsub -all "&amp;" $cursong "+" cursongregsub -all """ $cursong "\"" cursongregsub -all "'" $cursong "'" cursongregsub -all "ÿ" $cursong "" cursongregsub -all "´" $cursong "´" cursongregsub -all "&amp;#x96;" $cursong "-" cursongregsub -all "ö" $cursong "ö" cursongregsub -all "ä" $cursong "ä" cursongregsub -all "ü" $cursong "ü" cursongregsub -all "Ö" $cursong "Ö" cursongregsub -all "Ä" $cursong "Ä" cursongregsub -all "Ü" $cursong "Ü" cursongregsub -all "ß" $cursong "ß" cursongputlog $cursong#poststuff privmsg "now playing: $cursong"}if {($tellbitrate == 1) &amp;&amp; ($oldbitrate != $bitrate) &amp;&amp; ($streamstatus == "isonline: 1") &amp;&amp; ($oldbitrate != "bitrate: 0")} {poststuff privmsg "bitrate switched to [lindex $bitrate 1]kbps"}}}putlog "*** shoutcast.tcl v1.03 by domsen &lt;domsen@domsen.org&gt; succesfully loaded. turn it up baby."</code></pre></div>I hope I didn't miss anything I copied and pasted out of putty<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11701">yelow79</a> — Sun Jun 26, 2011 12:13 am</p><hr />
]]></content>
	</entry>
	</feed>
