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

	<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-06-26T15:23:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Mystical]]></name></author>
		<updated>2005-06-26T15:23:03-04:00</updated>

		<published>2005-06-26T15:23:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51407#p51407</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51407#p51407"/>
		<title type="html"><![CDATA[wordgame dosent work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51407#p51407"><![CDATA[
yes ı have a wordlist file and specify the correct path but dosent work .<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6276">Mystical</a> — Sun Jun 26, 2005 3:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-06-26T10:39:49-04:00</updated>

		<published>2005-06-26T10:39:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51394#p51394</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51394#p51394"/>
		<title type="html"><![CDATA[wordgame dosent work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51394#p51394"><![CDATA[
do you have a wordlist file, and did you specify the correct path to it ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sun Jun 26, 2005 10:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Mystical]]></name></author>
		<updated>2005-06-25T16:51:42-04:00</updated>

		<published>2005-06-25T16:51:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51369#p51369</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51369#p51369"/>
		<title type="html"><![CDATA[wordgame dosent work]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51369#p51369"><![CDATA[
hello .. this script dosent work !! ı will doing !word but dosent work ?<br>how this script work ?<br>##################  Written by Murf 10/10/97 ##################<br>##                                                           ##<br>## Requires wordlist.txt and wscore file                     ##<br>## I have included a wordlist file, but if you want to write ##<br>## your own, the format is                                   ## <br>## &lt;word to scramble&gt;:&lt;clue&gt;                                 ##<br>##                                                           ##<br>##                                                           ##<br>##                                                           ##<br>##  The only  commands are:                                  ##<br>##                                                           ##<br>##  !word       -- starts the game                           ##<br>##  !score      -- spews the top ten scorers                 ##<br>##  !wordswitch -- turns it on or off                        ##<br>##  !wordanswer -- turn the answer on or off                 ##<br>###############################################################<br><br>## NOTES<br><br># Scores are kept globally<br># Scores are only kept for those in the bot's user list.<br># The special user used to track various things, is added<br>#   by the script.<br><br>## REVISION HISTORY<br><br># July 9 2000   --  Added switch to say/not say the answer if no one gets it.<br>#--  Got rid of all the 'putchan's<br># July 2 2000 -- Fixed bug in the_score that didn't account for <br># less than 10 people in the score list.<br>#--Fixed bug in the_score that failed to check for <br>#non-existent score file.<br><br>## BINDS<br><br>#Change the f|f if you want.<br><br>bind pub f|f !score the_score<br>bind pub f|f !word pub_word<br>bind time - "05 03 % % %" wo_refresh_time<br>bind msg m !wordswitch word_onoff<br>bind msg m !wordanswer answer_onoff<br><br>## VARIABLES, set these.<br><br># This is the file that holds the wordlist, set it to whatever<br>set wlistfile /home/egg/kinks/scripts/wordlist.txt<br><br># This file keeps scores again call it whatever <br>set wscorefile /home/egg/kinks/scripts/wscore<br><br># This special user is added to the bots userlist and used to track<br># where each chan is in the wordlist<br>set specuser specialwd<br><br># Say the answer if no one gets it<br># 0 is don't say it / 1 is say it<br>set ansonoff 0<br><br>## ----------------Leave the rest alone----------------------------------<br><br># This variable tells whether the script is being run.  It will only allow<br># the game to be played in one channel at a time, otherwise too many timers<br># too much confusion.<br># Occasionally, the script may become confused during desynchs and says its <br># running when it isn't. You must reset this variable to 0. Don't worry<br># it doesnt happen often.  Obviously leave it set to 0 here<br>set winuse 0<br><br># This variable is the place in the wordlist.  Its initialized to 0 don't<br># mess with it.  I tried randomizing this, but found this worked better,<br># but its not hard to randomize if you like that better.<br>set word_list_count 0<br><br># On off switch for the annoying people<br># 0 is off/ 1 is on<br>set glonoff 1<br><br># Global channel variable, initialized to null, leave alone<br>set chan ""<br><br># Initializes global wordlist to null, leave it alone<br>set words ""<br><br># ----------CODE--------------------------------------------------------<br><br># Procedure to turn on/off whether the answer is given if no one<br># gets it.<br>proc answer_onoff {nick uhost handle args} {<br>  global ansonoff botnick<br>  set onoff [string tolower [ string trim [lindex [split $args] 0] "{}" ]]<br>  if {$onoff == "on"} { <br> set ansonoff 1<br>putserv "NOTICE $nick :Wordgame will now tell you losers the answers ;-P"<br>return<br>} <br>  if {$onoff == "off"} { <br>set ansonoff 0<br>putserv "NOTICE $nick :Wordgame will no longer tell you losers the answers"<br>return<br>}<br>   putserv "NOTICE $nick :USAGE: /msg $botnick !wordanswer on\/off"<br>   return<br>}<br><br># Had to add an on off switch cause some pple started annoying me<br>proc word_onoff {nick uhost handle args} {<br>  global botnick glonoff<br>  set onoff [string tolower [ string trim [lindex [split $args] 0] "{}" ]]<br>  if {$onoff == "on"} { <br> set glonoff 1<br>putserv "NOTICE $nick :Wordgame is turned on"<br>return<br>} <br>  if {$onoff == "off"} { <br>set glonoff 0<br>putserv "NOTICE $nick :Wordgame is turned off"<br>return<br>}<br>   putserv "NOTICE $nick :USAGE: /msg $botnick !wordswitch on\/off"<br>   return<br>}<br><br># This is the main proc, it spews the word and sets the timers to do the <br># rest.<br><br>proc pub_word {nick uhost handle channel args} {<br>   global wscorefile wlistfile words word_list_count answer winuse \<br>chan letone lettwo letters specuser glonoff<br>   if {$glonoff == 0} {<br>putserv "PRIVMSG $channel :Sorry, wordgame is turned off, try again later"<br>return<br>   } <br>   set chn [string tolower $channel]<br>   if {$word_list_count == 0} {<br>       if {![validuser $specuser]} {<br>          set channels [channels]<br>          adduser $specuser specuser!<a href="mailto:special@word.special.org">special@word.special.org</a><br>          foreach chann $channels {<br>             setuser $specuser XTRA wcount.$chann 0<br>          }<br>       }<br>       set word_list_count [getuser $specuser XTRA wcount.$chn]<br>       set words ""<br>       set fd [open $wlistfile r]<br>       while {![eof $fd]} {<br>          lappend words [gets $fd]<br>       }<br>       close $fd<br>   }<br>   if {($winuse == 1) &amp;&amp; ([string compare $chn $chan] != 0)} {<br>      putserv "PRIVMSG $chn :Sorry, they're already playing in $chan, go join in. I'll tell em your coming, $nick." <br>   return 0<br>   } elseif {($winuse == 1) &amp;&amp; ([string compare $chn $chan] == 0)} { <br>        putserv "PRIVMSG $chan :HEY! One word at a time!"<br>     return 0<br>   } elseif {$winuse == 0} {<br>      set chan $chn<br>      set winuse 1<br>      set word_pair [lindex $words $word_list_count]<br>      set answer [lindex [split $word_pair :] 1]<br>      set word_split [split $word_pair :]<br>      set letters [lreplace $word_split 1 1]<br>      set let_split [split $letters {}]<br>      set letone [lindex $let_split 0]<br>      set slettwo $letone<br>      set slettwo [join [lappend slettwo [lindex $let_split 1]]]<br>      regsub { } $slettwo {} lettwo<br>      set i [llength $let_split]<br>      set smixed ""<br>      set tmixed ""<br>      for {set j 0} {$j &lt; $i} {incr j} {<br>        set k [rand [llength $let_split]] <br>        set smixed $tmixed<br>        set smixed [lappend smixed [lindex $let_split $k]]<br>        set let_split [lreplace $let_split $k $k]<br>        regsub { } $smixed {} tmixed<br>      }<br>      set mixed $tmixed<br>      bind pub - $letters pub_gotit<br>      putserv "PRIVMSG $chan :Unscramble ---&gt; \0036 $mixed "<br>      incr word_list_count <br>      if {$word_list_count &gt;= [expr [llength $words] -1]} {<br>         set word_list_count "0"<br>      }<br>      setuser $specuser XTRA wcount.$chn $word_list_count<br>      utimer 60 noone_gotit <br>      utimer 15 clue_1<br>      utimer 30 clue_2<br>      utimer 45 clue_3<br>   }<br>}<br><br># All the timers expired and no one got it. Spew to chan.<br><br>proc noone_gotit {} {<br>   global winuse chan letters ansonoff<br>   if {$ansonoff} {<br>     putserv "PRIVMSG $chan :Nobody got it...it\'s \0034$letters"<br>   } else { <br>     putserv "PRIVMSG $chan :Nobody got it...\0034losers!"<br>   }<br>   unbind pub - $letters pub_gotit<br>   set winuse 0 <br>   set chan "" <br>}<br><br># List of things to say when a validuser wins<br><br>set winsay {<br>"must be a fluke"<br>"you rule!!"<br>"how's that VD comin along?"<br>"can I be your friend?"<br>"you're such a badass!"<br>"must have gotten all the easy ones!"<br>"but you still suck!"<br>"you must be on \0034fire!!"<br>"cheater!"<br>}<br><br># Somebody won, spew to chan and update score file. Scores are kept for both<br># daily and cumulative.  Once anyone hits 500 all scores are reset.<br><br>proc pub_gotit {nick uhost handle channel args} {<br>   global wscorefile words letters answer  winuse chan winsay<br>   putserv "PRIVMSG $chan :Woohoo $nick!! You got it...\0034$letters"<br>   kill_timers   <br>   unbind pub - $letters pub_gotit<br>   if {![validuser $handle]} {<br>     set winuse 0<br>     set chan ""<br>     return 0<br>   }<br>   if {![file exists $wscorefile]} {<br>set fd [open $wscorefile w]<br>close $fd<br>   }<br>   set fd [open $wscorefile r]<br>   set j 0<br>   while {![eof $fd]} {<br>     lappend score [gets $fd]<br>     set j [incr j] <br>   }<br>   set i [expr $j - 1]<br>   set score [lreplace $score $i $i]<br>   close $fd<br>   for {set k 0} {$k &lt; $i} {incr k 3} {<br>     set scnick [lindex $score $k]<br>     if {$handle == $scnick} {<br>        set newd [expr [lindex $score [expr $k + 1]] + 1]<br>        set newf [expr [lindex $score [expr $k + 2]] + 1]<br>        set score [lreplace $score [expr $k + 1] [expr $k + 2] $newd $newf]<br>        set dscore [lindex $score [expr $k + 1]]<br>        set rand_say [lindex $winsay [rand [llength $winsay]]]<br>        putserv "PRIVMSG  $chan :$nick you've won $dscore times today, $rand_say"<br>        if {$newf == 500} {<br>          putserv "PRIVMSG $chan :OH MY GAWD!! $scnick just scored 500 since time began!"<br>          set score [lreplace $score 1 2 0 0]<br>          for {set k 1} {$k &lt; $i} {incr k 2} {<br>            set score [lreplace $score $k $k 0]<br>    incr k<br>            set score [lreplace $score $k $k 0]<br>          }<br>          putserv "PRIVMSG $chan :\001ACTION sprinkles bot dust and time begins again!"<br>        }<br>        set winuse 0<br>        set chan ""<br>        set fd [open $wscorefile w]<br>        foreach line $score {<br>          puts $fd $line<br>        } <br>        close $fd<br>        return 0<br>     }  <br>   }<br>   putserv "PRIVMSG $chan :$nick this is your first ever win!!!...Don't you feel pathetic!"<br>   set score [lappend score $handle]<br>   set score [lappend score 1]<br>   set score [lappend score 1]<br>   set fd [open $wscorefile w]<br>     foreach line $score {<br>       puts $fd $line<br>     }<br>   close $fd<br>   set winuse 0<br>   set chan ""<br>}<br><br>proc the_score {nick uhost handle channel args} {<br>  global botnick wscorefile words answer winuse chan<br>  if {($winuse == 1) &amp;&amp; ($chan == $channel)} {<br>    putserv "PRIVMSG $chan :Sheesh! Can't you see we're playing here!!"<br>  return 0<br>  }<br>  if {![file exists $wscorefile]} {<br>    putserv "PRIVMSG $chan : No one has scored yet!"<br>    return<br>  }<br>  set fd [open $wscorefile r]<br>  set j 0<br>   while {![eof $fd]} {<br>     lappend score [gets $fd]<br> incr j<br>   }<br>   set i [expr $j - 1]<br>   set score [lreplace $score $i $i]<br>   close $fd<br>   set looptest [llength $score]<br>   if {$looptest &gt; 30} {<br>      set looptest 30<br>   }<br>   for {set k 0} {$k &lt; $looptest} {incr k 3} {<br>      set wosnick [lindex $score $k] <br>      set dscore [lindex $score [expr $k + 1]]<br>      set fscore [format "%d" [lindex $score [expr $k + 2]]]<br>      lappend tempsortscore [format "%.20d %d %s" $fscore $dscore $wosnick]<br>   }<br>   set tempsortscore [lsort -decreasing $tempsortscore]<br>   set k 0<br>   foreach i $tempsortscore {<br>     incr k<br> set newtempsortscore [string trimleft [lindex $i 0] 0]<br>     append sortscore [format "\0034 %s\.\003 %s\(%d\/%d\)  " $k [lindex $i 2] $newtempsortscore [lindex $i 1]]<br>   }<br>   set slength [llength $sortscore]<br>   putserv "PRIVMSG $channel :The top 10 Scramble scorers are (Total/Daily):"<br>   putserv "PRIVMSG $channel :$sortscore"<br>}<br><br># Give clue word<br><br>proc clue_1 {} {<br>   global chan answer<br>   set clue $answer<br>   putserv "PRIVMSG $chan :Clue ---&gt;\00312  $clue"<br>}<br><br><br># Give first letter of the word<br><br>proc clue_2 {} {<br>   global chan letone<br>   set clue $letone<br>   putserv "PRIVMSG $chan :First letter ---&gt;\00312  $clue"<br>}<br><br># Give the second letter<br><br>proc clue_3 {} {<br>   global chan lettwo<br>   set clue $lettwo <br>   putserv "PRIVMSG $chan :First two letters ---&gt;\00312  $clue"<br>}<br><br># Kill all remaining timers when someone wins.<br><br>proc kill_timers {} {<br>   global chan<br>   foreach j [utimers] {<br>     if {[lindex $j 1] == "noone_gotit"} {<br>        killutimer [lindex $j 2]<br>     }<br>     if {[lindex $j 1] == "clue_1"} {<br>        killutimer [lindex $j 2]<br>     }<br>     if {[lindex $j 1] == "clue_2"} {<br>        killutimer [lindex $j 2]<br>     }<br>     if {[lindex $j 1] == "clue_3"} {<br>        killutimer [lindex $j 2]<br>     }<br>   }<br>   return 0<br>}<br><br># Its 3:00 am, clear the daily scores.<br><br>proc wo_refresh_time {m h d mo y} {<br>  global wscorefile <br>  set fd [open $wscorefile r]<br>  set j 0<br>  while {![eof $fd]} {<br>     lappend score [gets $fd]<br>     set j [incr j]<br>    }<br>  set i [expr $j - 1]<br>  set score [lreplace $score $i $i]<br>  close $fd<br>  set score [lreplace $score 1 1 0]<br>  for {set k 1} {$k &lt; $i} {incr k 3} {<br>     set score [lreplace $score $k $k 0]<br>  }<br>  set fd [open $wscorefile w]<br>  foreach line $score {<br>      puts $fd $line<br>  } <br>  close $fd<br>  return 1<br>}<br><br>putlog "Wordgame by murf loaded"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6276">Mystical</a> — Sat Jun 25, 2005 4:51 pm</p><hr />
]]></content>
	</entry>
	</feed>
