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

	<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>2005-01-06T09:30:59-04:00</updated>

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

		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-06T09:30:59-04:00</updated>

		<published>2005-01-06T09:30:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45050#p45050</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45050#p45050"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45050#p45050"><![CDATA[
user, my eggdrop is givem that error of "no channel call file.dat "  and now i cam understeend why.. tks [[]]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Thu Jan 06, 2005 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-03T19:04:58-04:00</updated>

		<published>2005-01-03T19:04:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44902#p44902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44902#p44902"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44902#p44902"><![CDATA[
<blockquote class="uncited"><div>But I have only one last question, went we put <strong class="text-strong">close $f</strong> $f is [<strong class="text-strong">open (..)</strong> don't is better to put the name of the file?<br>like <strong class="text-strong">close partidas.txt</strong> or the final resut will be the same?</div></blockquote><a href="http://tcl.tk/man/tcl8.5/TclCmd/close.htm" class="postlink">close</a> expects the name of a file channel, not the name of a file. Check the <a href="http://tcl.tk/man/tcl8.5/TclCmd/contents.htm" class="postlink">manual</a> and read up on the <a href="http://tcl.tk/man/tcl8.5/TclCmd/Tcl.htm" class="postlink">syntax</a>...you'll see why the contents of 'f' is not '[open file.txt]', but what <a href="http://tcl.tk/man/tcl8.5/TclCmd/open.htm" class="postlink">open</a> returned (because of <a href="http://tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M5" class="postlink">command substitution</a>)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Jan 03, 2005 7:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[the_crow]]></name></author>
		<updated>2005-01-03T18:03:01-04:00</updated>

		<published>2005-01-03T18:03:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44899#p44899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44899#p44899"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44899#p44899"><![CDATA[
what you can do:<br><div class="codebox"><p>Code: </p><pre><code>set ficheiro "partidas.txt"bind pub - !partidas pub:partidas proc pub:partidas {nick uhost handle chan arg} { global ficheiroif {![file exists $ficheiro] } { putserv "PRIVMSG $nick :Sem novas partidas" } else { set f [open $ficheiro "r"] putserv "PRIVMSG $nick :Ultimas partidas reportadas:" while {[gets $f line]&gt;-1} { putserv "PRIVMSG $nick :$line" } putserv "PRIVMSG $nick :Para as eleminar faça !reset" close $f } } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2778">the_crow</a> — Mon Jan 03, 2005 6:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-03T17:46:10-04:00</updated>

		<published>2005-01-03T17:46:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44898#p44898</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44898#p44898"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44898#p44898"><![CDATA[
weee... tks ppl for helping me. now it work's at 100%<br><br>final code: <br><div class="codebox"><p>Code: </p><pre><code>bind pub - !partidas pub:partidasproc pub:partidas {nick uhost handle chan arg} {if {![file exists partidas.txt] } { putserv "PRIVMSG $nick :Sem novas partidas"} else {set f [open partidas.txt] putserv "PRIVMSG $nick :Ultimas partidas reportadas:"while {[gets $f line]&gt;-1} {putserv "PRIVMSG $nick :$line"}putserv "PRIVMSG $nick :Para as eleminar faça !reset"close $f}}</code></pre></div>But I have only one last question, went we put <strong class="text-strong">close $f</strong> $f is [<strong class="text-strong">open (..)</strong> don't is better to put the name of the file?<br>like <strong class="text-strong">close partidas.txt</strong> or the final resut will be the same?<br><br>and one more time.. tks [[]]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Mon Jan 03, 2005 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-01-03T15:34:42-04:00</updated>

		<published>2005-01-03T15:34:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44893#p44893</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44893#p44893"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44893#p44893"><![CDATA[
you didn't open the file<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Jan 03, 2005 3:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-03T15:35:28-04:00</updated>

		<published>2005-01-03T15:34:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44892#p44892</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44892#p44892"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44892#p44892"><![CDATA[
1: you continue even if the file doesn't exist.<br>2: you never open the file<br>3: the start/end messages are inside the loop (which I doubt is what you want)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Jan 03, 2005 3:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-03T15:29:44-04:00</updated>

		<published>2005-01-03T15:29:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44891#p44891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44891#p44891"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44891#p44891"><![CDATA[
