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

	<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>2010-04-05T19:57:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-04-05T19:57:23-04:00</updated>

		<published>2010-04-05T19:57:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92709#p92709</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92709#p92709"/>
		<title type="html"><![CDATA[Regarding time and clock scan/seconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92709#p92709"><![CDATA[
Ah, thank you! I don't actually need this bind anymore, but its still nice to know how to do  for future use.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Mon Apr 05, 2010 7:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-03-31T16:47:25-04:00</updated>

		<published>2010-03-31T16:47:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92661#p92661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92661#p92661"/>
		<title type="html"><![CDATA[Regarding time and clock scan/seconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92661#p92661"><![CDATA[
<blockquote class="uncited"><div>[12:45pm] &lt;speechles&gt; .tcl set myoffset 1<br>[12:45pm] &lt;sp33chy&gt; Tcl: 1<br>[12:45pm] &lt;speechles&gt; .tcl set timeLeftTilMidnigt [duration [expr {[clock scan "tomorrow 00:00"] - [clock seconds] - ($myoffset * 3600)}]]<br>[12:45pm] &lt;sp33chy&gt; Tcl: 10 hours 14 minutes 10 seconds<br>...<br>[12:49pm] &lt;speechles&gt; .tcl set myoffset 0<br>[12:49pm] &lt;sp33chy&gt; Tcl: 0<br>[12:49pm] &lt;speechles&gt; .tcl set timeLeftTilMidnigt [duration [expr {[clock scan "tomorrow 00:00"] - [clock seconds] - ($myoffset * 3600)}]]<br>[12:49pm] &lt;sp33chy&gt; Tcl: 11 hours 10 minutes 6 seconds</div></blockquote>Pretty simple..  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><br><div class="codebox"><p>Code: </p><pre><code>set myoffset 1bind pub - !time time:leftproc time:left {nick host hand chan text} {   putserv "PRIVMSG $nick :Time left until midnight is: [duration [expr {[clock scan "tomorrow 00:00"] - [clock seconds] - ($::myoffset * 3600)}]]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 31, 2010 4:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2010-03-31T10:44:38-04:00</updated>

		<published>2010-03-31T10:44:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92657#p92657</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92657#p92657"/>
		<title type="html"><![CDATA[Regarding time and clock scan/seconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92657#p92657"><![CDATA[
<a href="http://tcl.tk/man/tcl8.5/TclCmd/clock.htm#M10" class="postlink">http://tcl.tk/man/tcl8.5/TclCmd/clock.htm#M10</a> <blockquote class="uncited"><div>% clock scan "Tomorrow"<br>1270076400<br>% clock format [clock scan "Tomorrow"]<br>Thu Apr 01 00:00:00 BST 2010<br>% clock scan "24 hours"<br>1270132959<br>% clock format [clock scan "24 hours"]<br>Thu Apr 01 15:42:48 BST 2010<br>% clock format [clock scan "23 hours"]<br>Thu Apr 01 14:43:05 BST 2010<br>%</div></blockquote> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Wed Mar 31, 2010 10:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-30T20:28:48-04:00</updated>

		<published>2010-03-30T20:28:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92652#p92652</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92652#p92652"/>
		<title type="html"><![CDATA[Regarding time and clock scan/seconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92652#p92652"><![CDATA[
Worth noting that paste.tcl-help.net reports no errors on this:<br><div class="codebox"><p>Code: </p><pre><code>bind pub * !time time:leftproc time:left {nick host hand chan text} {    set tartime [clock scan "00:00:00"]    set mytime [clock scan "%T"]    set offset [duration [expr {$mytime - 3600}]]    set difftime [duration [expr {$offset -  $tartime}]]    if {$offset != $tartime} {putserv "PRIVMSG $nick :Time left until tomorrow is $difftime"    }}</code></pre></div>But I get an error in partyline when I load the command "Tcl error [time:left]: unable to convert date-time string "%T": syntax error (characters 0-0)"<br><br>Do I need to specify the format?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Tue Mar 30, 2010 8:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-30T16:09:04-04:00</updated>

		<published>2010-03-30T16:09:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92651#p92651</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92651#p92651"/>
		<title type="html"><![CDATA[Regarding time and clock scan/seconds]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92651#p92651"><![CDATA[
I need  a script that will display, on a public !command, how many hours:mins:secs is left until a specified time. In this case 12:00. However, I need to deduct 1 hour from my time to cover the timezone difference before announcing time before midnight. But I am confused as to what I actually need to use to do this. I was looking at this thread: <a href="http://forum.egghelp.org/viewtopic.php?t=12507&amp;highlight=zone" class="postlink">http://forum.egghelp.org/viewtopic.php? ... light=zone</a> which is where I learned about clock scan/seconds, but I am unsure of how to use these to do what I need. <br><br>This is what i have so far. Have not tested it, as I am not sure I even did the bind properly: <div class="codebox"><p>Code: </p><pre><code>bind pub * !time time:left proc time:left {nick host hand chan} {   set tartime [clock scan "00:00:00"]   set mytime [clock scan "%T"   set offset [duration [expr $mytime - 3600]] ; #I assume I would subtract an hour by seconds   set difftime [duration [expr $offset -  $tartime]       if {$offset != $tartime} {          putserv "PRIVMSG $nick :Time left until midnight is $difftime"        }}</code></pre></div>Please advise, thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Tue Mar 30, 2010 4:09 pm</p><hr />
]]></content>
	</entry>
	</feed>
