My first script on hawkee :D
*If anyone has any questions I can be found on the gamesurge network, usually with the username tv3636 (and in the channel #slapchop always)
This allows a channel to play the classic gameshow Family Feud!
How to play:
Question is asked, and a set number of answers from 1-8 are given (from a txt file in the format Question*Answer1-Answer2-Answer3-Answer4-Answer5-Answer6-Answer7-Answer8)
Points are awarded each time somebody answers a question
Each question (round) ends after either 60 seconds or when all answers are found
Here are the general questions I have compiled so far:
http://www.mediafire.com/file/dkdzkdyfmwz/FamFeud.txt
Currently 900 questions!
I will update that soon and hopefully have over 1,000 starter questions.
The .txt file goes in the same folder the script goes into, the mIRC Application Data folder.
Thank you for checking it out! Please comment if you have criticism, a suggestion, a compliment, a request, etc.
Updates:
February 4th, 2009 Update 1.1:
-Changed all variable names and removed "unsetall". Now only Family Feud related variables are removed.
-Made all messages red for easy distinction between bot text and others' text
-Removed unnecessary slashes from code
February 17th, 2008 Update 1.2:
-Added support for 1-8 answers rather than only 8 (and it is easily modifiable if 9 or 10 answers are needed)
-Different color text added to distinguish certain messages
-Currently adding 1000+ general questions to my txt file which I will upload soon to allow people to have a good amount of starting questions.
-Added support for in-game nick changes so that the high scores/scores will correctly change.
February 19th, 2008 Update 1.3:
-Added a 900 question .txt file for people to start with
-Added a message at the beginning of the question saying how many answers there are for the question
-Added a message 40 seconds after each question telling how many/which answers remain
Later that day :p Update 1.4:
-Added a menu with start, stop, and channel setting features
-Added a channel setting feature and fixed a major bug
Note: the game will only run in the channel you set it for
February 23rd Update 1.5:
-Added .'s to timers to remove status window notifications every question
February 25th Update 1.6:
-Removed top3, instead added !scores which lists all scores of people in the channel
-Added score message between every question
-Removed certain now unnecessary bits of code
-Added score message after each question
February 28th Update 1.7:
-Added a round # feature to let users choose the number of rounds for the game (!start unlimited or just plain !start for a regular game)
-Added a quick help message on the commands at the beginning of the snippet in case anyone needs an explanation.
Feedback is very much appreciated, thank you!
;Family Feud Script Version 1.7 by tv3636
;Runs a channel wide game of Family Feud with questions and answers specified in a txt file (Default .txt file name is FamFeud.txt)
;For update log check http://www.hawkee.com/snippet/5714/
;February 28th, 2009
;Enjoy :D
/*
Commands:
!start number
-------------
Starts the game
"!start 1" starts a 1 round game, "!start unlimited or !start" starts an unlimited game
-------------
!stop
-------------
Stops the game
-------------
!score
-------------
Notices a user his/her score
-------------
!scores
-------------
Messages the scores to the channel (Also messaged at the end of each round)
*/
;Reads from a text file and grabs a random line's Question and answers in the format: Question*Answer1-Answer2-Answer3-Answer4-Answer5-Answer6-Answer7-Answer8
on *:LOAD:/FFsetchan $?="Type the name of the channel you would like Family Feud to be active in (Including #)"
menu nicklist,channel,status,menubar,query {
Family Feud
.$iif(%FF.on != 2,Start):/FFStart $me $chan $?="How many rounds? For unlimited rounds say unlimited."
.$iif(%FF.on == 2,Stop):/FFStop $me $chan
.Set Family Feud Channel:/FFsetchan $?="Type the name of the channel you would like Family Feud to be active in (Including #)"
}
alias FFsetchan { set %chanFF $1 }
alias question {
set %FF.line $read(FamFeud.txt)
set %FF.num $pos(%FF.line, *, 1)
set %FF.length $len(%FF.line)
set %FF.numA %FF.length - %FF.num
set %FF.numQ %FF.num - 1
set %FF.dashes $count(%FF.line, -)
set %FF.answers $right(%FF.line, %FF.numA)
set %FF.question $left(%FF.line, %FF.numQ)
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a1 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
if ( %FF.dashes > 0 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a2 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes > 1 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a3 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes > 2 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a4 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes > 3 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a5 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes > 4 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a6 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes > 5 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a7 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
if ( %FF.dashes == 0 ) { set %FF.a1 %FF.answers }
if ( %FF.dashes == 1 ) { set %FF.a2 %FF.answers }
if ( %FF.dashes == 2 ) { set %FF.a3 %FF.answers }
if ( %FF.dashes == 3 ) { set %FF.a4 %FF.answers }
if ( %FF.dashes == 4 ) { set %FF.a5 %FF.answers }
if ( %FF.dashes == 5 ) { set %FF.a6 %FF.answers }
if ( %FF.dashes == 6 ) { set %FF.a7 %FF.answers }
if ( %FF.dashes == 7 ) { set %FF.a8 %FF.answers }
if ( %FF.dashes > 7 ) {
set %FF.numcom $pos(%FF.answers, -, 1) - 1
set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
set %FF.a8 $left(%FF.answers, %FF.numcom)
set %FF.answers $right(%FF.answers, %FF.numcom2)
}
inc %FF.dashes
;I was having issues with my other answer variables and timers so I just made a second set for the check alias.
set %FF.answerz 0
set %FF.a12 %FF.a1
set %FF.a22 %FF.a2
set %FF.a32 %FF.a3
set %FF.a42 %FF.a4
set %FF.a52 %FF.a5
set %FF.a62 %FF.a6
set %FF.a72 %FF.a7
set %FF.a82 %FF.a8
if (%FF.roundsplayed != $null) { msg %chanFF 10Round %FF.roundsplayed / %FF.rounds $+ 8 $chr(124) $+ $chr(124) 10Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ):4 %FF.question }
else { msg %chanFF 10Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ):4 %FF.question }
msg %chanFF 10There are4 %FF.dashes 10answers!
}
alias game {
if (%FF.roundsplayed == $null || %FF.roundsplayed <= %FF.rounds) {
question
.timer1 1 60 game2
.timer3 1 40 remaining
}
else { FFstop }
}
alias game2 {
if ( %FF.dashes == 1 ) { msg %chanFF 10That's it! The answer was:4 %FF.a12 }
if ( %FF.dashes == 2 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 and %FF.a22 }
if ( %FF.dashes == 3 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , and %FF.a32 }
if ( %FF.dashes == 4 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , and %FF.a42 }
if ( %FF.dashes == 5 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , and %FF.a52 }
if ( %FF.dashes == 6 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , and %FF.a62 }
if ( %FF.dashes == 7 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , %FF.a62 $+ , and %FF.a72 }
if ( %FF.dashes == 8 ) { msg %chanFF 10That's it! The answers were (in order):4 %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , %FF.a62 $+ , %FF.a72 $+ , and %FF.a82 }
buildscores
if (%FF.roundsplayed != $null) { inc %FF.roundsplayed }
unset %FF.a*
if (%FF.roundsplayed > %FF.rounds) { FFstop }
if (%FF.on == 2) { msg %chanFF %FF.scoreoutput }
if (%FF.on == 2) { .timer2 1 10 game }
;7 second delay between questions.
}
alias remaining {
set %FF.remain 10The remaining answers are:4
if ( %FF.a1 != $null ) { set %FF.remain %FF.remain #1 }
if ( %FF.a2 != $null ) { set %FF.remain %FF.remain #2 }
if ( %FF.a3 != $null ) { set %FF.remain %FF.remain #3 }
if ( %FF.a4 != $null ) { set %FF.remain %FF.remain #4 }
if ( %FF.a5 != $null ) { set %FF.remain %FF.remain #5 }
if ( %FF.a6 != $null ) { set %FF.remain %FF.remain #6 }
if ( %FF.a7 != $null ) { set %FF.remain %FF.remain #7 }
if ( %FF.a8 != $null ) { set %FF.remain %FF.remain #8 }
msg %chanFF %FF.remain
}
on *:TEXT:!start*:%chanFF:{
if ($2 != $null) { FFstart $nick $chan $2 }
else { FFstart $nick $chan unlimited }
}
alias FFstart {
if ( %FF.on != 2 ) {
msg %chanFF 10A game has been started by $1
set %FF.answerz 0
set %FF.on 2
set %FF.roundsplayed 1
if ($3 == unlimited) { unset %FF.roundsplayed }
else { set %FF.rounds $3 }
game
}
else { .notice $1 The game's already going, maybe you should try answering some questions now. }
}
on *:TEXT:!stop:%chanFF:{ FFstop $nick $chan }
alias FFstop {
if ( %FF.on == 2 ) {
if ($1 != $null) msg %chanFF 10Game stopped by $1 $+ .
else msg %chanFF 10Game over!
buildscores
msg %chanFF %FF.scoreoutput
.timer1 off
.timer2 off
.timer3 off
unset %FF.*
}
else { .notice $1 Stop what? }
}
on *:TEXT:!score:%chanFF:{
if ( %FF.on == 2 && %chanFF == $chan ) {
if ( %FF.score. [ $+ [ $nick ] ] != $null ) {
.notice $nick Your score is %FF.score. [ $+ [ $nick ] ] $+ .
}
else {
.notice $nick Your score is 0.
}
}
else {
.notice $nick There's no game going on, dumbass.
}
}
;Text events for all 8 answers
on *:TEXT:%FF.a1:%chanFF:{
msg %chanFF 10Survey says,4 50 points10!4 $nick 10got the 4#1 10answer,4 %FF.a1 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 50
unset %FF.a1
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a2:%chanFF:{
msg %chanFF 10Survey says,4 35 points10!4 $nick 10got the 4#2 10answer,4 %FF.a2 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 35
unset %FF.a2
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a3:%chanFF:{
msg %chanFF 10Survey says,4 28 points10!4 $nick 10got the 4#3 10answer,4 %FF.a3 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 28
unset %FF.a3
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a4:%chanFF:{
msg %chanFF 10Survey says,4 20 points10!4 $nick 10got the 4#4 10answer,4 %FF.a4 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 20
unset %FF.a4
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a5:%chanFF:{
msg %chanFF 10Survey says,4 15 points10!4 $nick 10got the 4#5 10answer,4 %FF.a5 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 15
/unset %FF.a5
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a6:%chanFF:{
msg %chanFF 10Survey says,4 10 points10!4 $nick 10got the 4#6 10answer,4 %FF.a6 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 10
unset %FF.a6
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a7:%chanFF:{
msg %chanFF 10Survey says,4 8 points10!4 $nick 10got the 4#7 10answer,4 %FF.a7 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 8
unset %FF.a7
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
on *:TEXT:%FF.a8:%chanFF:{
msg %chanFF 10Survey says,4 5 points10!4 $nick 10got the 4#8 10answer,4 %FF.a8 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 5
unset %FF.a8
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
alias buildscores {
set %FF.count 0
set %FF.added 0
set %FF.totalnicks $nick(%chanFF,0,a)
set %FF.highest 0
set %FF.highestnick $me
set %FF.x $var(%FF.score.*, 0)
set %FF.scoreoutput 10Scores:
while (%FF.added < %FF.x) {
while (%FF.count <= %FF.totalnicks) {
set %FF.testnick $nick(%chanFF,%FF.count,a)
if (%FF.score. [ $+ [ %FF.testnick ] ] != $null) && (%FF.score. [ $+ [ %FF.testnick ] ] >= %FF.highest) && (%FF.testnick !isin %FF.scoreoutput) {
set %FF.highest %FF.score. [ $+ [ %FF.testnick ] ]
set %FF.highestnick %FF.testnick
}
inc %FF.count
}
if (%FF.highest != 0) { set %FF.scoreoutput %FF.scoreoutput 04 $+ %FF.highestnick $+ 10:04 %FF.highest 08 $+ $chr(124) }
set %FF.highest 0
set %FF.highesttnick $me
inc %FF.added
set %FF.count 0
}
set %FF.chop $calc($len(%FF.scoreoutput) - 1)
set %FF.scoreoutput $left(%FF.scoreoutput,%FF.chop)
if (%FF.scoreoutput == 10Scores:) set %FF.scoreoutput 10Nobody has any points!
}
;Checks to see if all answers have been said before time limit is up
alias check {
if ( $1 == %FF.dashes ) {
.timer1 off
.timer3 off
game2
}
}
;Accounts for nickname changes mid-game.
on *:NICK:{
if ( %FF.score. [ $+ [ $nick ] ] != $null ) {
set %FF.score. [ $+ [ $newnick ] ] %FF.score. [ $+ [ $nick ] ]
unset %FF.score. [ $+ [ $nick ] ]
}
}
;Notices the scores of players in the channel in order to the person that said !scores
on *:TEXT:!scores:%chanFF:{
buildscores
.notice $nick %FF.scoreoutput
}
;If you have another feature you would like to see, let me know and I'll add it if possible!
If you remind me in like 8 hours (send a message here) I can have a quick look at it @SandmanXP
@Lucius Thanks, but the issue is other plurals (of which there are a lot). Checking for an s is easy enough as you showed, but there are other possibilities/alternate spellings, etc. that are difficult to look for
@bourneident The auto-stop is basically already there, you just have to !start n and it will stop after n questions. I could look into adding more scoring features in the future but at the moment I'm at college and I only have a macbook, so I can't really do any mIRC coding. I don't have too much time anyway, so it would have to wait.
If anyone wants to modify it themselves and re-post it I would be fine with that, since I'm probably not going to be able to work on it again for a while if at all.
I don't know if you are still around but if you see this could you possibly add a !top10 option where scores are kept in a ini or hsh table i/e !top10 <1st place with a record of 3994 points> !top10 which shows top 10 players with a !reset scores option that only the ops can do
plus if it's not to much trouble maybe make it !top10 daily weekly monthly kinda thing
edit
one last thing an auto stop after so many questions
thanks in advance hope you are still around
Nice script indeed, I like the twist on a regular Trivia.
You said that you were looking at making it possible for plurals?
I don't know if this helps but you could use:
on *:TEXT:%FF.a1*:%chanFF:{
if ($remove($1-,%ff.al) == s) || ($remove($1-,%ff.al) == $null) {
msg %chanFF 10Survey says,4 50 points10!4 $nick 10got the 4#1 10answer,4 %FF.a1 $+ 10!
inc %FF.score. [ $+ [ $nick ] ] 50
unset %FF.a1
set %FF.answerz %FF.answerz + 1
check %FF.answerz
}
}
the remove will take the correct answer off the input trigger (I added a wildcard) and if the value left is s or null it will carry on.
That will only work for s on the end of the answer though.
I'm sure there are easier and better ways to do it, but if you do that for each answer trigger, it should work.
It would be nice if u would add an auto stop after no input after a certain length of time or a certain amount of rounds have been played. Or just take out the unlimited and have them to type start to each time they want to play. We love the game and it's played often thanks for your time and effort in making it....
I started working on something to try to accommodate plurals/singular but it ended up being more difficult than I had imagined. The issue is that many words don't simply need an s to be plural, so it's a lot more work than it would seem.
I might look back into it, although I did write this a while ago and at this point I'd probably just want to re-write it, which I don't really have time for now :\
Really Interesting variation on a trivia game, I love this.
Do the points stay on a record or something? When playing the game !score returns my points, but after a game as finished and i type !score it says there is no game being played. Was just curious if it was ment to be like this?
Great script 9/10
regards
pan
It's not case sensitive so that shouldn't matter..and I haven't heard of this bug before (except for something with nicknames being an issue, but I thought I fixed that, and that was only when nicknames had dashes). Try to change nicknames and then answer, or have somebody else answer maybe, and then let me know if that seems to fix whatever the problem is. I don't really know why that would be happening though, sorry.
i really like this script and it's a lot of fun, but sometimes it misses questions if you dont capitalize the first letter of the word, or just altogether
Round 5 / 5 || Question (530/900): name a food you couldn't pronounce when you were a small child There are 6 answers! spaghetti Spaghetti The remaining answers are: #1 #2 #3 #4 #5 #6 That's it! The answers were (in order): spaghetti, asparagus, banana, broccoli, hamburger, and tomato Game over! i made the answer file all lowercase, but that didnt help. any suggestions?http://www.mediafire.com/file/dkdzkdyfmwz/FamFeud.txt
I re-Uploaded it for you :)
Hey, sorry but I haven't used windows or mirc in 5-6 years. Hopefully someone else could take a look and I would be happy to post an update if somebody sent it to me, but I don't think I'll revisit it myself. :-/