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

	<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-03-04T14:11:02-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-03-04T14:11:02-04:00</updated>

		<published>2006-03-04T14:11:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60866#p60866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60866#p60866"/>
		<title type="html"><![CDATA[I wrote my own shoutcast script but need help plz :o]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60866#p60866"><![CDATA[
<ul><li>'proper indentation' means writing/posting like this:<div class="codebox"><p>Code: </p><pre><code>if {$flag} {   set foo $bar}</code></pre></div>and <strong class="text-strong">not</strong> like this:<div class="codebox"><p>Code: </p><pre><code>if {$flag} {set foo $bar}</code></pre></div>the former is easier to read, the latter is harder</li><li>go to <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/http.htm" class="postlink">http package</a> manpage ('manpage' means manual page) and learn about it</li><li>'unbalanced braces' means you have different number of opening { and closing } characters; sometimes Tcl reports that directly, sometimes not; and if not, the error message is misleading</li><li>use <em class="text-italics">.set errorInfo</em> to obtain backtrace on the error</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Mar 04, 2006 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NTHosts]]></name></author>
		<updated>2006-03-04T13:09:33-04:00</updated>

		<published>2006-03-04T13:09:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60863#p60863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60863#p60863"/>
		<title type="html"><![CDATA[hehe]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60863#p60863"><![CDATA[
<blockquote class="uncited"><div>1. post your script with proper indentation<br>2. don't use raw socket, use http package<br>3. your error is likely due to unbalanced braces</div></blockquote>Proper Indentation ?<br>http package ?<br>unbalanced braces ??<br><br>omg sorry i have no idea what any of that means, like i said i just chopped a few other scripts and put them together.<br>I did do a little rewrite, now i dont get errors it just dont do anything.. heres the script..<br><div class="codebox"><p>Code: </p><pre><code>set topictrigger "!topic"set streamip "stream.lynxfm.info"set streamport "9000"set streampass "password"set radiochans "#LynxFM"bind pub - $topictrigger  pub_topicbind msg - $topictrigger  msg_topicproc topic { target } { 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 topic [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]}}putquick "PRIVMSG $target : $topic "proc msg_topic { nick uhost hand arg } { topic $chan}proc pub_topic { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans][string tolower $chan]] != -1) || ($radiochans == "")} { topic $chan  }}}}</code></pre></div>Thanks for any help you can give <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6839">NTHosts</a> — Sat Mar 04, 2006 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-03-04T13:03:22-04:00</updated>

		<published>2006-03-04T13:03:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60862#p60862</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60862#p60862"/>
		<title type="html"><![CDATA[I wrote my own shoutcast script but need help plz :o]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60862#p60862"><![CDATA[
1. post your script with proper indentation<br>2. don't use raw socket, use http package<br>3. your error is likely due to unbalanced braces<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Mar 04, 2006 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NTHosts]]></name></author>
		<updated>2006-03-04T11:35:48-04:00</updated>

		<published>2006-03-04T11:35:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60855#p60855</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60855#p60855"/>
		<title type="html"><![CDATA[I wrote my own shoutcast script but need help plz :o]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60855#p60855"><![CDATA[
Ok heres the silly attempt at me writing tcl, well, i just poked around other ppls scripts and took bits out, but it all counts right ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><div class="codebox"><p>Code: </p><pre><code>set topictrigger "!topic"set streamip "stream.lynxfm.info"set streamport "9000"set streampass "zigzag"set radiochans "#LynxFM"bind pub - $topictrigger  pub_topicbind msg - $topictrigger  msg_topicproc topic { target } { 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 topic "topic: [string range $bl [shrink + 13 "&lt;SERVERTITLE&gt;" 0 $bl] [shrink - 1 "&lt;/SERVERTITLE&gt;" 0 $bl]]"}}putquick "PRIVMSG $target :$topic"proc msg_topic { nick uhost hand arg } { topic $chan}proc pub_topic { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans][string tolower $chan]] != -1) || ($radiochans == "")} { topic $chan  }}}}</code></pre></div>When i try the !topic.. i get this error..<br><br> [10:28] Tcl error [pub_topic]: invalid command name "pub_topic"<br><br>im pulling my hair out with this 1, i also dont really want it to msg then channel, but rather to change its topic.<br><br>Any ideas please ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6839">NTHosts</a> — Sat Mar 04, 2006 11:35 am</p><hr />
]]></content>
	</entry>
	</feed>
