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

	<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-02T16:33:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-02T16:33:37-04:00</updated>

		<published>2008-06-02T16:33:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83383#p83383</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83383#p83383"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83383#p83383"><![CDATA[
Again some problems..<br>I've tried 2-3 blowcrypt scripts from tcl-archive and google. And all return <blockquote class="uncited"><div>Tcl error [encryptedincominghandler]: can't read "display": no such variable</div></blockquote>the if-loop is like this:<div class="codebox"><p>Code: </p><pre><code>if {[lindex $count 0] == 0} {set display "0"}</code></pre></div>Why? tried to change the stuff inside "" but doesnt help much<br>Got told that it's not blowcrypt script. It's the if-loop. How?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Mon Jun 02, 2008 4:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-06-02T08:57:32-04:00</updated>

		<published>2008-06-02T08:57:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83374#p83374</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83374#p83374"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83374#p83374"><![CDATA[
Using the same "rules" as mentioned before, this should work as long as your query is proper.<div class="codebox"><p>Code: </p><pre><code>set count [mysqlsel $dbconnect "SELECT COUNT(*) FROM table WHERE user LIKE 'blah%' ORDER BY time DESC LIMIT 5" -flatlist]if {[lindex $count 0] == 0} {set user "No user found"}putserv "PRIVMSG $chan :User:$count"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 02, 2008 8:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-02T08:52:20-04:00</updated>

		<published>2008-06-02T08:52:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83373#p83373</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83373#p83373"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83373#p83373"><![CDATA[
is it possible to have a select query like this:<blockquote class="uncited"><div>set count [mysql $dbconnect "SELECT COUNT(*) FROM table WHERE user LIKE 'blah%' ORDER BY time DESC LIMIT 5" -flatlist]<br><strong class="text-strong">if {$count == 0} {set user "No user found"}</strong><br>putserv "PRIVMSG $chan :User:$count"</div></blockquote>How would this if-loop look like? i know that one wont work, thats why im asking here <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=9874">ztian299</a> — Mon Jun 02, 2008 8:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-01T18:12:02-04:00</updated>

		<published>2008-06-01T18:12:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83365#p83365</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83365#p83365"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83365#p83365"><![CDATA[
Really, didn't know that space was that important! thanks again speechles<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Sun Jun 01, 2008 6:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-01T18:05:32-04:00</updated>

		<published>2008-06-01T18:05:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83364#p83364</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83364#p83364"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83364#p83364"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[string match $chan "#blah"]}{set limit 5} </code></pre></div>!=<br><div class="codebox"><p>Code: </p><pre><code>if {[string match $chan "#somechannel"]} {set limit 5}</code></pre></div>Notice the spacing in mine.. this is there for a reason.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jun 01, 2008 6:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-01T18:03:29-04:00</updated>

		<published>2008-06-01T18:03:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83363#p83363</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83363#p83363"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83363#p83363"><![CDATA[
Hmm<div class="codebox"><p>Code: </p><pre><code>if {[string match $chan "#blah"]}{set limit 5}set search [mysqlsel $dbconnect "SELECT nick,fname,lname,info,time FROM table WHERE nick LIKE '$nick%' LIMIT $limit" -flatlist]</code></pre></div>Giving me this error AGAIN. Wondering why it should be that hard to make a little limit!<blockquote class="uncited"><div>Tcl error [pub:infouser] extra characters after close-brace</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Sun Jun 01, 2008 6:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-01T18:04:31-04:00</updated>

		<published>2008-06-01T18:00:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83362#p83362</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83362#p83362"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83362#p83362"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[string match $chan "#somechannel"]} { set limit 5 }</code></pre></div>You used parenthesis in place of curly braces, this should work better. You only really need to use "quotes" when encapsulating spaces or oddball characters into a single field.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jun 01, 2008 6:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-01T17:19:35-04:00</updated>

		<published>2008-06-01T17:19:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83361#p83361</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83361#p83361"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83361#p83361"><![CDATA[
Could i do something like this:<br>if ("$chan" == "#somechannel"){set limit "5"}<br>and then use $limit in the select query?<br>to be honest i have tried, but got "extra characters after close-quote" and "after close-brace" why's that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Sun Jun 01, 2008 5:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-06-01T17:09:00-04:00</updated>

		<published>2008-06-01T17:09:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83360#p83360</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83360#p83360"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83360#p83360"><![CDATA[
<blockquote class="uncited"><div>...<br>I expect being dutch you have some women of this kind you keep pampered. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"></div></blockquote>Lol, sorry to disappoint you, but I'm "the Swedish Guy" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Jun 01, 2008 5:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-06-01T17:05:57-04:00</updated>

		<published>2008-06-01T17:05:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83359#p83359</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83359#p83359"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83359#p83359"><![CDATA[
