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

	<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>2006-11-26T11:49:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-26T11:49:53-04:00</updated>

		<published>2006-11-26T11:49:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68484#p68484</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68484#p68484"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68484#p68484"><![CDATA[
I was just making it clear for him how to use it since he misused it and got a Tcl error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Nov 26, 2006 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-11-26T11:07:11-04:00</updated>

		<published>2006-11-26T11:07:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68483#p68483</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68483#p68483"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68483#p68483"><![CDATA[
I was only refering to the second line. does he actually need time scanning from string? I thought he already has a unix time stamp in a variable...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun Nov 26, 2006 11:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-24T12:07:39-04:00</updated>

		<published>2006-11-24T12:07:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68421#p68421</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68421#p68421"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68421#p68421"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set duetime [clock scan "mm/dd/yy hh:mm:ss"]set duration [duration [expr {$duetime - [unixtime]}]]</code></pre></div></div></blockquote>example:<blockquote class="uncited"><div>.tcl set duetime [clock scan "11/25/06 00:10:00"]<br><strong class="text-strong">Tcl</strong>: 1164413400<br>.tcl duration [expr {$duetime - [unixtime]}]<br><strong class="text-strong">Tcl</strong>: 4 minutes 7 seconds</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Nov 24, 2006 12:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-24T10:41:11-04:00</updated>

		<published>2006-11-24T10:41:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68419#p68419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68419#p68419"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68419#p68419"><![CDATA[
Solved it  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br>a friend told me what to do:<br><blockquote class="uncited"><div>Well it's simple if you have the time already in unixtime format... that's the code to calculate the duration:<br><br><br>set addtime [unx2nps $timestamp]<br><br>becomes<br><br>set addtime [duration [expr {[unixtime] - $timestamp}]] <br><br>Well if "addtime" isn't used in other lines... otherwise just let this line as it is and instead of putting the result of "duration" in "addtime" variable define another variable.. like "addedsince"...and in the "PUTSERV" that sends the annouce to the user change "addtime" by "addedsince". </div></blockquote>But thanks for all the help, your time and ofcourse your patience, lol<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Fri Nov 24, 2006 10:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-24T06:56:29-04:00</updated>

		<published>2006-11-24T06:56:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68410#p68410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68410#p68410"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68410#p68410"><![CDATA[
Of course it's possible..I suggest you read the documentation.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Nov 24, 2006 6:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-24T06:40:39-04:00</updated>

		<published>2006-11-24T06:40:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68409#p68409</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68409#p68409"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68409#p68409"><![CDATA[
<blockquote class="uncited"><div>What and where does your script set as variables for month, day, year, hour minutes and seconds? That is what you need to use.</div></blockquote>Looks like the script doesnt got such variable. Is it possible to add them to the script? And what is the code?<br><br>Thanks again<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Fri Nov 24, 2006 6:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-23T21:03:05-04:00</updated>

		<published>2006-11-23T21:03:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68397#p68397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68397#p68397"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68397#p68397"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>[01:29] Tcl error in file 'eggdrop.conf':<br>[01:29] can't read "mm": no such variable<br>    while executing<br>"clock scan "$mm/$dd/$yy $hh:$mm:$ss""<br>    invoked from within<br>"set duetime [clock scan "$mm/$dd/$yy $hh:$mm:$ss"]"</div></blockquote>What and where does your script set as variables for month, day, year, hour minutes and seconds? That is what you need to use.</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Nov 23, 2006 9:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-11-23T20:51:05-04:00</updated>

		<published>2006-11-23T20:51:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68396#p68396</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68396#p68396"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68396#p68396"><![CDATA[
<blockquote class="uncited"><div>Code:<div class="codebox"><p>Code: </p><pre><code>set duetime [clock scan "mm/dd/yy hh:mm:ss"]set duration [duration [expr {$duetime - [unixtime]}]]</code></pre></div>Read about <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm#M45" class="postlink">clock scan</a>.</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Nov 23, 2006 8:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-23T20:36:58-04:00</updated>

		<published>2006-11-23T20:36:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68395#p68395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68395#p68395"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68395#p68395"><![CDATA[
<blockquote class="uncited"><div>[01:29] Tcl error in file 'eggdrop.conf':<br>[01:29] can't read "mm": no such variable<br>    while executing<br>"clock scan "$mm/$dd/$yy $hh:$mm:$ss""<br>    invoked from within<br>"set duetime [clock scan "$mm/$dd/$yy $hh:$mm:$ss"]"</div></blockquote>Thanks for your patience so far.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Thu Nov 23, 2006 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-23T20:09:08-04:00</updated>

		<published>2006-11-23T20:09:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68393#p68393</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68393#p68393"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68393#p68393"><![CDATA[
