hi . iam looking for english scramble game for eggdrop , i looked alot for it and i cant find anyone but Nerfbendr'sTriviabot and its not good one
and its at the first trivia game .
so if anyone can help me get this scramble script ill be greatfull and if he need anything for it please say
thanx
# 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
}
Once the game is over, the king and the pawn go back in the same box.
well hi its great scramble game man what about if i need to add a hint system and points 4 people who answer coreect like the trivia game
an !top10 command how do i do so?
To add a hint system, create a pub bind, and have it keep track of how many hints have been requested, then have it display part of the answer. Change it to store the word in a global var rather than doing that bind.
To do a top 10, you will need to come up with some code to add points to people when they get one. You could do it by creating a new eggdrop user for each person, or handle it yourself in a tcl hash array (by nickname). This way is harder because you need to do all the file management yourself.
It's nice that you asked how to do it rather than asking for someone to do it for you :)
well man infact i cant do it myself i mean !top10 iam not that good in tcl
i was asking if any1 can add it 2 me and about hthe hint system i meant
example:
<BoT> Who Won World cup in the year 2002?
<BoT> Scrambled Answer: r a z b i l
<user> brazil
<BoT> Coreect Answer USER u get ! point u now have 10 points ur rank is 1st on 121 users
and also i dont know how to add a utimer man if am annoying u pls tell me
Don't expect on me starting to work like a crazy monkey on it.. As stdragon said/sugested this is starting to look more like a trivia game or something.
Once the game is over, the king and the pawn go back in the same box.
Although the thread has taken a different direction, there is decent scramble script called
wordgame, by murf. It can be found among the tcl scripts on www.egghelp.org. It comes with 500 preset words, but more are easily added.