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

	<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>2008-06-16T09:30:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[tsukeh]]></name></author>
		<updated>2008-06-16T09:30:53-04:00</updated>

		<published>2008-06-16T09:30:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83567#p83567</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83567#p83567"/>
		<title type="html"><![CDATA[Read from textfile every 4 secs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83567#p83567"><![CDATA[
<blockquote class="uncited"><div>We expect users to help themselves here, you could of searched the forum for 'utimer' and created the timer yourself.<br><br>It should look something like:<br><div class="codebox"><p>Code: </p><pre><code>proc dumpfile {} {  set file [open text.txt r]  set data [read -nonewline $file]  close $file  foreach line [split $data \n] {    if {$line == ""} { continue }    putserv "PRIVMSG #CHANNEL_HERE :$line"  }  set file [open text.txt w]  puts $file ""  close $file  utimer 4 [list dumpfile]}utimer 4 [list dumpfile]</code></pre></div></div></blockquote><div class="codebox"><p>Code: </p><pre><code> if {[lsearch [utimers] "* dumpfile *"] == -1} { utimer 4 [list dumpfile] }</code></pre></div>Otherwise it starts a new timer always you .rehash..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5911">tsukeh</a> — Mon Jun 16, 2008 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2008-06-15T17:22:09-04:00</updated>

		<published>2008-06-15T17:22:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83548#p83548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83548#p83548"/>
		<title type="html"><![CDATA[Read from textfile every 4 secs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83548#p83548"><![CDATA[
We expect users to help themselves here, you could of searched the forum for 'utimer' and created the timer yourself.<br><br>It should look something like:<br><div class="codebox"><p>Code: </p><pre><code>proc dumpfile {} {  set file [open text.txt r]  set data [read -nonewline $file]  close $file  foreach line [split $data \n] {    if {$line == ""} { continue }    putserv "PRIVMSG #CHANNEL_HERE :$line"  }  set file [open text.txt w]  puts $file ""  close $file  utimer 4 [list dumpfile]}utimer 4 [list dumpfile]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Sun Jun 15, 2008 5:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onesikgypo]]></name></author>
		<updated>2008-06-15T14:29:10-04:00</updated>

		<published>2008-06-15T14:29:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83544#p83544</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83544#p83544"/>
		<title type="html"><![CDATA[Read from textfile every 4 secs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83544#p83544"><![CDATA[
thanks, im unable to test it right now, and am also completely new to tcl scripts - but i dont think what you posted contains the 4sec timer i need?<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9991">onesikgypo</a> — Sun Jun 15, 2008 2:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2008-06-15T08:53:27-04:00</updated>

		<published>2008-06-15T08:53:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83540#p83540</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83540#p83540"/>
		<title type="html"><![CDATA[Read from textfile every 4 secs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83540#p83540"><![CDATA[
Example: (untested)<br><div class="codebox"><p>Code: </p><pre><code>set file [open text.txt r]set data [read -nonewline $file]close $fileforeach line [split $data \n] {    if {$line == ""} { continue }    putserv "PRIVMSG #CHANNEL_HERE :$line"}set file [open text.txt w]puts $file ""close $file</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Sun Jun 15, 2008 8:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[onesikgypo]]></name></author>
		<updated>2008-06-14T22:01:46-04:00</updated>

		<published>2008-06-14T22:01:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83532#p83532</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83532#p83532"/>
		<title type="html"><![CDATA[Read from textfile every 4 secs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83532#p83532"><![CDATA[
Hi,<br><br>I was wondering if someone could write me a smallt tcl script that would do the following:<br><br>1) Every 4 secs "Text.txt" is read - and messaged into a channel<br>2) Once the text has been read, the contents are deleted<br>3) If there's no contents in the Text, then nothing happens.<br><br>Any help would be greatly appreciated.<br><br>Thanks.<br><br>Edit: This is for an eggdrop<br><br>Edit2:<br><br>i had a mini go at it, just from cutting other scripts - unsure though if its correct, or how to put it on a timer:<br><div class="codebox"><p>Code: </p><pre><code>#readingset fname "yourfile.txt" set fp [open $fname "r"] set data [read -nonewline $fp] close $fp set lines [split $data "\n"] #messagingset wchan #Changlobal wchan {putserv $lines }#deletingset match *while {[set i [lsearch -glob $lines $match]]&gt;-1} { set lines [lreplace $lines $i $i] }#writing fileset fp [open $fp "w"] puts $fp [join $lines "\n"] close $fp </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9991">onesikgypo</a> — Sat Jun 14, 2008 10:01 pm</p><hr />
]]></content>
	</entry>
	</feed>
