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

	<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-10-19T17:13:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-19T17:13:21-04:00</updated>

		<published>2006-10-19T17:13:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67268#p67268</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67268#p67268"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67268#p67268"><![CDATA[
Thanks guys.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Thu Oct 19, 2006 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-19T07:47:12-04:00</updated>

		<published>2006-10-19T07:47:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67251#p67251</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67251#p67251"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67251#p67251"><![CDATA[
Could prolly catch the kill signal and make the bot do some stuff like closing files before shutting down. From the 'bind' commands:<br><br>    (42) EVNT (stackable)<br>         bind evnt &lt;flags&gt; &lt;type&gt; &lt;proc&gt;<br>         proc-name &lt;type&gt;<br><br>         Description: triggered whenever one of these events happen. flags<br>           are ignored; valid events are:<br>             sighup          - called on a kill -HUP &lt;pid&gt;<br>             sigterm         - called on a kill -TERM &lt;pid&gt;<br>             sigill          - called on a kill -ILL &lt;pid&gt;<br>             sigquit         - called on a kill -QUIT &lt;pid&gt;<br>             save            - called when the userfile is saved<br>             rehash          - called just after a rehash<br>             prerehash       - called just before a rehash<br>             prerestart      - called just before a restart<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Oct 19, 2006 7:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-10-19T03:30:42-04:00</updated>

		<published>2006-10-19T03:30:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67247#p67247</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67247#p67247"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67247#p67247"><![CDATA[
<blockquote class="uncited"><div>It's just a simple reboot... I'm thinking when I click restart in middle of someone winning a point and bot saving it at same time is maybe like improper shut down and deletes.</div></blockquote>I would suggest you properly have your bot 'die' (via DCC) before hitting that magic little Reboot button of Windows.<br><br>eggdrop just may flush everything and you may not loose data.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Oct 19, 2006 3:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-19T02:35:20-04:00</updated>

		<published>2006-10-19T02:35:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67246#p67246</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67246#p67246"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67246#p67246"><![CDATA[
It's just a simple reboot... I'm thinking when I click restart in middle of someone winning a point and bot saving it at same time is maybe like improper shut down and deletes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Thu Oct 19, 2006 2:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-19T01:50:00-04:00</updated>

		<published>2006-10-19T01:50:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67244#p67244</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67244#p67244"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67244#p67244"><![CDATA[
What platform is this on?  If it's windows, then yes likely it could still have the file cached at the time of the crash, and so the file is never saved to disk. I don't know if adding an explicit 'flush' cmd before the 'close' cmd would help in that situation.<br><br>A possible work around would be to write data to a tempfile, flush/close, then copy the tempfile overwriting the scorefile. But I suspect you'd still end up with the same problem, since the file is cached in memory before being written to disk. :/<br><br>Best to get yourself a stable platform (*bsd, linux, etc) and a UPS backup power supply so you're not experiencing crashes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Oct 19, 2006 1:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-18T20:04:38-04:00</updated>

		<published>2006-10-18T20:04:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67241#p67241</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67241#p67241"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67241#p67241"><![CDATA[
