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

	<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>2009-05-08T09:20:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-05-08T09:20:22-04:00</updated>

		<published>2009-05-08T09:20:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88700#p88700</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88700#p88700"/>
		<title type="html"><![CDATA[expected integer but got &quot;08&quot; (looks like invalid]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88700#p88700"><![CDATA[
The problem is that you are using %H, %M and %S when retrieving the hour, minute, and second. These will always output 2 digits, 0-padding if needed.<br>At the same time, any number starting with 0 is considered being an octal number (base 8 contrary to base 10 in the decimal number system). Being base 8, "octals" 08 and 09 are considered invalid.<br><br>That said, seems to me you are simply calculating time differences in seconds, so why don't you just use unixtime timestamps all together instead? Saves you a lot of maths...<br><br>I'm having slight issues following your maths, but I believe what you're trying to do is pretty much this:<div class="codebox"><p>Code: </p><pre><code>set timestamp [clock seconds]proc salvar {nick host handle channel rest} { global topico shard news am statTS statMAP timestamp set diff [expr {([clock seconds] - $timestamp) % 84600}] set timestamp [clock seconds] putserv "TOPIC $channel :... Save: [clock format $diff -format "%H"] ..." }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri May 08, 2009 9:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hmetall]]></name></author>
		<updated>2009-05-08T08:49:57-04:00</updated>

		<published>2009-05-08T08:49:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88699#p88699</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88699#p88699"/>
		<title type="html"><![CDATA[expected integer but got &quot;08&quot; (looks like invalid ]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88699#p88699"><![CDATA[
Good morning to All.  <br>  <br>He/she/you would like to know how to solve this problem:  <br><strong class="text-strong">expected integer but got " 08 " (looks like invalid octal number)  </strong><br>  <br>This is a script that calculates time hour of the last command   <br>given in the channel.  <br>Plus when it arrives some mainly schedule 08, 09 him of the   <br>this mistake <strong class="text-strong">expected integer but got " 08 " (looks like invalid octal number)  </strong><br>  <br>Part of the Code is this:<br><div class="codebox"><p>Code: </p><pre><code>set horaam "00"set minam "00"set segam "00"set am "$horaam:$minam:$segam"set horasave "00"set minsave "00"set segsave "00"set saves "$horasave:$minsave:$segsave"proc salvar {nick uhost hand chan rest} {  global topico  global shard  global news  global am  global saves  global horasave  global minsave  global segsave  global statTS  global statMAP  set horaant "$horasave"  set minant "$minsave"  set segant "$segsave"  set horasave "[strftime %H]"  set minsave "[strftime %M]"  set segsave "[strftime %S]"  set saves "$horasave:$minsave:$segsave"  set math "((($horasave * 60) * 60) + ($minsave * 60) + $segsave ) -  ((($horaant * 60) * 60) + ($minant * 60) + $segant)"  set amaux [expr $math]  if {$amaux &lt; 0} {    set math "((($horasave * 60) * 60) + ($minsave * 60) + $segsave ) + (84600 - ((($horaant * 60) * 60) + ($minant * 60) + $segant))"    set amaux [expr $math]  }  set math "(($amaux / 60) / 60)"  set horaant [expr $math]  set math "$amaux - (($horaant * 60) * 60)"  set amaux [expr $math]  set math "$amaux / 60"  set minant [expr $math]  set math "$amaux - ($minant * 60)"  set segant [expr $math]  set mensagem "^C7,1JÃ¡ se passaram^C9,1 $horaant ^C7,1hora(s)^C9,1 $minant ^C7,1minutos e^C9,1 $segant ^C7,1segundos desde o Ãºltimo save!"#  putchan $chan $mensagem  puthelp "PRIVMSG $chan :$mensagem"  putserv "TOPIC $chan :^B^_^C4,1\[^_^B^C4,1^BE^B^C0,1mpires ^C4,1^BB^B^C0,1lasters^B^_^C4,1\]^_^B ^B^_\[^_^B^C7,1Shard:^C9,1 $shard ^C4,1^B^_\]^_^B ^B^_\[^_^B^C7,1TS:^C9,1 $statTS ^C4,1^B^_\]^_^B ^B^_\[^_^B^C7,1MAP:^C9,1 $statMAP ^C4,1^B^_\]^_^B ^B^_\[^_^B^C8,1 $topico ^C4,1^B^_\]^_^B ^B^_\[^_^B^C7,1AM:^C9,1 $am ^C4,1^B^_\]^_^B ^B^_\[^_^B^C7,1Save:^C9,1 $saves ^C4,1^B^_\]^_^B ^B^_\[^_^B^C7,1News:^C11,1 $news ^C4,1^B^_\]^O"  putlog "\002\[Mv\]\002 &lt;&lt;$nick&gt;&gt; !$hand! topic $rest"return 1}</code></pre></div>then when I execute the command for instance the:  <br>08:10:00 or 09:00:00 if he/she has 09 08 in any to call   <br>he doesn't print, more he/she makes him/it I calculate everything it carries the variable   <br>more in the hour of printing of giving the topic and the putserv he/she doesn't do  <br>anything. and of the the mistake in the bot  <br><strong class="text-strong">expected integer but got " 08 " (looks like invalid octal number)</strong><br><br>If somebody can me to help I am I thank.  <br>At once I Thank.  <br>  <br>He/she/you excuses English I used a translator.  <br>  <br>Thank you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10642">hmetall</a> — Fri May 08, 2009 8:49 am</p><hr />
]]></content>
	</entry>
	</feed>
