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

	<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-12-29T12:19:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-29T12:19:46-04:00</updated>

		<published>2003-12-29T12:19:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31934#p31934</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31934#p31934"/>
		<title type="html"><![CDATA[Help: Trying to cause a dealy when writing to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31934#p31934"><![CDATA[
Yes, use foreach to get each timer in [utimers]<br>each utimer would be in this form:<blockquote class="uncited"><div>{<strong class="text-strong">seconds</strong> {<strong class="text-strong">command</strong>} <strong class="text-strong">timerID</strong>}</div></blockquote>you can either get the timerID to check if the utimer's active (that's if you do set id [utimer...]) or you can see if the command exists for example using <strong class="text-strong">string match -nocase your-command [lindex $utimer 1]</strong> where [lindex $utimer 1] is the command in the utimer.<br><br>As for the second timer, when you see that the first timer exists, you can do <strong class="text-strong">utimer [lindex $utimer 0] [your command]</strong>.<br><br>Hope that clears it up <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Dec 29, 2003 12:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-12-29T11:06:08-04:00</updated>

		<published>2003-12-29T11:06:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31929#p31929</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31929#p31929"/>
		<title type="html"><![CDATA[Help: Trying to cause a dealy when writing to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31929#p31929"><![CDATA[
Sorry for not being very bright.. so i use the command utimers to list which timers are active... How do i add up the seconds remaining for all the timers, and even know how many to count? Would i use a foreach? <br><br>Maybe its too late at night for my brain to be working (-_-;)<br><br>*edit*<br><br>Baka me. I guess the question is, if i keep the timerid of the last timer, how do i check how long it has left?<p>Statistics: Posted by Guest — Mon Dec 29, 2003 11:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-29T10:55:24-04:00</updated>

		<published>2003-12-29T10:55:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31927#p31927</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31927#p31927"/>
		<title type="html"><![CDATA[Help: Trying to cause a dealy when writing to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31927#p31927"><![CDATA[
You can check if the utimer exists in [utimers], if yes then create another utimer using the seconds in the first timer + 1 for example, so it will trigger after 1 second from the first timer.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Dec 29, 2003 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-12-29T09:03:52-04:00</updated>

		<published>2003-12-29T09:03:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31920#p31920</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31920#p31920"/>
		<title type="html"><![CDATA[Help: Trying to cause a dealy when writing to a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31920#p31920"><![CDATA[
OK, the topic does not describe what i am trying to do very well... I am new with Tcl, and have only written 2 scripts (including this one).<br><br>I am trying to buffer some text to be written to a file, so it only writes one line every 2 seconds. I cant seem to get it to wait untill the first utimer is done before it executes the next. So far, i just seem to stack a bunch of timers. <br><div class="codebox"><p>Code: </p><pre><code>proc log:chat {nick host hand chan text} {  global sub_dir  global chat_sets  global sub_file  set sub_str "&lt;$nick&gt; $text"  set sub_pointer [open $logdir/$sub_file w]  utimer 2 [puts $sub_pointer "$chat_sets"]  puts $sub_pointer "$sub_str"  close $sub_pointer}</code></pre></div>How would i cause the code to wait for the previous timer to expire before counting down?<p>Statistics: Posted by Guest — Mon Dec 29, 2003 9:03 am</p><hr />
]]></content>
	</entry>
	</feed>