Well, as I illustrated in my post, either way works, just as long as you write the rest of your code properly...<br><br>The following is copied from the tclmysql manual, which should illustrate the difference between the two different options:<div class="codebox"><p>Code: </p><pre><code>% ::mysql::sel $db "SELECT ID, NAME FROM FRIENDS" -list{1 Joe} {2 Phil} {3 John}% ::mysql::sel $db "SELECT ID, NAME FROM FRIENDS" -flatlist{1 Joe 2 Phil 3 John}</code></pre></div>With -list, you get a tcl-list, where each list-item is itself a tcl-list representing one row - having one list item for each column.<br>Or, in other words, to select the data in row <em class="text-italics">x</em> column <em class="text-italics">y</em>, you would use "puts stdout [lindex [lindex $result <em class="text-italics">x</em>] <em class="text-italics">y</em>]"<br><br>With -flatlist however, you get a tcl-list where each list-items represents one datacell. As the name suggests, the list have been "flattened", where each datacell follows the previous one (making it ideal for "foreach {nick fname lname info time} {" kind of structures, which will extract 5 elements from the list on each run).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Jun 01, 2008 5:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-01T17:02:27-04:00</updated>

		<published>2008-06-01T17:02:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83358#p83358</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83358#p83358"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83358#p83358"><![CDATA[
<blockquote class="uncited"><div>speechles:<br>Not to be rude, but what have you been smoking tonight? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"></div></blockquote><a href="http://ereader.kiczek.com/little_girls.jpg" class="postlink">http://ereader.kiczek.com/little_girls.jpg</a><br><br>Only they aren't so little anymore, and have gone on to have children of their own. I expect being dutch you have some women of this kind you keep pampered. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jun 01, 2008 5:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-01T16:55:36-04:00</updated>

		<published>2008-06-01T16:55:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83357#p83357</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83357#p83357"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83357#p83357"><![CDATA[
nml375: I didn't do anything else than change -list to -flatlist and everything works?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> pretty impressive. Thanks, how can i know next time if i should use -flatlist or just -list?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Sun Jun 01, 2008 4:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-06-01T16:52:16-04:00</updated>

		<published>2008-06-01T16:52:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83356#p83356</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83356#p83356"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83356#p83356"><![CDATA[
@ztian299:<br>Your foreach-loop expects you to use -flatlist with mysqlsel rather than -list. Change that, and everything should work with some code posted way up.<br><div class="codebox"><p>Code: </p><pre><code>...set nick [lindex [split $text] 0]set search [mysqlsel $dbconnect "SELECT nick,fname,lname,info,time FROM table WHERE nick LIKE '$nick%' LIMIT 2" -flatlist]foreach {nick fname lname info time} $search {      putserv "PRIVMSG $chan :$nick - Firstname: $fname Lastname: $lname Info: $info - Added [duration [expr [clock seconds] - $time]] ago"}...</code></pre></div>Another option would be to modify your foreach-loop:<div class="codebox"><p>Code: </p><pre><code>...set nick [lindex [split $text] 0]set search [mysqlsel $dbconnect "SELECT nick,fname,lname,info,time FROM table WHERE nick LIKE '$nick%' LIMIT 2" -list]foreach {row} $search {      putserv "PRIVMSG $chan :[lindex $row 0] - Firstname: [lindex $row 1] Lastname: [lindex $row 2] Info: [lindex $row 3] - Added [duration [expr [clock seconds] - [lindex $row 4]]] ago"}...</code></pre></div>@speechles:<br>Not to be rude, but what have you been smoking tonight? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br><br>Edit: Fixed list index typo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Jun 01, 2008 4:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-01T16:46:26-04:00</updated>

		<published>2008-06-01T16:46:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83355#p83355</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83355#p83355"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83355#p83355"><![CDATA[
<blockquote class="uncited"><div>I'm trying to make TCL calculate the time between the specific unixtime and the time that is right NOW. and then make a output like:<br>'4weeks 3days 2hours 1minute'<br>but as i see. It should not be easy!</div></blockquote><div class="codebox"><p>Code: </p><pre><code>set time [unixtime]putserv "PRIVMSG $chan :[duration [expr [clock seconds] - $time]]"</code></pre></div>can you tell me what the output of this would be? Let's say the actual time it is now, is 13200 in seconds (it isn't we just say this). Now the first line is 'set time 13200'. Now in the message we take the difference betweeen clock seconds and 13200. Clock seconds will return the exact number of elapsed seconds at that moment, perhaps since its running after we set time, this is 13201. Now you have it take 13201-13200, and you get 1 second.<br><br>You fail to understand this. Unless you have a starting point in time, to subtract from your current time. You cannot do what you want.<br><br>[unixtime] == [clock seconds] == time it is right now<br><br>If you simply want to adjust for timezones, use clock format and within it an expr to subtract/add hours accordingly.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Jun 01, 2008 4:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ztian299]]></name></author>
		<updated>2008-06-01T16:42:22-04:00</updated>

		<published>2008-06-01T16:42:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83354#p83354</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83354#p83354"/>
		<title type="html"><![CDATA[convert unixtime into human readable time[SOLVED]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83354#p83354"><![CDATA[
I'm trying to make TCL calculate the time between the specific unixtime and the time that is right NOW. and then make a output like:<br>'4weeks 3days 2hours 1minute'<br>but as i see. It should not be easy!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9874">ztian299</a> — Sun Jun 01, 2008 4:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