well it deletes the whole trivia.scores file of all 100+ players. heres some of code on how it saves... I use triviaplus from tcl archives.<br><div class="codebox"><p>Code: </p><pre><code>#  The full path to the file which tracks the scores. The account#  the bot runs on must have read &amp; write access to this file. If#  the file does not exist, it will be created when needed.set tgscf "scripts/trivia.scores"#read current scores from file, sort and store in variable.proc tggetscores {} {global tgscf tgscorestotal tgscores tgscoresbyname tgranksbyname tgranksbynumglobal tgrealnames tgscoresbyrankif {[file exists $tgscf]&amp;&amp;[file size $tgscf]&gt;2} {set _sfile [open $tgscf r]set tgscores [lsort -dict -decreasing [split [gets $_sfile]]]close $_sfileset tgscorestotal [llength $tgscores]} else {set tgscores ""set tgscorestotal 0}if {[info exists tgscoresbyname]} {unset tgscoresbyname}if {[info exists tgranksbyname]} {unset tgranksbyname}if {[info exists tgrealnames]} {unset tgrealnames}if {[info exists tgranksbynum]} {unset tgranksbynum}set i 0while {$i&lt;[llength $tgscores]} {set _item [lindex $tgscores $i]set _nick [lindex [split $_item ,] 2]set _lwrnick [lindex [split $_item ,] 3]set _score [lindex [split $_item ,] 0]set tgscoresbyname($_lwrnick) $_scoreset tgrealnames($_lwrnick) $_nickset tgranksbyname($_lwrnick) [expr $i+1]set tgranksbynum([expr $i+1]) $_lwrnickset tgscoresbyrank([expr $i+1]) $_scoreincr i}return}#increment someone's score.proc tgincrscore {who} {global tgscores tgscf tgpointsperanswer tgscorestotal tgscoresbynametggetscoresif {$tgscorestotal&gt;0} {set i 0if {![info exists tgscoresbyname([strlwr $who])]} {append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who] "}while {$i&lt;[llength $tgscores]} {set _item [lindex $tgscores $i]set _nick [lindex [split $_item ,] 2]set _time [lindex [split $_item ,] 1]set _score [lindex [split $_item ,] 0]if {[strlwr $who]==[strlwr $_nick]} {append _newscores "[expr $_score+$tgpointsperanswer],[expr 1000000000000.0/[unixtime]],$who,[strlwr $who][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"} else {append _newscores "$_score,$_time,$_nick,[strlwr $_nick][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"}incr i}} else {append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who]"}set _sfile [open $tgscf w]puts $_sfile "$_newscores"close $_sfilereturn}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Wed Oct 18, 2006 8:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-10-18T19:57:44-04:00</updated>

		<published>2006-10-18T19:57:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67240#p67240</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67240#p67240"/>
		<title type="html"><![CDATA[Re: Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67240#p67240"><![CDATA[
<blockquote class="uncited"><div>Sorry if I posted in wrong spot.. <br><br>sometimes when I reboot my computer or power goes out, some bots trivia files (scores) randomly delete... don't always happen... <br><br>anyone else ever had this problem?</div></blockquote>If these scores are being saved (via a timer) when the power outtage &amp;c happens then it is quite possible the relevant files will be deleted rather than saved. Might be an idea to keep backups.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Wed Oct 18, 2006 7:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-18T19:57:13-04:00</updated>

		<published>2006-10-18T19:57:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67239#p67239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67239#p67239"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67239#p67239"><![CDATA[
odd it works now, I tried to post in scripting help 1st place and I got the error 'only moderatrors can start a post here' but it works now.<br><br>so can anyone help with ideas on first post? thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Wed Oct 18, 2006 7:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-10-18T19:52:35-04:00</updated>

		<published>2006-10-18T19:52:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67238#p67238</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67238#p67238"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67238#p67238"><![CDATA[
<blockquote class="uncited"><div>I tried, said only moderators can post there.</div></blockquote>Tried what exactly?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Wed Oct 18, 2006 7:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-18T19:51:37-04:00</updated>

		<published>2006-10-18T19:51:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67237#p67237</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67237#p67237"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67237#p67237"><![CDATA[
I tried, said only moderators can post there.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Wed Oct 18, 2006 7:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-10-18T19:50:51-04:00</updated>

		<published>2006-10-18T19:50:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67236#p67236</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67236#p67236"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67236#p67236"><![CDATA[
Moved to: Scripting Help (for want of a better location)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Wed Oct 18, 2006 7:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cache]]></name></author>
		<updated>2006-10-18T19:19:05-04:00</updated>

		<published>2006-10-18T19:19:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67235#p67235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67235#p67235"/>
		<title type="html"><![CDATA[Trivia scores randomly delete on reboot..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67235#p67235"><![CDATA[
Sorry if I posted in wrong spot.. <br><br>sometimes when I reboot my computer or power goes out, some bots trivia files (scores) randomly delete... don't always happen... <br><br>anyone else ever had this problem?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7220">cache</a> — Wed Oct 18, 2006 7:19 pm</p><hr />
]]></content>
	</entry>
	</feed>
