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

	<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>2005-03-17T09:42:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-03-17T09:42:52-04:00</updated>

		<published>2005-03-17T09:42:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47787#p47787</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47787#p47787"/>
		<title type="html"><![CDATA[trivia TCL problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47787#p47787"><![CDATA[
Take a look <a href="http://www.peterre.com/characters.html" class="postlink">here</a>.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Mar 17, 2005 9:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mindflow]]></name></author>
		<updated>2005-03-16T14:49:11-04:00</updated>

		<published>2005-03-16T14:49:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47764#p47764</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47764#p47764"/>
		<title type="html"><![CDATA[trivia TCL problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47764#p47764"><![CDATA[
the problem is that when somone with the signs [ ] in ther nick answer i question, then the bot just add him over and over again, and i dont know how to solve this, it looks like: <br><br>« @bot » Show 'em how it's done [tag]nick! The answer was JAMIE LEE CURTIS.<br>« @bot » The scores: [tag]nick 6, [tag]nick 5, [tag]nick 4, another_nick 3, [tag]nick 3, [tag]nick 2, another_nick 1, [tag]nick 1<br><br>the [tag]nick is the same person, but he get added for every right ansewer he say. and he get a new "add" after every right answered question, somone that know how to solve it?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"> <br><br><br>this is the part of the code that create the problem "i guess"<br><div class="codebox"><p>Code: </p><pre><code>#triggered when someone says the correct answer.proc tgcorrectanswer {nick host hand chan text} { global tgcurrentanswer tghinttimer tgtimenext tgchan tgnexttimer tgstreak tgstreakmin global tgscoresbyname tgranksbyname tgranksbynum tgcongrats tgscorestotal tgmissed tggetscores if {![info exists tgranksbyname($nick)]} {  set _oldrank 0 } else {  set _oldrank [lindex [split $tgranksbyname($nick) ,] 0] } tgincrscore $nick tggetscores set _newrank [lindex [split $tgranksbyname($nick) ,] 0] set _msg "\00306[lindex $tgcongrats [rand [llength $tgcongrats]]] \00304$nick\00306! The answer was \00304[strupr $tgcurrentanswer]\00306." if {$_newrank&lt;$_oldrank} {  if {$_newrank==1} {   append _msg " You are now in first place!"  } else {   append _msg " You are now ranked \00304[tgnumsuf [lindex [split $tgranksbyname($nick) ,] 0]]\00306 of \00304$tgscorestotal\00306, behind \00304[lindex [split $tgranksbynum([expr $_newrank-1]) ,] 0]\00306 with \00304[lindex [split $tgranksbynum([expr $_newrank-1]) ,] 1]\00306."  } } tggamemsg "$_msg" if {$tgstreak!=0} {  if {[lindex [split $tgstreak ,] 0]==$nick} {   set tgstreak $nick,[expr [lindex [split $tgstreak ,] 1]+1]   if {$tgstreakmin&gt;0&amp;&amp;[lindex [split $tgstreak ,] 1]&gt;=$tgstreakmin} {    tggamemsg "\00312$nick is on a winning streak! [lindex [split $tgstreak ,] 1] in a row so far!"   }  } else {   if {$tgstreakmin&gt;0&amp;&amp;[lindex [split $tgstreak ,] 1]&gt;=$tgstreakmin} { tgstreakend }   set tgstreak $nick,1  } } else {  set tgstreak $nick,1 } set tgmissed 0 tgshowscores unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer killutimer $tghinttimer set tgnexttimer [utimer $tgtimenext tgnext] return 1}#read current scores from file, sort and store in variable.proc tggetscores {} { global tgscf tgscorestotal tgscores tgscoresbyname tgranksbyname tgranksbynum if {[file exists $tgscf]&amp;&amp;[file size $tgscf]&gt;2} {  set _sfile [open $tgscf r]  set tgscores [lsort -dict -decreasing [split [gets $_sfile] " "]]  close $_sfile  set tgscorestotal [llength $tgscores] } else {  set tgscores ""  set tgscorestotal 0 } if {[info exists tgscoresbyname]} {unset tgscoresbyname} if {[info exists tgranksbyname]} {unset tgranksbyname} if {[info exists tgranksbynum]} {unset tgranksbynum} set i 0 while {$i&lt;[llength $tgscores]} {  set _item [lindex $tgscores $i]  set _nick [lindex [split $_item ,] 2]  set _score [lindex [split $_item ,] 0]  set tgscoresbyname($_nick) $_score  set tgranksbyname($_nick) [expr $i+1],$_score  set tgranksbynum([expr $i+1]) $_nick,$_score  incr i } return}#increment someone's score.proc tgincrscore {who} { global tgscores tgscf tgpointsperanswer tgscorestotal tggetscores if {$tgscorestotal&gt;0} {  set i 0  if {[lsearch $tgscores "*,*,$who"]==-1} {   append _newscores "1,[expr 1000000000000.0/[unixtime]],$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[expr [expr [llength $tgscores]-$i]==1?"":"\ "]"   } else {    append _newscores "$_score,$_time,$_nick[expr [expr [llength $tgscores]-$i]==1?"":"\ "]"   }   incr i  } } else {  append _newscores "1,[expr 1000000000000.0/[unixtime]],$who" } set _sfile [open $tgscf w] puts $_sfile "$_newscores" close $_sfile return}#shows the current scores on channel.proc tgshowscores {} { global tgscores tgchan tgscorestotal tggetscores set i 0 while {$i&lt;[llength $tgscores]} {  set _item [lindex $tgscores $i]  set _nick [lindex [split $_item ,] 2]  set _score [lindex [split $_item ,] 0]  if {$i==0} {   append _scores "\00304$_nick $_score"  } elseif {$i==1} {   append _scores ", \00303$_nick $_score"  } elseif {$i==2} {   append _scores ", \00312$_nick $_score"  } elseif {[onchan $_nick $tgchan]} {   append _scores ", \00306$_nick $_score"  }  incr i } tggamemsg "\00306The scores: $_scores"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6052">mindflow</a> — Wed Mar 16, 2005 2:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
