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

	<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-11-21T20:34:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-21T20:34:47-04:00</updated>

		<published>2006-11-21T20:34:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68313#p68313</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68313#p68313"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68313#p68313"><![CDATA[
add<div class="codebox"><p>Code: </p><pre><code>if {![string equal -nocase #chan $chan]} {return 0}</code></pre></div>inside the proc, before 'set linecount 0'. (#chan is the channel where you want to script to work)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Nov 21, 2006 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-21T19:37:05-04:00</updated>

		<published>2006-11-21T19:37:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68310#p68310</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68310#p68310"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68310#p68310"><![CDATA[
thanks  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br><br>My bot is running in two channels, is it possible to let the trigger work only in one channel?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Tue Nov 21, 2006 7:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-21T18:23:09-04:00</updated>

		<published>2006-11-21T18:23:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68305#p68305</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68305#p68305"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68305#p68305"><![CDATA[
<blockquote class="uncited"><div> <div class="codebox"><p>Code: </p><pre><code>set linecount [llength $lines]</code></pre></div> </div></blockquote>Ohh yeah <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br>I forget these simple things  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Nov 21, 2006 6:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2006-11-21T17:55:53-04:00</updated>

		<published>2006-11-21T17:55:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68302#p68302</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68302#p68302"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68302#p68302"><![CDATA[
Or you replace this: <div class="codebox"><p>Code: </p><pre><code>foreach line $lines {  incr linecount}</code></pre></div> with <div class="codebox"><p>Code: </p><pre><code>set linecount [llength $lines]</code></pre></div> in the above example<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Nov 21, 2006 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-21T15:13:36-04:00</updated>

		<published>2006-11-21T15:13:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68296#p68296</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68296#p68296"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68296#p68296"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !count proc:countproc proc:count {nick host hand chan text} {    set linecount 0    set input [open /my/path/to/db.txt r]    set lines [split [read $input] \n]    catch {close $input}    foreach line $lines {         incr linecount    }    puthelp "PRIVMSG $chan :Lines: $linecount"}</code></pre></div>That's one way to do it.. Could probably use a "while ![eof]" as well..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Nov 21, 2006 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-21T05:33:14-04:00</updated>

		<published>2006-11-21T05:33:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68276#p68276</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68276#p68276"/>
		<title type="html"><![CDATA[counting stored lines in db]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68276#p68276"><![CDATA[
Im looking for a little script that will count how many lines there are stored in my txt database . My db is called db.txt<br><br>someting like: !count<br>outputs: found ## lines in db<br><br>Thanks in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Tue Nov 21, 2006 5:33 am</p><hr />
]]></content>
	</entry>
	</feed>