try and try and notting =\<br>This is the code rewrithem:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !partidas pub:partidasproc pub:partidas {nick uhost handle chan arg} {set fname "partidas.txt"if {![file exists $fname] } { putserv "PRIVMSG $nick :Sem novas partidas"}foreach line [split [read -nonewline $fname] \n] { putserv "PRIVMSG $nick :Ultimas partidas reportadas:"putserv "PRIVMSG $nick :$line"putserv "PRIVMSG $nick :Para as eleminar faça !reset"}close $fname}</code></pre></div>And this is the error that happens:<br>[19:25] Tcl error [pub:partidas]: can not find channel named "partidas.txt"<br><br>tks for the help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Mon Jan 03, 2005 3:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-03T15:10:21-04:00</updated>

		<published>2005-01-03T15:10:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44890#p44890</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44890#p44890"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44890#p44890"><![CDATA[
<blockquote class="uncited"><div>try:<div class="codebox"><p>Code: </p><pre><code>set f [open file.txt]while {![eof $f]} {lappend lines [gets $f]}close $f</code></pre></div></div></blockquote>Using eof like that will give you a empty element at the end of the list if the last line ends with a newline.<br>Try <div class="codebox"><p>Code: </p><pre><code>set f [open file.txt]while {[gets $f line]&gt;-1} {#output $line}close $f</code></pre></div>or<div class="codebox"><p>Code: </p><pre><code>set f [open file.txt]foreach line [split [read -nonewline $f] \n] {#output $line}close $f</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Jan 03, 2005 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-03T15:10:04-04:00</updated>

		<published>2005-01-03T15:10:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44889#p44889</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44889#p44889"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44889#p44889"><![CDATA[
sorry.. but can you explain better?<br>Is to resume for me, a try that, but i think that im doing that not in the right way.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Mon Jan 03, 2005 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-01-03T14:56:03-04:00</updated>

		<published>2005-01-03T14:56:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44887#p44887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44887#p44887"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44887#p44887"><![CDATA[
try:<div class="codebox"><p>Code: </p><pre><code>set f [open file.txt]while {![eof $f]} {lappend lines [gets $f]}close $f</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Jan 03, 2005 2:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-03T14:44:01-04:00</updated>

		<published>2005-01-03T14:44:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44886#p44886</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44886#p44886"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44886#p44886"><![CDATA[
no, there is a } before the rest.<br>i am trying to read a file that exist, and work's, but only read the fist line, and not all =\<br>And i  don't know do it =\<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Mon Jan 03, 2005 2:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-01-03T14:13:46-04:00</updated>

		<published>2005-01-03T14:13:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44884#p44884</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44884#p44884"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44884#p44884"><![CDATA[
you are trying to read a file that doesn't exist<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Jan 03, 2005 2:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrAnderson]]></name></author>
		<updated>2005-01-03T18:00:01-04:00</updated>

		<published>2005-01-03T13:17:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44876#p44876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44876#p44876"/>
		<title type="html"><![CDATA[make a egg read a file in the channel [RESOLV]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44876#p44876"><![CDATA[
Hello. i was tying to put a egg reading a file, and put the file in the channel or private windows, but the egg only read's the fisrt line, i try lot's of way's, follow wat is in the egg faq called " Basic File Operations" but i can't doint.<br><br>This is the code:<br><div class="codebox"><p>Code: </p><pre><code>bind msg - !partidas msg:partidasproc msg:partidas {nick uhost handle arg} {if {![file exists partidas.txt] } {putserv "PRIVMSG $nick : ERROR: File dont exist"}set jogos [open partidas.txt r]set ptmsg [read -nonewline $jogos]#set lines [split $jogos "\n"] #set numlines [llength $lines]putserv "PRIVMSG $nick :Last games:"putserv "PRIVMSG $nick :$ptmsg"putserv "PRIVMSG $nick :To delete make  !reset"close $jogos}</code></pre></div> <br>Can anywane help me? I want make the egg read all the file and not only the fisrt line.<br>tks<br><br>P.S. Sorry for my bad english.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5360">MrAnderson</a> — Mon Jan 03, 2005 1:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
