Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Commands:
- !ff number
- -------------
- Starts the game
- "!ff 1" starts a 1 round game, "!ff unlimited or !ff" starts an unlimited game
- -------------
- !ffstop
- -------------
- Stops the game
- -------------
- !ffscore
- -------------
- Notices a user his/her score
- -------------
- !ffscores
- -------------
- 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 $chanFF $?="How many rounds? For unlimited rounds say unlimited."
- .$iif(%FF.on == 2,Stop):/FFStop $me $chanFF
- }
- alias chanff { return #qi_interesting }
- on $*:TEXT:/^[!]f(f|fstart)(\s|$)/Si:$($chanff):{
- if ($nick isop $chanFF) {
- if ($2 != $null) { FFstart $nick $chanFF $2 }
- else { FFstart $nick $chanFF 1 }
- }
- else {
- msg $chanFF Sorry $caps($nick) $+ , you need to be an op to start Family Feud.
- }
- }
- alias FFstart {
- if ( %FF.on != 2 ) {
- msg $chanFF A game of Family Feud has been started!
- describe $chan $chr(40) $+ [ $chr(36) $+ 1000 $chr(43) 3 Points for #1 Answer!] - [ $chr(36) $+ 250 $chr(43) 2 Points for #2 or #3 Answer(s)] - [ $chr(36) $+ 250 $chr(43) 1 Point for all other Answers] $+ $chr(41)
- set %FF.answerz 0
- set %FF.on 2
- set %FF.roundsplayed 1
- set %FF.rounds $3
- game
- }
- else { msg $chanFF $1 The game's already going, maybe you should try answering some questions now. }
- }
- 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 Round %FF.roundsplayed / %FF.rounds $+ $chr(124) $+ $chr(124) Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ): %FF.question }
- else { msg $chanFF Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ): %FF.question }
- msg $chanFF There are %FF.dashes answers!
- }
- 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 That's it! The answer was: %FF.a12 }
- if ( %FF.dashes == 2 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 and %FF.a22 }
- if ( %FF.dashes == 3 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , and %FF.a32 }
- if ( %FF.dashes == 4 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , and %FF.a42 }
- if ( %FF.dashes == 5 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , and %FF.a52 }
- if ( %FF.dashes == 6 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , and %FF.a62 }
- if ( %FF.dashes == 7 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , %FF.a62 $+ , and %FF.a72 }
- if ( %FF.dashes == 8 ) { msg $chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , %FF.a42 $+ , %FF.a52 $+ , %FF.a62 $+ , %FF.a72 $+ , and %FF.a82 }
- if (%FF.roundsplayed != $null) { inc %FF.roundsplayed }
- unset %FF.a*
- if (%FF.roundsplayed > %FF.rounds) { FFstop }
- if (%FF.on == 2) { msg $chanFF $buildscores }
- if (%FF.on == 2) { .timer2 1 10 game }
- ;7 second delay between questions.
- }
- alias remaining {
- set %FF.remain The remaining answers are:
- 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:!ffstop:$($chanff):{
- if ($nick isop $chanFF) {
- FFstop $nick $chanFF
- ;Adam I added this to hopefully (temporarily) allow this command to eliminate that variable as a way to get Family Feud running again if it bugs out.. Haven't tried this yet though. -- Jared (2/22/14 - Time 6:40pm CST)
- unset %FF.on
- }
- else {
- msg $chanFF Sorry $caps($nick) $+ , you need to be a Moderator to Stop Family Feud.
- }
- }
- on *:TEXT:!fftop:#:{
- msg $chanFF [Family Feud - Top Ten] $fftop
- }
- alias FFstop {
- if ( %FF.on == 2 ) {
- if ($1 != $null) { msg $chanFF Game stopped by $1 $+ .
- buildscores
- msg $chanff $buildscores
- .timer1 off
- .timer2 off
- .timer3 off
- unset %FF.*
- remini feud.ini Current
- }
- elseif ($1 == $null) { describe $chanFF Game over!
- msg $chanFF [Game scores] $buildscores
- msg $chanFF [Top Ten] $fftop
- .timer1 off
- .timer2 off
- .timer3 off
- unset %FF.*
- remini feud.ini Current
- }
- else { msg $chanFF Family Feud is not currently running. }
- }
- }
- on *:TEXT:!ffscore:$($chanff):{
- msg $chanFF $caps($nick) $+ , your current score is $iif($readini(feud.ini,n,Current,$nick) == $null,[zero],$v1) $&
- - your all time score is $iif($readini(feud.ini,n,Totals,$nick) == $null,[zero],$v1)
- }
- ;Text events for all 8 answers
- on *:TEXT:%FF.a1:$($chanff):{
- msg $chanFF Survey says, 3 points! and $chr(36) $+ 1000 $caps($nick) got the #1 answer, %FF.a1 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 3
- /set %moneyfff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 1000 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyfff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 3)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 3)
- unset %FF.a1
- unset %moneyfff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a2:$($chanff):{
- msg $chanFF Survey says, 2 points! and $chr(36) $+ 250 $caps($nick) got the #2 answer, %FF.a2 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 2
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 2)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 2)
- unset %FF.a2
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a3:$($chanff):{
- msg $chanFF Survey says, 2 points! and $chr(36) $+ 250 $caps($nick) got the #3 answer, %FF.a3 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 2
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 2)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 2)
- unset %FF.a3
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a4:$($chanff):{
- msg $chanFF Survey says, 1 points! and $chr(36) $+ 250 $caps($nick) got the #4 answer, %FF.a4 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 1
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 1)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 1)
- unset %FF.a4
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a5:$($chanff):{
- msg $chanFF Survey says, 1 points! and $chr(36) $+ 250 $caps($nick) got the #5 answer, %FF.a5 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 1
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 1)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 1)
- unset %FF.a5
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a6:$($chanff):{
- msg $chanFF Survey says, 1 points! and $chr(36) $+ 250 $caps($nick) got the #6 answer, %FF.a6 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 1
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 1)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 1)
- unset %FF.a6
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a7:$($chanff):{
- msg $chanFF Survey says, 1 points! and $chr(36) $+ 250 $caps($nick) got the #7 answer, %FF.a7 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 1
- /set %money.ff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 1)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 1)
- unset %FF.a7
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- on *:TEXT:%FF.a8:$($chanff):{
- msg $chanFF Survey says, 1 points! and $chr(36) $+ 250 $caps($nick) got the #8 answer, %FF.a8 $+ !
- inc %FF.score. [ $+ [ $nick ] ] 1
- /set %moneyff $calc( $readini( C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini, $nick, Money ) + 250 )
- /writeini C:\Users\Jared\AppData\Roaming\mIRCBOT\casino.ini $nick Money %moneyff
- writeini -n feud.ini Current $nick $calc($readini(feud.ini,n,Current,$nick) + 1)
- writeini -n feud.ini Totals $nick $calc($readini(feud.ini,n,Totals,$nick) + 1)
- unset %FF.a8
- unset %moneyff
- set %FF.answerz %FF.answerz + 1
- check %FF.answerz
- }
- alias buildscores {
- var %x 1
- while (%x <= $ini(feud.ini,Current,0)) {
- var %nick $ini(feud.ini,Current,%x)
- var %scores %scores $+(%nick,:) $readini(feud.ini,Current,%nick)
- inc %x
- }
- return %scores
- }
- alias fftop {
- var %x 1
- while (%x <= $ini(feud.ini,Totals,0)) {
- var %nick $ini(feud.ini,Totals,%x)
- var %scores $addtok(%scores,$+($readini(feud.ini,Totals,%nick),.,%nick),32)
- inc %x
- }
- var %scores $sorttok(%scores,32,nr)
- var %scores $gettok(%scores,1-10,32)
- var %scores $mid($regsubex(%scores,/(\d+)\.(\S+)/g,\2: \1$chr(44)),1,-1)
- return %scores
- }
- ;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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement