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

	<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>2003-09-21T16:41:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-21T16:41:13-04:00</updated>

		<published>2003-09-21T16:41:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27403#p27403</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27403#p27403"/>
		<title type="html"><![CDATA[Random Hint]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27403#p27403"><![CDATA[
Ok, here's an updated version of the script:<div class="codebox"><p>Code: </p><pre><code>#gives a hint if there is currently a question to answer.proc tgforcehint {nick host hand chan text} { global tghinttimer tgnextqtimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin global tgtempnohint tgmaxhintcurrent tghintnum tgrebindhinttimer tgtempnohint if {[strlwr $tgchan]==[strlwr $chan]} {  if {$tgplaying==1&amp;&amp;[utimerexists tghint]!=""} {   killutimer $tghinttimer   tghint   tgunbindhintcmd   if {$tghintnum&lt;$tgmaxhintcurrent} {    set tgrebindhinttimer [utimer $tgtempnohint tgbindhintcmd]   }  } }}#shows timed hintsproc 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] } tggamemsg "[tgcolqhead]===== Question [expr $tgquestionnumber+1]/$tgquestionstotal [expr $tghintnum?"(Hint $tghintnum/$tgmaxhintcurrent)":""] =====" if {$tgalwaysshowq==1||$tghintnum==0} {  tggamemsg "[tgcolqbody]$tgcurrentquestion" } tggamemsg "[tgcolhint]Hint: [join $_hint]" set tghinttimer [utimer $tgtimehint tghint]}</code></pre></div>it only gives 1 letter of the answer as a hint (each hint, they're three)<br>I want it to give atleast 2 letters on each hint, can anyone help ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Sep 21, 2003 4:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-18T17:24:01-04:00</updated>

		<published>2003-09-18T17:24:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27272#p27272</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27272#p27272"/>
		<title type="html"><![CDATA[Random Hint]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27272#p27272"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>    set _selected 0     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} {       incr _selected      }</code></pre></div>this give a 1 letter hint on each hint, would there be a way to let it give 2 letters on each hint ?<br><br>like instead of <strong class="text-strong">Hint1: H___ O__</strong> it should give <strong class="text-strong">Hint1: HI__ ON_</strong> (HINT ONE is the word <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Sep 18, 2003 5:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-17T17:39:00-04:00</updated>

		<published>2003-09-17T17:39:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27220#p27220</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27220#p27220"/>
		<title type="html"><![CDATA[Random Hint]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27220#p27220"><![CDATA[
ok good <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> now it shows the frist letter on each line.<br>for example, hint: O__ L_____ , then next hing ON_ LE____, then third hint: ONE LET___ <br>is there a way to make some kind of percentage of showing letters from the answer ? like instead of one letter each hint, making it give according to the length of the answer ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Sep 17, 2003 5:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-09-15T18:48:41-04:00</updated>

		<published>2003-09-15T18:48:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27113#p27113</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27113#p27113"/>
		<title type="html"><![CDATA[Random Hint]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27113#p27113"><![CDATA[
I can't be sure as there is way too much fluff in that code, but<br>I'd recommend try changing:<br><div class="codebox"><p>Code: </p><pre><code>    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]]      } </code></pre></div>To the following:<div class="codebox"><p>Code: </p><pre><code>    set _selected 0     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} {      incr _selected     } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Sep 15, 2003 6:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-15T16:34:26-04:00</updated>

		<published>2003-09-15T16:34:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27109#p27109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27109#p27109"/>
		<title type="html"><![CDATA[Random Hint]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27109#p27109"><![CDATA[
<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 tgnexttimer tgtimenext tgstreak tgstreakmin global tgnobodygotit tgtrythenextone tgmissed tgmaxmissed tgcmdstart if {[catch {incr tghintnum}]!=0} {set tghintnum 0} if {$tghintnum &gt;= [expr $tgmaxhint+1]} {  incr tgmissed  set _msg ""  append _msg "\00310[lindex $tgnobodygotit [rand [llength $tgnobodygotit]]]"  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 "$_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 tgnexttimer [utimer $tgtimenext tgnext]  }  return } elseif {$tghintnum == 0} {  set i 0  set _hint {}  set tghintcharsused {}  regsub -all -- "\[A-Za-z0-9\]" $tgcurrentanswer $tghintchar _hint } 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  } } tggamemsg "\00304===== Question [expr $tgquestionnumber+1]/$tgquestionstotal [expr $tghintnum?"(Hint $tghintnum/$tgmaxhint)":""] =====" tggamemsg "\00312[strupr $tgcurrentquestion]" tggamemsg "\00303Hint: [strupr $_hint]" set tghinttimer [utimer $tgtimehint tghint]}</code></pre></div>this randomizes the letters in the hint (trivia)<br>example the answer is <strong class="text-strong">ANSWER</strong> it gives the hint like that: <strong class="text-strong">A__W_R</strong><br><br>I want it to give the hint organized like : <strong class="text-strong">ANS___</strong> what would be the right syntax ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Sep 15, 2003 4:34 pm</p><hr />
]]></content>
	</entry>
	</feed>
