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

	<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-12-26T14:40:02-04:00</updated>

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

		<entry>
		<author><name><![CDATA[hikaro]]></name></author>
		<updated>2004-12-26T14:40:02-04:00</updated>

		<published>2004-12-26T14:40:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44534#p44534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44534#p44534"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44534#p44534"><![CDATA[
ok i paste the load proc arcane...<br>here for the first one<div class="codebox"><p>Code: </p><pre><code>proc tmcquiz_rank_load {handle idx arg} {    global rankfile userlist timerankreset    global lastsolver lastsolvercount qnum_thisgame    global quizconf    variable timeranksaved [unixtime]    variable fd    variable line    variable us 0 sc 0 mask ""    ## clear old userlist (ranks)    foreach u [array names userlist] {unset userlist($u)    }    ## load saved scores    if {[file exists $rankfile] &amp;&amp; [file readable $rankfile]} {set fd [open $rankfile r]while {![eof $fd]} {    set line [gets $fd]    if {![regexp "#.*" $line]} {switch -regexp $line {    "^winscore: .+ *$" {scan $line "winscore: %d" quizconf(winscore)    }    "^rankreset: +[0-9]+ *$" {scan $line "rankreset: %d" timerankreset    }    "^lastsolver:" {scan $line "lastsolver: %s = %d" lastsolver lastsolvercount    }    "^ranksave:" {scan $line "ranksave: %d" timeranksaved    }    "^qnumber:" {scan $line "qnumber: %d" qnum_thisgame    }    default {scan $line "%d %d : %s at %s" started sc us maskset alist [list "mask" $mask "score" $sc "lastspoken" 0 "started" [expr $started + [unixtime] - $timeranksaved]]set userlist($us) $alist    }}    }}close $fdmxirc_dcc $idx "Ranks loaded ([llength [array names userlist]]), winscore = $quizconf(winscore), saved at unixtime $timeranksaved."mx_log "--- Ranks loaded ([llength [array names userlist]]), winscore = $quizconf(winscore), saved at unixtime $timeranksaved."    } else {mxirc_dcc $idx "Could not read \"$rankfile\"."mx_log "---- could not read \"$rankfile\"."    }    return 1}</code></pre></div>and this is second one<div class="codebox"><p>Code: </p><pre><code>proc read_KAOSScore { } {global KAOSScore KAOSScoreFileif [info exists KAOSScore] { unset KAOSScore }if {[file exists $KAOSScoreFile]} {  set f [open $KAOSScoreFile r]  while {[gets $f s] != -1} {    set KAOSScore([lindex $s 0]) [lindex $s 1]  }  close $f} {set f [open $KAOSScoreFile w]puts $f "Nobody 0"close $f}}</code></pre></div><br>thanks for your reply<br><br>merry xmas to you all!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4672">hikaro</a> — Sun Dec 26, 2004 2:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-12-26T09:14:35-04:00</updated>

		<published>2004-12-26T09:14:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44524#p44524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44524#p44524"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44524#p44524"><![CDATA[
well, you need to change at least both load and save procs.<br>if you want to store your scores like in the second one, you need to convert your variables into arrays as well.<br>you should post the load and save procs and for easier understanding maybe some excerpts from your saved score files.<br>i think it's unnecessary to know the whole script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Sun Dec 26, 2004 9:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hikaro]]></name></author>
		<updated>2004-12-23T09:59:36-04:00</updated>

		<published>2004-12-23T09:59:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44408#p44408</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44408#p44408"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44408#p44408"><![CDATA[
hmm i think the script too long...  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4672">hikaro</a> — Thu Dec 23, 2004 9:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2004-12-23T03:00:12-04:00</updated>

		<published>2004-12-23T03:00:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44401#p44401</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44401#p44401"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44401#p44401"><![CDATA[
or you could use the code tags<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Thu Dec 23, 2004 3:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hikaro]]></name></author>
		<updated>2004-12-22T21:48:04-04:00</updated>

		<published>2004-12-22T21:48:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44397#p44397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44397#p44397"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44397#p44397"><![CDATA[
i want both saved files to be compatible, so only need 1 score file there and 1 score (!Score command). if you can help and need tcl i can send you to ur mail the tcl because its big enough.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4672">hikaro</a> — Wed Dec 22, 2004 9:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-12-22T11:08:28-04:00</updated>

		<published>2004-12-22T11:08:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44377#p44377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44377#p44377"/>
		<title type="html"><![CDATA[Re: help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44377#p44377"><![CDATA[
<blockquote class="uncited"><div>is it possible to combine it? please help me... thank you before</div></blockquote>probably - but not with the amount of information given...<br>you want both saved files to be compatible? or just save the entries following the same pattern? or what?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Wed Dec 22, 2004 11:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hikaro]]></name></author>
		<updated>2004-12-21T10:59:46-04:00</updated>

		<published>2004-12-21T10:59:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44306#p44306</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44306#p44306"/>
		<title type="html"><![CDATA[help me combine tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44306#p44306"><![CDATA[
i got 2 games running in 1 bot but the score of both game cannot be saved together. anyone please help me combine it... i want the first script modify to second script.<br>here the first script<br><blockquote class="uncited"><div>proc tmcquiz_rank_save {handle idx arg} {<br>    global rankfile userlist<br>    global lastsolver lastsolvercount timerankreset<br>    global qnum_thisgame<br>    global quizconf<br>    variable fd<br><br>    ## save ranks<br>    if {[llength [array names userlist]] &gt; 0} {<br>set fd [open $rankfile w]<br>puts $fd "# rankings from $quizconf(quizchannel) at [ctime [unixtime]]."<br>puts $fd "winscore: $quizconf(winscore)"<br>puts $fd "rankreset: $timerankreset"<br>puts $fd "ranksave: [unixtime]"<br>puts $fd "qnumber: $qnum_thisgame"<br>if {$lastsolver != ""} {<br>    puts $fd "lastsolver: $lastsolver = $lastsolvercount"<br>}<br>foreach u [lsort -command mx_sortrank [array names userlist]] {<br>    array set aa $userlist($u)<br>    puts $fd [format "%d %d : %s at %s" $aa(started) $aa(score) $u $aa(mask)]<br>}<br>close $fd<br>mx_log "--- Ranks saved to \"$rankfile\"."<br>mxirc_dcc $idx "Ranks saved to \"$rankfile\"."<br>    } else {<br>mxirc_dcc $idx "Ranks are empty, nothing saved."<br>    }<br>    return 1<br>}</div></blockquote><br><br>and here the second one<blockquote class="uncited"><div>proc write_KAOSScore {} {<br>global KAOSScore KAOSScoreFile<br>set f [open $KAOSScoreFile w]<br>foreach s [lsort -decreasing -command sort_KAOSScore [array names KAOSScore]] {<br>puts $f "$s $KAOSScore($s)"<br>}<br>close $f<br>}</div></blockquote>is it possible to combine it? please help me... thank you before<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4672">hikaro</a> — Tue Dec 21, 2004 10:59 am</p><hr />
]]></content>
	</entry>
	</feed>
