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

	<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>2003-08-21T07:40:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-08-21T07:40:23-04:00</updated>

		<published>2003-08-21T07:40:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25410#p25410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25410#p25410"/>
		<title type="html"><![CDATA[Frustrated]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25410#p25410"><![CDATA[
Very small mistake in the logic you use to detect it<br><div class="codebox"><p>Code: </p><pre><code>if { (![string equal {} $line]) || (![lindex [split $line] 1] &gt; 5) } {</code></pre></div>Notice you use of !. There is no need for it.<br><br>Secondly.<br><br>Notice your "for" command. Why?<br><br>In english<blockquote class="uncited"><div>Lets count from 0<br>Keep looping, provided the current count is below or the same as 0.</div></blockquote>This will make it only read the first line.<br><br>My guress is you want the while loop. When you detect a matching line, use "break" to get out of the loop and stop checking.<br><br>Third.<br><div class="codebox"><p>Code: </p><pre><code>putserv "PRIVMSG #spamwatch :[join [lindex [split $line] 0]]"</code></pre></div>"lindex" returns a string. There is no need to use "join", this may only break things.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Aug 21, 2003 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MarlbMan]]></name></author>
		<updated>2003-08-21T01:36:37-04:00</updated>

		<published>2003-08-21T01:36:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25392#p25392</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25392#p25392"/>
		<title type="html"><![CDATA[Frustrated]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25392#p25392"><![CDATA[
OK... I have put together a bit of script that reads from a text file which contains the output of a /list. The file contains many lines that look somewhat like this:<br><br>&lt;#channel&gt; &lt;# users&gt; &lt;description&gt;<br>example:<br>#mychannel 3 test channel<br><br>when showchans is typed in channel it should return the first channel with greater than 5 users. If the first channel contains less than 5 users, it should move on until it finds one with greater than five. Currently however, it just returns the first channel in the list. oddly though, the part of the script which makes it move on if the line is blank, works. Here is the script.<br><div class="codebox"><p>Code: </p><pre><code>proc showchans {nick uhost hand chan arg} {global sd_settingset amount 0if {(![file exists sdchans.txt]) || (![file readable sdchans.txt])} {putserv "NOTICE $nick :Unable to read from file sdchans.txt."return} else {if {![string equal {} [lindex [split $arg] 0]]} {set nick [lindex [split $arg] 0]}set fd [open sdchans.txt r]for {set temp 0} {$temp &lt;= 0} {incr temp} {gets $fd lineif { (![string equal {} $line]) || (![lindex [split $line] 1] &gt; 5) } {incr amountputserv "PRIVMSG #spamwatch :[join [lindex [split $line] 0]]"}}}close $fd}bind pub - showchans showchansputlog "loaded, testing"</code></pre></div>plz help *bangs head on desk*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3021">MarlbMan</a> — Thu Aug 21, 2003 1:36 am</p><hr />
]]></content>
	</entry>
	</feed>
