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

	<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>2004-02-02T05:25:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-02T05:25:12-04:00</updated>

		<published>2004-02-02T05:25:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33174#p33174</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33174#p33174"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33174#p33174"><![CDATA[
I just copied and pasted the above script into the bot, and my half-hour message said the time of the previous top of the hour (said 6:00ET when should have been 6:30)<br><br>Just to confirm I have hourly and half hourly msgs...<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Mon Feb 02, 2004 5:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2004-02-02T05:04:09-04:00</updated>

		<published>2004-02-02T05:04:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33173#p33173</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33173#p33173"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33173#p33173"><![CDATA[
NewzBoy.<br><br>The code strikelight posted should and does work.<br><br>It is a well known workaround to other problems related to the time bind.<br><br>You apear to be using the time bind, and it would also apear you are failing to post the whole of your put:hour code.<br><br>How do we know this?<br><br>Because of this line.<div class="codebox"><p>Code: </p><pre><code>bind time - "00 * * * *" put:hour </code></pre></div>This would run once and hour on the hour. However, you have been sugesting that your code runs at 08:30. Which is pretty must 1/2 an hour too late (or early).<br><br>Another note, you should be quoting your string in full if your are returning more than one thing. Keeps things safe.<br><div class="codebox"><p>Code: </p><pre><code>return "${time_ret}:${therest}"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Feb 02, 2004 5:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-02-02T04:58:36-04:00</updated>

		<published>2004-02-02T04:58:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33172#p33172</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33172#p33172"/>
		<title type="html"><![CDATA[why do all that weird stuff?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33172#p33172"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc gettime {{offset 0}} {clock format [expr {[clock seconds]+($offset*3600)}] -format %H:%M}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Feb 02, 2004 4:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-01T20:46:11-04:00</updated>

		<published>2004-02-01T20:46:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33166#p33166</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33166#p33166"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33166#p33166"><![CDATA[
Here are the facts... what you were told, works....<div class="codebox"><p>Code: </p><pre><code>% proc gettime { offset } { set hour [string trimleft [clock format 1075708800 -format "%H"] 0]set therest [clock format 1075708800 -format "%M"] set time_ret [expr $hour + $offset] if {$time_ret &gt; 23} { set time_ret [expr $time_ret - 24] } if {$time_ret &lt; 0} { set time_ret [expr $time_ret + 24] } return $time_ret:$therest } % gettime -189:00% gettime -1314:00%(note: 1075708800 is 08:00 GMT as per your description of where the error occurs)</code></pre></div>So there are the facts.. the conclusion: you didn't do what you were told, thus you didn't want help from the get go.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Feb 01, 2004 8:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-01T20:15:46-04:00</updated>

		<published>2004-02-01T20:15:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33164#p33164</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33164#p33164"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33164#p33164"><![CDATA[
LOL I did do what you suggested - why would I not if I was seeking to solve my problem? The reason I didn't post the error again is because it was exactly the same as before so there was no need to 'prove' anything.<br><br>Your help did not fix the problem - and now I've just seen it produces the error more than it did before, so your code failed and made the problem worse. So have reverted back to original version.<br><br>No pride here - just the facts!<br><br>There's no need to act all superior to those of us who are't scripting experts - this is supposed to be a 'help' forum - not to use your knowledge (questionable in this case) to try to make others feel stupid.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sun Feb 01, 2004 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-01T18:34:50-04:00</updated>

		<published>2004-02-01T18:34:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33162#p33162</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33162#p33162"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33162#p33162"><![CDATA[
If you had done what you said you had done, you would have nothing to hide.  But apparently, you are too proud to admit you faltered in doing something you said, when you didn't.  That is what anyone can conclude, from the lack of information provided on your behalf.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Feb 01, 2004 6:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-01T18:25:54-04:00</updated>

		<published>2004-02-01T18:25:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33161#p33161</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33161#p33161"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33161#p33161"><![CDATA[
excuse me - 'prove it'?<br><br>I said I did it, and it didn't work.<br><br>I don't need it that badly that I'll put up with some kind of arrogant inquisition.<br><br>Thanks anyway.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sun Feb 01, 2004 6:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-01T18:17:36-04:00</updated>

		<published>2004-02-01T18:17:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33160#p33160</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33160#p33160"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33160#p33160"><![CDATA[
Prove you have done what you said, by both showing your newly altered code, and also issue a '.tcl set errorInfo' on your partyline, after the error is generated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Feb 01, 2004 6:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-01T18:11:20-04:00</updated>

		<published>2004-02-01T18:11:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33159#p33159</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33159#p33159"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33159#p33159"><![CDATA[
yes I did - and it still gives the error.<br><br>oh well - looks like it's in the too hard basket!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sun Feb 01, 2004 6:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-01T14:24:23-04:00</updated>

		<published>2004-02-01T14:24:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33142#p33142</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33142#p33142"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33142#p33142"><![CDATA[
Welp, then you didn't change your "set hour" line in your gettime proc, with the one involving the "string trimleft" that I gave you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Feb 01, 2004 2:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-01T04:26:25-04:00</updated>

		<published>2004-02-01T04:26:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33124#p33124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33124#p33124"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33124#p33124"><![CDATA[
This is one of them - it runs the BBC News script. There's another one I have called put:half (for a half hourly message) which just sends a message to the channel and this also gets the error message.<br><br>bind time - "00 * * * *" put:hour<br>proc put:hour { min hour day month year } {<br>putserv "PRIVMSG #NewsRoom :12,12 0,4 &gt;Newsroom LIVE 7,7 0,12 World Headlines @ [gettime -18]ET / [gettime -13]GMT "<br>bbc:parse "<a href="http://news.bbc.co.uk/2/low.html" class="postlink">http://news.bbc.co.uk/2/low.html</a>" 1 #NewsRoom #NewsRoom<br>}<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sun Feb 01, 2004 4:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-02-01T04:21:18-04:00</updated>

		<published>2004-02-01T04:21:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33123#p33123</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33123#p33123"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33123#p33123"><![CDATA[
When I looked at the code you pasted, I had (incorrectly) assumed you has pasted the corresponding code related to the error.  However, I was in error.  You have not shown us the put:hour procedure.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Feb 01, 2004 4:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-02-01T04:03:05-04:00</updated>

		<published>2004-02-01T04:03:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33122#p33122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33122#p33122"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33122#p33122"><![CDATA[
thanks strikelight - I made those changes, but unfortunatly 08:00 GMT just came and went and I got the same error:<br><br>[08:00] Tcl error [put:hour]: expected integer but got "08" (looks like invalid octal number)<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sun Feb 01, 2004 4:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-31T13:44:22-04:00</updated>

		<published>2004-01-31T13:44:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33110#p33110</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33110#p33110"/>
		<title type="html"><![CDATA[Re: gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33110#p33110"><![CDATA[
<blockquote class="uncited"><div>Hi there<br><br>I have this proc which I use in a couple of scripts to display the time in various timezones by inserting:<br><br>[gettime -5] <br>for example for USET. However at a few times in the day I get this error, and the message is not displayed:<br><br>[09:00] Tcl error [put:hour]: expected integer but got "09" (looks like invalid octal number)<br><br>The proc is:<br><br>proc gettime { offset } { <br>set hour [clock format [clock seconds] -format "%H"] <br>set therest [clock format [clock seconds] -format "%M"] <br>set time_ret [expr $hour + $offset] <br>if {[expr $time_ret &gt; 23]} { set time_ret [expr $time_ret - 24] } <br>if {[expr $time_ret &lt; 0]} { set time_ret [expr $time_ret + 24] } <br>return $time_ret:$therest <br>} <br><br>It works mostly, but at 08:00 08:30 09:00 and 21:00 GMT it seems to produce this error.<br><br>If anyone can spot anything wrong or other help I'd appreciate it...</div></blockquote><div class="codebox"><p>Code: </p><pre><code>set hour [string trimleft [clock format [clock seconds] -format "%H"] 0]</code></pre></div>Also, you don't need to add command substitution to evaluate the range of time_ret ...<br><br>ie.<div class="codebox"><p>Code: </p><pre><code>if {$time_ret &gt; 23} { ... }andif {$time_ret &lt; 0} { ...}</code></pre></div>will suffice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sat Jan 31, 2004 1:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NewzUK]]></name></author>
		<updated>2004-01-31T05:31:09-04:00</updated>

		<published>2004-01-31T05:31:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33102#p33102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33102#p33102"/>
		<title type="html"><![CDATA[gettime error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33102#p33102"><![CDATA[
Hi there<br><br>I have this proc which I use in a couple of scripts to display the time in various timezones by inserting:<br><br>[gettime -5] <br>for example for USET. However at a few times in the day I get this error, and the message is not displayed:<br><br>[09:00] Tcl error [put:hour]: expected integer but got "09" (looks like invalid octal number)<br><br>The proc is:<br><br>proc gettime { offset } { <br>set hour [clock format [clock seconds] -format "%H"] <br>set therest [clock format [clock seconds] -format "%M"] <br>set time_ret [expr $hour + $offset] <br>if {[expr $time_ret &gt; 23]} { set time_ret [expr $time_ret - 24] } <br>if {[expr $time_ret &lt; 0]} { set time_ret [expr $time_ret + 24] } <br>return $time_ret:$therest <br>} <br><br>It works mostly, but at 08:00 08:30 09:00 and 21:00 GMT it seems to produce this error.<br><br>If anyone can spot anything wrong or other help I'd appreciate it...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2210">NewzUK</a> — Sat Jan 31, 2004 5:31 am</p><hr />
]]></content>
	</entry>
	</feed>