set duetime [clock scan "mm/dd/yy hh:mm:ss"] <br><br>[21:07] unable to convert date-time string "mm/dd/yy hh:mm:ss" <br><br>You are passing it the literal string "mm/dd/yy hh:mm:ss"  and NOT variables!  "$mm/$dd/$yy $hh:$mm:$ss"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Nov 23, 2006 8:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-23T19:59:08-04:00</updated>

		<published>2006-11-23T19:59:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68391#p68391</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68391#p68391"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68391#p68391"><![CDATA[
I found <a href="http://forum.egghelp.org/viewtopic.php?t=12507" class="postlink">http://forum.egghelp.org/viewtopic.php?t=12507</a><br><br>But I still dont get it  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> <br><br>Tried  few options, mm/dd/yy, day, dd monthname yy but still same error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Thu Nov 23, 2006 7:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-23T16:53:40-04:00</updated>

		<published>2006-11-23T16:53:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68372#p68372</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68372#p68372"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68372#p68372"><![CDATA[
Read the clock manpage, the scan command requires specific formats for the date, typically "mon day, year"  (note the comma)  I made a post around here somewhere that describes the exact formats, try doing a search for 'clock scan'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Nov 23, 2006 4:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-23T16:16:24-04:00</updated>

		<published>2006-11-23T16:16:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68371#p68371</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68371#p68371"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68371#p68371"><![CDATA[
I have change it into this this (think that id what you told) :<br><div class="codebox"><p>Code: </p><pre><code>set duetime [clock scan "mm/dd/yy hh:mm:ss"]set duration [duration [expr {[unixtime] - $duetime}]] </code></pre></div>Now when I start my bot, I get this error:<br><blockquote class="uncited"><div>[21:07] unable to convert date-time string "mm/dd/yy hh:mm:ss"<br>    while executing<br>"clock scan "mm/dd/yy hh:mm:ss""<br>    invoked from within<br>"set duetime [clock scan "mm/dd/yy hh:mm:ss"]"</div></blockquote>Any idea what is wrong?<br><br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Thu Nov 23, 2006 4:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-11-23T14:48:09-04:00</updated>

		<published>2006-11-23T14:48:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68367#p68367</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68367#p68367"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68367#p68367"><![CDATA[
read that topic: <a href="http://forum.egghelp.org/viewtopic.php?t=12721" class="postlink">http://forum.egghelp.org/viewtopic.php?t=12721</a><br>just switch places of the variable and [unixtime], since we want to know long it is ago instead of how long it will be <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=2382">De Kus</a> — Thu Nov 23, 2006 2:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pipo]]></name></author>
		<updated>2006-11-22T17:21:05-04:00</updated>

		<published>2006-11-22T17:21:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68345#p68345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68345#p68345"/>
		<title type="html"><![CDATA[convert time output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68345#p68345"><![CDATA[
Thanks for the help in my previous topic<br><br>When my script announce a requested nick it shows the time when the nick was added to the db.txt file. In the db.txt file it is saved with the unixtime.<br><br>like:<br><br>!search nick<br><br>announce: &lt;lastname&gt; &lt;frontname&gt; was added on &lt;addtime&gt;<br><br>Is it posible to add someting to the script, so it shows how long ago the nick was added to the db.txt file?<br><br>someting like:<br><br>!search nick<br><br>announce: &lt;lastname&gt; &lt;frontname&gt; was added on &lt;addtime&gt; that was &lt;## hours, ## minutes and ##&gt; sec ago.<br><br><br>I dont know much about .tcl scripting, but I found the following lines in the script, that may help(?) :<br><br>Addnick:<div class="codebox"><p>Code: </p><pre><code>set timestamp [check:stamp [lindex $arg 2]]  set rlstmp [lindex $arg 0]  if { $rlstmp == "" } { putserv "NOTICE $nick : USAGE\: !addnick LASTNAME FRONTNAME UNXTiME "; return 0 }</code></pre></div><br><br>annouce:<div class="codebox"><p>Code: </p><pre><code>set addtime [unx2nps $timestamp]</code></pre></div><div class="codebox"><p>Code: </p><pre><code>proc check:stamp { timestamp } { regsub -- {[nN][oO][wW]} $timestamp "" timestamp if { $timestamp == "" || $timestamp == "\-" } { return [unixtime] } else { return $timestamp}}proc unx2nps { timestamp } { if {[regexp "\[^\\d\]" $timestamp]} { error "unx2nps: parameter is not a valid unix timestamp" } if {$timestamp &gt; "2000000000"} { error "unx2nps: parameter is too large" } return [clock format $timestamp -format "%Y/%m/%d %H:%M:%S"]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8399">pipo</a> — Wed Nov 22, 2006 5:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
