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

	<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>2012-05-23T04:21:56-04:00</updated>

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

		<entry>
		<author><name><![CDATA[manxmistress]]></name></author>
		<updated>2012-05-23T04:21:56-04:00</updated>

		<published>2012-05-23T04:21:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99447#p99447</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99447#p99447"/>
		<title type="html"><![CDATA[Slowing down pasting of a txt file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99447#p99447"><![CDATA[
Sorry I didn't get back my sub/hubby been ill after chemo so all is well now including what you did thank you so much,  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11987">manxmistress</a> — Wed May 23, 2012 4:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2012-05-07T13:35:52-04:00</updated>

		<published>2012-05-07T13:35:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99361#p99361</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99361#p99361"/>
		<title type="html"><![CDATA[Slowing down pasting of a txt file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99361#p99361"><![CDATA[
Sure,<br>What I do, is rather than having a foreach-loop iterate through all lines at once, I use timers to repeatedly call my proc named "tellNextLine". This proc then reads the next line from the (already opened) file and sends it to the target, and then starts a new timer (to call tellNextLine again), until there are no more lines remaining in the file ("gets" returns less than 0 bytes read). I then close the file to preserve file descriptors.<br><br>Also, rather than read the whole file into memory at once, I leave the file open and only read the one line I need at the moment. Since we're using such a slow pace for sending messages, there's no real benefit from caching the texts in memory.<br><br>Other than that, I skipped some temporary variables you've used. The code I wrote should be able to completely replace the code from your original post.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon May 07, 2012 1:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manxmistress]]></name></author>
		<updated>2012-05-07T13:25:11-04:00</updated>

		<published>2012-05-07T13:25:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99360#p99360</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99360#p99360"/>
		<title type="html"><![CDATA[Slowing down pasting of a txt file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99360#p99360"><![CDATA[
Ok i can see what you mean but i dont have a clue how to put that in what I have, that above the user picks the file name and it starts pasting. It would be helpful to know what to do with that in plain english or how it is in relationship to what I have cheers<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11987">manxmistress</a> — Mon May 07, 2012 1:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2012-05-07T13:07:09-04:00</updated>

		<published>2012-05-07T13:07:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99358#p99358</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99358#p99358"/>
		<title type="html"><![CDATA[Slowing down pasting of a txt file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99358#p99358"><![CDATA[
There's quite a few ways of doing this; I'd probably do it using a recursive timers, reading one line at a time from the file.<br><br>A short example on how you could do this:<div class="codebox"><p>Code: </p><pre><code>proc tellNextLine {target fd} {  if {[gets $fd line] &gt;= 0} {    puthelp "PRIVMSG $target :$line"    utimer 4 [list tellNextLine $target $fd]  } else {    close $fd  }}proc Trance_Listing {nick userhost handle text} {  tellNextLine $nick [open "${::trance_file}/trancelist.txt" RDONLY]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon May 07, 2012 1:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manxmistress]]></name></author>
		<updated>2012-05-07T03:38:12-04:00</updated>

		<published>2012-05-07T03:38:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99357#p99357</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99357#p99357"/>
		<title type="html"><![CDATA[Slowing down pasting of a txt file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99357#p99357"><![CDATA[
Ok I am ok so far with this but would like to slow down the pasting of each line, what it does is read from a specific txt file and paste on line at a time but is doing so too fast, I would like say 3 or 4 seconds between lines also cant understand why it stops before the end of each file. <div class="codebox"><p>Code: </p><pre><code>    set tracks [open $filename]     set data [split [read -nonewline $tracks] \n]     close $tracks     foreach trance_line $data {         putserv "PRIVMSG $nick :$trance_line"     }  } proc Trance_Listing {nick uhost hand text} {    set number "trancelist"    set filename ${::trance_file}/${number}.txt    set tracks [open $filename]     set data [split [read -nonewline $tracks] \n]     close $tracks     foreach trance_line $data {         putserv "PRIVMSG $nick :$trance_line "     } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11987">manxmistress</a> — Mon May 07, 2012 3:38 am</p><hr />
]]></content>
	</entry>
	</feed>
