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

	<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-05-12T20:17:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T20:17:05-04:00</updated>

		<published>2003-05-12T20:17:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20139#p20139</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20139#p20139"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20139#p20139"><![CDATA[
nevermind, problem fixed<br>but thanks for the help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 8:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T20:07:11-04:00</updated>

		<published>2003-05-12T20:07:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20138#p20138</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20138#p20138"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20138#p20138"><![CDATA[
ok, tried it with the fconfigure thing n without it, n kept the putlog thing. the result is that it seems it does read the entire file, but it only starts doing the putlog thing after half the file has been read.<br><br>i honestly dont know wats wrong, n ive changed the coding many many many times over the past 4 days.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 8:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-12T18:01:01-04:00</updated>

		<published>2003-05-12T18:01:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20134#p20134</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20134#p20134"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20134#p20134"><![CDATA[
something like<br><div class="codebox"><p>Code: </p><pre><code>set f [open file];# r is the default mode, so it's not neededfconfigure $f -translation binaryset lines [split [read $f] \n]...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 12, 2003 6:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T17:55:54-04:00</updated>

		<published>2003-05-12T17:55:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20133#p20133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20133#p20133"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20133#p20133"><![CDATA[
ehhhhh how would i go about doing that?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-12T17:53:13-04:00</updated>

		<published>2003-05-12T17:53:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20132#p20132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20132#p20132"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20132#p20132"><![CDATA[
Try 'fconfigure &lt;file channel&gt; -translation binary' before you read/gets from it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 12, 2003 5:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T17:46:29-04:00</updated>

		<published>2003-05-12T17:46:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20131#p20131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20131#p20131"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20131#p20131"><![CDATA[
ofc, downloaded it quite a few times already, i open it with wordpad over n over again n i can see the entire file n its just fine, but the bot itself wont read the first half<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-12T17:44:57-04:00</updated>

		<published>2003-05-12T17:44:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20129#p20129</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20129#p20129"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20129#p20129"><![CDATA[
This sounds weird. Have you verified that the file actually contains more data than what you're able to read/gets from it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 12, 2003 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T17:33:49-04:00</updated>

		<published>2003-05-12T17:33:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20127#p20127</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20127#p20127"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20127#p20127"><![CDATA[
its really hard to explain the real point of the tcl if u dont play a certain game, but ill give it a try.... somehow...<br><br>i just checked with some 'putlog' things to see if the bot gets stuck somewhere or something, n well, it reads a file it dls from a site, n with a command it searches the given parameters within the file. apparently, its not reading the first half of the file.  i tried it with the 'while' function too, same result.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 5:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-12T16:34:56-04:00</updated>

		<published>2003-05-12T16:34:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20126#p20126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20126#p20126"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20126#p20126"><![CDATA[
what exactly is it that foreach isn't doing properly?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 12, 2003 4:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T16:21:46-04:00</updated>

		<published>2003-05-12T16:21:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20124#p20124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20124#p20124"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20124#p20124"><![CDATA[
im aware foreach is the better option n wat while does, but since foreach isnt properly doing wat i want, i gotta try the other choice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-05-12T16:16:55-04:00</updated>

		<published>2003-05-12T16:16:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20122#p20122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20122#p20122"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20122#p20122"><![CDATA[
In most circumstances, foreach is the best way. Using a while loop is more cumbersome because you have to check for eof after you read, not before. The code User posted doesn't do this, so you will end up processing an extra blank line in each file. The correct while loop code is like this:<div class="codebox"><p>Code: </p><pre><code>set file [open sheep/baa.txt r]while {[gets $file line] != -1} {  # $line holds the line read}close $file</code></pre></div>Because Tcl is rather inefficient, if you are reading many lines it's much better to use foreach line [split [read $file] \n] like that. That makes tcl read all the lines at once using C code. For long files, it is *much* faster.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon May 12, 2003 4:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-12T16:01:03-04:00</updated>

		<published>2003-05-12T16:01:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20119#p20119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20119#p20119"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20119#p20119"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set f [open file r]while {![eof $f]} {    gets $f line    # here's your $line...do what ever you like with it}close $f</code></pre></div>in other words...<br><br>while {end of file is NOT reached} {get one line from the file and store the value in a variable called 'line'}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 12, 2003 4:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrollY]]></name></author>
		<updated>2003-05-12T15:54:45-04:00</updated>

		<published>2003-05-12T15:54:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20118#p20118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20118#p20118"/>
		<title type="html"><![CDATA[While....]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20118#p20118"><![CDATA[
so far, in all my TCLs i use the 'foreach' function to read files n such, though ive come to scripting something that i believe that 'foreach' isnt doing the job properly.  i tried to use the 'while' function to read files but i cant seem to get it to work how i want it to.  how would i go about making it read a file, n how would i check each line?  like in 'foreach' i would just call each line $line (foreach line $var {)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3056">BrollY</a> — Mon May 12, 2003 3:54 pm</p><hr />
]]></content>
	</entry>
	</feed>
