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

	<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-11-18T06:32:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[mrdr]]></name></author>
		<updated>2005-11-18T06:32:37-04:00</updated>

		<published>2005-11-18T06:32:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57564#p57564</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57564#p57564"/>
		<title type="html"><![CDATA[Re: tag code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57564#p57564"><![CDATA[
<blockquote class="uncited"><div>sorry i dont know how to do that<br>can u tell me how to do ?</div></blockquote><a href="http://forum.egghelp.org/faq.php?mode=bbcode#5" class="postlink">http://forum.egghelp.org/faq.php?mode=bbcode#5</a> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6362">mrdr</a> — Fri Nov 18, 2005 6:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-11-17T22:53:56-04:00</updated>

		<published>2005-11-17T22:53:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57546#p57546</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57546#p57546"/>
		<title type="html"><![CDATA[auto hangman]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57546#p57546"><![CDATA[
Good lord above. What do you thing those <strong class="text-strong">Menu</strong> buttons are for when making a post? And the FAQ is for.... ? Edit your post!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Nov 17, 2005 10:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[obelix]]></name></author>
		<updated>2005-11-17T22:33:14-04:00</updated>

		<published>2005-11-17T22:33:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57545#p57545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57545#p57545"/>
		<title type="html"><![CDATA[tag code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57545#p57545"><![CDATA[
sorry i dont know how to do that<br>can u tell me how to do ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6961">obelix</a> — Thu Nov 17, 2005 10:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-11-10T23:10:48-04:00</updated>

		<published>2005-11-10T23:10:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57308#p57308</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57308#p57308"/>
		<title type="html"><![CDATA[auto hangman]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57308#p57308"><![CDATA[
Fix up original post with code tags please.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Nov 10, 2005 11:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[obelix]]></name></author>
		<updated>2005-11-10T23:09:18-04:00</updated>

		<published>2005-11-10T23:09:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57307#p57307</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57307#p57307"/>
		<title type="html"><![CDATA[auto hangman]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57307#p57307"><![CDATA[
this game play only 1 round<br>i wanna this game play over and over again until Op type !stop on channel.<br> thanks if u wanna help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6961">obelix</a> — Thu Nov 10, 2005 11:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-11-10T19:25:09-04:00</updated>

		<published>2005-11-10T19:25:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57298#p57298</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57298#p57298"/>
		<title type="html"><![CDATA[Re: auto hangman]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57298#p57298"><![CDATA[
<blockquote class="uncited"><div>any one can help me to make this scripts hangman auto play after user type !hangman on chan.</div></blockquote>Isn't that already in the script?<blockquote class="uncited"><div>bind pub - !hangman play_hangman</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Nov 10, 2005 7:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[obelix]]></name></author>
		<updated>2005-11-10T14:45:21-04:00</updated>

		<published>2005-11-10T14:45:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57286#p57286</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57286#p57286"/>
		<title type="html"><![CDATA[auto hangman]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57286#p57286"><![CDATA[
any one can help me to make this scripts hangman auto play after user type !hangman on chan.<br><br>this the script <br><br>###########<br>#hangman<br>###########<br>bind pub - !hangman play_hangman<br>bind pub - !stats hangman_stats<br>bind pub - !scores hangman_stats<br>bind dcc - hangman start_hangman<br>bind msg - hangman msg_hangman<br>bind dcc m sethang set_hangman<br>global inprogress maxguess giveclue hang_stats wordlist hangchannels<br>global startnick<br><br><br>#if something ever happens and the bot gets stuck saying "game in progress"<br>#then either rehash or type '.tcl set inprogress 0'<br><br>set inprogress 0<br>set maxguess 6<br><br>#This variable is only valid for starting a game of hangman in a DCC chat...<br>#It will force the bot to ask the user for a clue... Make sure that the<br>#user realizes this (The bot puts up a notice) or he could be stuck<br>#in limbo for a while<br><br>set giveclue 0<br><br><br>#The bot keeps track of who started the game (unless a random puzzle was<br>#selected) so it can boot 'em on their ass if they cheat!<br><br>set startnick ""<br><br>#Set this variable to your wordlist, if you want to support it...<br>#I recommend it, since I took out the part of the script that will keep<br>#it from working if you don't supply and answer <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>set wordlist "./wordlists/shakesp-glossary"<br><br><br>#MAKE SURE you set this to ALL applicable channels... It WILL NOT WORK<br>#if you dont set this variable!<br><br><br>set hangchannels "#tuckaland"<br>if {$hangchannels == ""} { putlog "Warning: No hangman channels defined!" }<br><br><br><br><br>#Internal DCC commands to change some of the settings...<br>proc set_hangman { hand idx args } {<br>  regsub -nocase -all \[{}] $args "" args<br>  if { $args == "" } {<br>    putdcc $idx "Usage: sethang &lt;options&gt;"<br>  }<br>  if {[lindex $args 0] == "tries"} {<br>    global maxguess<br>    set maxguess [lindex $args 1]<br>    putdcc $idx "Max guesses set to: [lindex $args 1]"<br>    return 1<br>  }<br>  if {[lindex $args 0] == "clue"} {<br>    global giveclue<br>    set giveclue [lindex $args 1]<br>    putdcc $idx "Ask for clues set to: [lindex $args 1]"<br>    return 1<br>  }<br>  if {[lindex $args 0] == "reset"} {<br>    global hang_stats<br>    if [info exists hang_stats] { unset hang_stats }<br>    putdcc $idx "Hangman scores/stats reset..."<br>    return 1<br>  }<br>  if {[lindex $args 0] == "restart"} {<br>  global inprogress<br>  set inprogress 0<br>  putdcc $idx "Game restarted..."<br>    return 1<br>  }<br>  putdcc $idx "Valid options: tries, clue, reset, restart"<br>  return 0<br>}<br>proc start_hangman { hand idx args } {<br>  global answer dashes guesses guessed inprogress used maxguess <br>  global startnick giveclue clue hangchannels<br>  if { $inprogress == 1 } {<br>    putdcc $idx "Sorry, a game is already in progress."<br>    return 0<br>  }<br>  set inprogress 1<br>  set guessed ""<br>  set guesses $maxguess<br>  set used ""<br>  set clue ""<br>  regsub -nocase -all \[{}] "[string toupper $args]" "" answer<br>  if { $answer != "" } {<br>    putdcc $idx "Hangman game started with answer of '$answer'..."<br>  }<br>  if { $answer == "" } {<br>    random_word<br>    putdcc $idx "Hangman game started with random answer..."<br>  }<br>  regsub -all -nocase "\[a-z]" $answer "-" dashes<br>  putlog "Hangman game started by $hand, join in!"<br>  foreach chan $hangchannels { puthelp "privmsg $chan :By-Tor's \001Hangman\001 \002v2.5\002 started by $nick..." }<br>  if {$giveclue == 1} {<br>    putdcc $idx "Clues have been enabled, please enter a clue, or NONE."<br>    control $idx get_clue<br>    return 1<br>  }<br>  foreach chan $hangchannels {<br>    puthelp "privmsg $chan :Use !hangman &lt;guess&gt; and !hangman &lt;answer&gt; to play"<br>    puthelp "privmsg $chan :Puzzle: $dashes"<br>    if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>  }<br>}<br><br><br>#Here is support for the /msg hangman command...<br><br>proc msg_hangman { nick uhost hand args } {<br>  global answer dashes guesses guessed inprogress used <br>  global startnick maxguess giveclue clue hangchannels<br>  if { $inprogress == 1 } {<br>    puthelp "notice $nick :Sorry, a game is already in progress."<br>    return 0<br>  }<br>  set inprogress 1<br>  set guessed ""<br>  set guesses $maxguess<br>  set used ""<br>  set clue ""<br>  regsub -nocase -all \[{}] "[string toupper $args]" "" answer<br>  if {$answer != ""} {<br>    puthelp "notice $nick :Hangman game started with answer of '$answer'..."<br>    set startnick $nick<br>  }<br>  if {$answer == ""} {<br>    random_word<br>    puthelp "notice $nick :Hangman started with random word from dictionary..."<br>    set startnick ""<br>  }<br>  regsub -all -nocase "\[a-z]" $answer "-" dashes<br>  putlog "Hangman game started by $nick, join in!"<br>  foreach chan $hangchannels {<br>    puthelp "privmsg $chan :By-Tor's \001Hangman\001 \002v2.5\002 started by $nick..."<br>    puthelp "privmsg $chan :Use !hangman &lt;guess&gt; and !hangman &lt;answer&gt; to play"<br>    puthelp "privmsg $chan :Puzzle: $dashes"<br>  }<br>}<br><br><br>#here is the real meat of the script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>proc play_hangman { nick uhost hand chan guess } {<br>  global answer dashes guesses guessed inprogress used clue hang_stats<br>  global startnick hangchannels<br>  if { $inprogress == 0 } {<br>    puthelp "privmsg $chan :Sorry, $nick, no hangman game in progress..."<br>    return 0<br>  }<br>  if { $nick == $startnick } {<br>    putserv "kick $chan $nick :Don't guess at your own puzzle, lamer!"<br>    puthelp "notice $nick :You just lost your score for cheating, bozo!"<br>    if [info exists hang_stats($nick)] { set hang_stats($nick) 0 }<br>    return 0<br>  }<br>  set length [string length $guess]<br>  regsub -nocase -all \[{}] "[string toupper $guess]" "" guess<br>  if { $guess == "" } { return 0 }<br>  if { $length == 1 } {<br>    if [string match "*$guess*" $used] {<br>      foreach chan $hangchannels {<br>      puthelp "privmsg $chan :$guess has already been used, $nick!"<br>        if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>        puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>      }<br>      return 0<br>    }<br>    set used "$used$guess"<br>    if [string match "*$guess*" $answer] {<br>      set guessed "$guessed$guess"<br>      regsub -all -nocase \[$guessed] ABCDEFGHIJKLMNOPQRSTUVWXYZ "" temp<br>      regsub -all -nocase \[$temp] $answer "\001" dashes<br>      regsub -all -nocase "\001" $dashes "-" dashes<br>      foreach chan $hangchannels {<br>        puthelp "privmsg $chan :Correct guess of \001$guess\001 by $nick"<br>        if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>        puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>      }<br>      return<br>    }<br>    incr guesses -1<br>    if {$guesses &lt;= 0} {<br>      foreach chan $hangchannels {<br>        puthelp "privmsg $chan :There is no \001$guess\001, $nick!"<br>        if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>        puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>        puthelp "privmsg $chan :Bah, you lose!"<br>        puthelp "privmsg $chan :Puzzle Answer: $answer"<br>      }<br>      set inprogress 0<br>      return 0<br>    }<br>    foreach chan $hangchannels {<br>      puthelp "privmsg $chan :There is no \001$guess\001, $nick!"<br>      if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>      puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>    }<br>    return<br>  }<br>  if [string match $guess $answer] {<br>  foreach chan $hangchannels {<br>      puthelp "privmsg $chan :CORRECT guess by $nick!"<br>      if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>      puthelp "privmsg $chan :Puzzle Answer: $answer"<br>      if [info exists hang_stats($nick)] { set hang_stats($nick) [expr $hang_stats($nick) + 1] }<br>      if {![info exists hang_stats($nick)]} { set hang_stats($nick) 1 }<br>  }<br>    set inprogress 0<br>    return<br>  }<br>  incr guesses -1<br>  if {$guesses &lt;= 0} {<br>    foreach chan $hangchannels {<br>      puthelp "privmsg $chan :Incorrect guess by $nick!"<br>      puthelp "privmsg $chan :There is no \001$guess\001, $nick!"<br>      if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>      puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>      puthelp "privmsg $chan :Bah, you lose!"<br>      puthelp "privmsg $chan :Puzzle Answer: $answer"<br>      set inprogress 0<br>    }<br>    return<br>  }<br>  foreach chan $hangchannels {<br>    puthelp "privmsg $chan :Incorrect guess by $nick! Guesses left: $guesses"<br>    if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>    puthelp "privmsg $chan :Puzzle: $dashes | Guesses left: $guesses | Letters guessed: $used"<br>  }<br>  return<br>}<br>proc get_clue { idx text } { <br>  global clue answer dashes hangchannels<br>  regsub -nocase -all \[{}] $text "" clue<br>  putdcc $idx "Hangman game started with answer of '$answer'..."<br>  foreach chan $hangchannels {<br>    puthelp "privmsg $chan :Use !hangman &lt;guess&gt; and !hangman &lt;answer&gt; to play"<br>    if {$clue != ""} { puthelp "privmsg $chan :Clue given: $clue "}<br>    puthelp "privmsg $chan :Puzzle: $dashes"<br>  }<br>  return<br>}<br><br>#Show the cumulative stats for the channel...<br>#Currently they are indexed by NICK alone, so it may give varying results<br>#if your users switch nicks a lot...<br>proc hangman_stats { nick uhost hand chan args } {<br>  global hang_stats hangchannels<br>  if [array exists hang_stats] {<br>    set search [array startsearch hang_stats]<br>    foreach chan $hangchannels { puthelp "privmsg $chan :---HANGMAN SCORES---" }<br>    while {[array anymore hang_stats $search]==1} {<br>      set statnick [array nextelement hang_stats $search]<br>      set score $hang_stats($statnick)<br>      foreach chan $hangchannels {<br>        puthelp "privmsg $chan :$statnick -=- $score"<br>      }<br>    }<br>    return 1<br>  }<br>  puthelp "privmsg $chan : There are no scores!"<br>  return 0<br>}<br><br><br>#How we get the random word... The [rand 1924] must be changed to reflect the<br>#number of lines in your wordlist file... Using this method I wouldnt recommend<br>#a list of more than 2000 words... I'm working on a faster method to grab a<br>#random word and allow the use of a much larger dictionary<br><br>proc random_word {} {<br>  global answer wordlist<br>  putlog "Getting Answer...."<br>  set line [rand 1924]<br>  set fileid [open $wordlist RDONLY]<br>  set temp 1<br>  while {$temp &lt; $line} {<br>    gets $fileid<br>    incr temp 1<br>  }<br>  set answer [string toupper [gets $fileid]]<br>  close $fileid<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6961">obelix</a> — Thu Nov 10, 2005 2:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
