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

	<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>2012-06-22T12:00:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-06-22T12:00:06-04:00</updated>

		<published>2012-06-22T12:00:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99620#p99620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99620#p99620"/>
		<title type="html"><![CDATA[Trivia with no Errors:)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99620#p99620"><![CDATA[
Try BogusTrivia for a trivia game with no errors.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Jun 22, 2012 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Gbot]]></name></author>
		<updated>2012-05-13T06:41:40-04:00</updated>

		<published>2012-05-13T06:41:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99400#p99400</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99400#p99400"/>
		<title type="html"><![CDATA[random limit must be greater than zero]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99400#p99400"><![CDATA[
Hi Guys,<br><br>In my trivia bot, I am receiving this error which makes trivia bot to go quiet in between questions. This happens intermittently. Below is the detail on the error I have found while doing set errorinfo<br><br>Thanks in advance,<br>gBot<br><br>Details:<blockquote class="uncited"><div>random limit must be greater than zero<br>Currently:     while executing<br>Currently: "rand [strlen $_word]"<br>Currently:     (procedure "tghint" line 79)<br>Currently:     invoked from within<br>Currently: "tghint"</div></blockquote>Method:<div class="codebox"><p>Code: </p><pre><code>#shows timed hints.proc tghint {} { global tgmaxhint tghintnum tgcurrentanswer tghinttimer tgchan global tgtimehint tghintchar tgquestionnumber tgquestionstotal global tgcurrentquestion tghintcharsused tgnextqtimer tgtimenext tgstreak tgstreakmin global tgnobodygotit tgtrythenextone tgmissed tgmaxmissed tgcmdstart tgshowanswer global tgtimestart tgtimeanswer tgalwaysshowq tgmaxhintcurrent tgtempnohint tgcapshint if {[catch {incr tghintnum}]!=0} {  set tghintnum 0  regsub -all -- "\[^A-Za-z0-9\]" [string trim $tgcurrentanswer] "" _hintchars  set tgmaxhintcurrent [expr [strlen $_hintchars]&lt;=$tgmaxhint?[expr [strlen $_hintchars]-1]:$tgmaxhint]  catch {tgunbindhintcmd}  if {$tgmaxhintcurrent&gt;0} {   set tgrebindhinttimer [utimer $tgtempnohint tgbindhintcmd]  } } if {$tghintnum &gt;= [expr $tgmaxhintcurrent+1]} {  incr tgmissed  set _msg ""  append _msg "[tgcolmiss][lindex $tgnobodygotit [rand [llength $tgnobodygotit]]]"  if {$tgshowanswer==1} {   append _msg " The answer was [tgcolmisc2]$tgcurrentanswer[tgcolmiss]."  }  if {$tgmaxmissed&gt;0&amp;&amp;$tgmissed&gt;=$tgmaxmissed} {   append _msg " That's $tgmissed questions gone by unanswered! The game is now automatically disabled. To start the game again, type $tgcmdstart"   tgquietstop  } else {   append _msg " [lindex $tgtrythenextone [rand [llength $tgtrythenextone]]]"  }  tggamemsg "[tgcolmiss]$_msg"  if {$tgstreakmin&gt;0&amp;&amp;[lindex [split $tgstreak ,] 1]&gt;=$tgstreakmin} { tgstreakend }  set tgstreak 0  catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}  if {$tgmaxmissed==0||$tgmissed&lt;$tgmaxmissed} {   set tgnextqtimer [utimer $tgtimenext tgnextq]  }  return } elseif {$tghintnum == 0} {  set i 0  set _hint {}  set tghintcharsused {}  foreach word [split $tgcurrentanswer] {   regsub -all -- "\[A-Za-z0-9\]" $word $tghintchar _current   lappend _hint $_current  }  if {$tgtimeanswer==1} {   set tgtimestart [clock clicks -milliseconds]  } } elseif {$tghintnum == 1} {  set i 0  set _hint {}  while {$i&lt;[llength [split $tgcurrentanswer]]} {   set _word [lindex [split $tgcurrentanswer] $i]   set j 0   set _newword {}   while {$j&lt;[strlen $_word]} {    if {$j==0} {     append _newword [stridx $_word $j]     lappend tghintcharsused $i,$j    } else {     if {[string is alnum [stridx $_word $j]]} {      append _newword $tghintchar     } else {      append _newword [stridx $_word $j]      lappend tghintcharsused $i,$j     }    }    incr j   }   lappend _hint $_newword   incr i  }  } else {   set i 0   set _hint {}   while {$i&lt;[llength [split $tgcurrentanswer]]} {    set _word [lindex [split $tgcurrentanswer] $i]    set j 0    set _newword {}    set _selected [rand [strlen $_word]]    regsub -all -- "\[^A-Za-z0-9\]" $_word "" _wordalnum    if {[strlen $_wordalnum]&gt;=$tghintnum} {     while {[lsearch $tghintcharsused $i,$_selected]!=-1||[string is alnum [stridx $_word $_selected]]==0} {      set _selected [rand [strlen $_word]]     }    }    lappend tghintcharsused $i,$_selected    while {$j&lt;[strlen $_word]} {     if {[lsearch $tghintcharsused $i,$j]!=-1||[string is alnum [stridx $_word $j]]==0} {      append _newword [stridx $_word $j]     } else {      if {[string is alnum [stridx $_word $j]]} {       append _newword $tghintchar      }    }    incr j   }   lappend _hint $_newword   incr i  } } if {$tgcapshint==1} {  set _hint [strupr $_hint] }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11996">Gbot</a> — Sun May 13, 2012 6:41 am</p><hr />
]]></content>
	</entry>
	</feed>
