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

	<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>2007-02-14T19:21:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cannot_delete]]></name></author>
		<updated>2007-02-14T19:21:05-04:00</updated>

		<published>2007-02-14T19:21:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70454#p70454</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70454#p70454"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70454#p70454"><![CDATA[
please... =/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8421">cannot_delete</a> — Wed Feb 14, 2007 7:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cannot_delete]]></name></author>
		<updated>2007-02-07T15:30:58-04:00</updated>

		<published>2007-02-07T15:30:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70259#p70259</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70259#p70259"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70259#p70259"><![CDATA[
ok, thx. <br><br>I could use some help on how to do that.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>thx for your help,<br><br>-typ-<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8421">cannot_delete</a> — Wed Feb 07, 2007 3:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-02-06T16:21:15-04:00</updated>

		<published>2007-02-06T16:21:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70244#p70244</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70244#p70244"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70244#p70244"><![CDATA[
"duration" expects the time to be in seconds, hence you'll need to take apropriate actions to convert the millisecond-based time into second-based. See my previous post on suggestions on how to do this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Feb 06, 2007 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cannot_delete]]></name></author>
		<updated>2007-02-06T16:15:32-04:00</updated>

		<published>2007-02-06T16:15:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70243#p70243</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70243#p70243"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70243#p70243"><![CDATA[
Here's my result:<br><div class="codebox"><p>Code: </p><pre><code>## return a duration as a stringproc mx_durationtyp {time} {    variable dur [duration [expr [clock clicks]] - $time]]    regsub -all "milliseconds" $dur [mc "milliseconds"] dur    regsub -all "millisecond" $dur [mc "millisecond"] dur        regsub -all "seconds" $dur [mc "seconds"] dur    regsub -all "second" $dur [mc "second"] dur    regsub -all "minutes" $dur [mc "minutes"] dur    regsub -all "minute" $dur [mc "minute"] dur    regsub -all "hours" $dur [mc "hours"] dur    regsub -all "hour" $dur [mc "hour"] dur    regsub -all "days" $dur [mc "days"] dur    regsub -all "day" $dur [mc "day"] dur    regsub -all "weeks" $dur [mc "weeks"] dur    regsub -all "week" $dur [mc "week"] dur    regsub -all "months" $dur [mc "months"] dur    regsub -all "month" $dur [mc "month"] dur    return $dur}</code></pre></div>I changed the time variable like this (I added a "typ" into my changes. the line above is the original version):<br><div class="codebox"><p>Code: </p><pre><code>variable timeasked [unixtime]variable timeaskedtyp [clock clicks]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>proc moxquiz_pubm {nick host handle channel text} {    global quizstate banner bannerspace    global timeasked theq aftergame    global timeaskedtyp theq aftergame</code></pre></div><div class="codebox"><p>Code: </p><pre><code>set duration [mx_duration $timeasked]             set durationtyp [mx_durationtyp $timeaskedtyp]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>            mxirc_say $channel [mc "%s solved after %s and now has %s&lt;%d&gt;%s points (+%d) on rank %d." "[banner] [botcolor nick]$nick[botcolor txt]" $durationtyp [botcolor nick] $userarray(score) [botcolor txt] $theq(Score) [mx_get_rank_pos $nick]]</code></pre></div>Unfortunally I can only post these sniplets. the whole script would be too long. <br><br>I forgot to tell: I didn't get it working.<br><br>thx for your help,<br><br>-typ-<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8421">cannot_delete</a> — Tue Feb 06, 2007 4:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cannot_delete]]></name></author>
		<updated>2007-02-06T13:53:43-04:00</updated>

		<published>2007-02-06T13:53:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70239#p70239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70239#p70239"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70239#p70239"><![CDATA[
thx for your help. =D<br><br>-typ-<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8421">cannot_delete</a> — Tue Feb 06, 2007 1:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-02-06T13:36:51-04:00</updated>

		<published>2007-02-06T13:36:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70238#p70238</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70238#p70238"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70238#p70238"><![CDATA[
The main problem is that "unixtime" does not keep track of fractions of a second. You could always use "clock clicks" if it is available on your platform; keep in mind however, that this will return a system-dependant time-measurement, often the smallest time-period your system may measure (cpu-clock or such). As of tcl8.3 there is an option "-milliseconds" that will guarantee measurements in milliseconds across platforms, which you might be able to utilize. Keep in mind that you might have to handle overflow situations in some cases, as integers in tcl are not large enough to hold the additional information compared to "unixtime". Also, keep in mind that the integer returned by "clock clicks -milliseconds" is a signed integer.<br><br>Now, keeping in mind of these issues, it should'nt be too hard to use clock-clicks in your current code. You'd obviously have to convert your millisecond time into "unixtime" time when using the "duration" command. A simple division should solve that, while a modulus would extract the millisecond offset.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Feb 06, 2007 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cannot_delete]]></name></author>
		<updated>2007-02-06T13:10:28-04:00</updated>

		<published>2007-02-06T13:10:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70237#p70237</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70237#p70237"/>
		<title type="html"><![CDATA[milliseconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70237#p70237"><![CDATA[
Hi,<br><br>I need help with the following problem. As I understand it, this code (being a part of the moxquizz.tcl) is responsible for calculating a duration and prettyprinting it. Now I want to add milliseconds to the equation, but I don't know how.<br><div class="codebox"><p>Code: </p><pre><code>## return a duration as a stringproc mx_duration {time} {    variable dur [duration [expr [unixtime] - $time]]    regsub -all "seconds" $dur [mc "seconds"] dur    regsub -all "second" $dur [mc "second"] dur    regsub -all "minutes" $dur [mc "minutes"] dur    regsub -all "minute" $dur [mc "minute"] dur    regsub -all "hours" $dur [mc "hours"] dur    regsub -all "hour" $dur [mc "hour"] dur    regsub -all "days" $dur [mc "days"] dur    regsub -all "day" $dur [mc "day"] dur    regsub -all "weeks" $dur [mc "weeks"] dur    regsub -all "week" $dur [mc "week"] dur    regsub -all "months" $dur [mc "months"] dur    regsub -all "month" $dur [mc "month"] dur    return $dur}[code]Thanks for your help,-typ-</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8421">cannot_delete</a> — Tue Feb 06, 2007 1:10 pm</p><hr />
]]></content>
	</entry>
	</feed>
