| View previous topic :: View next topic |
| Author |
Message |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Sun Aug 22, 2010 8:23 am Post subject: Scramble |
|
|
| guys , any good scramble game tcl around? |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Sun Aug 22, 2010 8:40 am Post subject: |
|
|
| I mean new released one |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Aug 22, 2010 1:50 pm Post subject: |
|
|
have you checked my scramble version? It's a bit dusty but should do the trick. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Mon Sep 06, 2010 12:39 pm Post subject: |
|
|
@caesar:
I'd like to show answers also on correctly guessed answers. Is there a way to call a variable from another process? ($word).
| Code: | # From what file are the words that will be scrambed?
set scramblefile "scramble.txt"
# How many seconds to play a scrambled word?
set ssecs 60
# Show the answer if nobody got the answer?
# 0 for NO and 1 for YES.
set sanswer 0
### Done with configurations, do not edit past here unless you know TCL. ###
# binds #
bind pub o !scramble pub:scramble
# messages #
set scongrats {
"Well done"
"Nice going"
"Way to go"
"You got it"
"That's the way"
"Show 'em how it's done"
"Check out the big brain on"
}
set snonegotit {
"Nobody got it right."
"Hello? Anybody home?"
"You're going to have to try harder!"
"Are these too tough for you?"
"Am I alone here or what?"
}
# scramble #
proc pub:scramble {nick uhost hand chan text} {
if {![file exists $::scramblefile]} {
putserv "PRIVMSG $chan :\002Error\002: $::scramblefile dose not exist."
return
}
set sstarted 0
foreach bla [utimers] {
if {[string match "nobody:gotit*" [lindex $bla 1]]} {
set sstarted 1
}
}
if {$sstarted == 1} {
putserv "PRIVMSG $chan :HEY! One word at a time!"
return
}
set file [open "$::scramblefile" r]
set data [split [read $file] "\n"]
close $file
set word [lindex $data [rand [llength $data]]]
putserv "PRIVMSG $chan :[scramble $word]"
# stuff #
bind pub - $word pub:gotit
utimer $::ssecs [list nobody:gotit $word $chan]
}
# got it! #
proc pub:gotit {nick uhost hand chan text} {
putserv "PRIVMSG $chan :[lindex $::scongrats [rand [llength $::scongrats]]] $nick.."
# clean #
foreach bla [utimers] {
if {[string match "nobody:gotit*" [lindex $bla 1]]} {
killutimer [lindex $bla 2]
}
}
unbind pub - $::lastbind pub:gotit
}
# loosers! #
proc nobody:gotit {word chan} {
if {$::sanswer == 1} {
putserv "PRIVMSG $chan :The answer was \002$word\002.. [lindex $::snonegotit [rand [llength $::snonegotit]]]"
unbind pub - $word pub:gotit
return
}
putserv "PRIVMSG $chan :[lindex $::snonegotit [rand [llength $::snonegotit]]]"
unbind pub - $word pub:gotit
}
# scramble proc by stdragon @ forum.egghelp.org
proc scramble {word} {
set letters [split $word ""]
set newword ""
while {[llength $letters]} {
set i [rand [llength $letters]]
append newword [lindex $letters $i]
set letters [lreplace $letters $i $i]
}
return $newword
} |
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Sep 07, 2010 9:22 am Post subject: |
|
|
I'm going to re-make in a 'namespace' so any variables that is used to not interfere with other scripts you may have loaded. Will reply in a few hours as I'm at work right now.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Sep 07, 2010 10:00 am Post subject: |
|
|
WScrabble 1.10
Presentation
WScrabble is an automatic "robot" or "bot" designed to entertain an IRC chatroom by offering people to play to a Scrabble/Anagrams game.
Like in the Scrabble game or on TV, 10 letters are drawn randomly : Players must then compose the longest word possible using these letters.
The player who found the longest wins points, with a bonus if the word uses all letters. As in the WQuizz script, the bot stores the score of each players and can display a ranklist of the 3 or 10 best players of the week or the year.
Usage
WScrabble is not a mIRC script but a small standalone Windows program in console-mode. It is however highly-configurable, through the file "WScrabble.ini" which you will have to modify before first use.
That way, you will be able to change as you like :
IRC connection settings (including password)
colors and texts displayed
number of letters drawn
the dictionnary of valid words
the letters distribution (to alter the frequency of each letters)
This is a a good scrabble bot how ever it is unfortunate that it hasnt been developed for eggdrop and runs as a seperate application
http://wiz0u.free.fr/wscrabble/index_en.php
Maybe some one could come up with something that will work as equaly as good as this application the developer has no intensions of doing it for eggdrop which is a shame _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
|