Advertisement
illpastethat

Family Feud jared

Nov 24th, 2013
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 11.13 KB | None | 0 0
  1. /*
  2. Commands:
  3. !ff number
  4. -------------
  5. Starts the game
  6. "!ff 1" starts a 1 round game, "!ff unlimited or !ff" starts an unlimited game
  7. -------------
  8. !ffstop
  9. -------------
  10. Stops the game
  11. -------------
  12. !ffscore
  13. -------------
  14. Notices a user his/her score
  15. -------------
  16. !ffscores
  17. -------------
  18. Messages the scores to the channel (Also messaged at the end of each round)
  19. */
  20.  
  21.  
  22. ;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
  23.  
  24. on *:LOAD:/FFsetchan $?="Type the name of the channel you would like Family Feud to be active in (Including #)"
  25.  
  26. menu nicklist,channel,status,menubar,query {
  27.   Family Feud
  28.   .$iif(%FF.on != 2,Start):/FFStart $me $chan $?="How many rounds? For unlimited rounds say unlimited."
  29.   .$iif(%FF.on == 2,Stop):/FFStop $me $chan
  30.   .Set Family Feud Channel:/FFsetchan $?="Type the name of the channel you would like Family Feud to be active in (Including #)"
  31. }
  32.  
  33. alias FFsetchan { set %chanFF $1 }
  34.  
  35. alias question {
  36.   set %FF.line $read(FamFeud.txt)
  37.   set %FF.num $pos(%FF.line, *, 1)
  38.   set %FF.length $len(%FF.line)
  39.   set %FF.numA %FF.length - %FF.num
  40.   set %FF.numQ %FF.num - 1
  41.   set %FF.dashes $count(%FF.line, -)
  42.  
  43.   set %FF.answers $right(%FF.line, %FF.numA)
  44.   set %FF.question $left(%FF.line, %FF.numQ)
  45.  
  46.   set %FF.numcom $pos(%FF.answers, -, 1) - 1
  47.   set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  48.   set %FF.a1 $left(%FF.answers, %FF.numcom)
  49.   set %FF.answers $right(%FF.answers, %FF.numcom2)
  50.   if ( %FF.dashes > 0 ) {
  51.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  52.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  53.     set %FF.a2 $left(%FF.answers, %FF.numcom)
  54.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  55.   }
  56.   if ( %FF.dashes > 1 ) {
  57.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  58.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  59.     set %FF.a3 $left(%FF.answers, %FF.numcom)
  60.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  61.   }
  62.   if ( %FF.dashes > 2 ) {
  63.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  64.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  65.     set %FF.a4 $left(%FF.answers, %FF.numcom)
  66.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  67.   }
  68.   if ( %FF.dashes > 3 ) {
  69.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  70.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  71.     set %FF.a5 $left(%FF.answers, %FF.numcom)
  72.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  73.   }
  74.   if ( %FF.dashes > 4 ) {
  75.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  76.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  77.     set %FF.a6 $left(%FF.answers, %FF.numcom)
  78.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  79.   }
  80.   if ( %FF.dashes > 5 ) {
  81.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  82.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  83.     set %FF.a7 $left(%FF.answers, %FF.numcom)
  84.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  85.   }
  86.  
  87.   if ( %FF.dashes == 0 ) { set %FF.a1 %FF.answers }
  88.   if ( %FF.dashes == 1 ) { set %FF.a2 %FF.answers }
  89.   if ( %FF.dashes == 2 ) { set %FF.a3 %FF.answers }
  90.   if ( %FF.dashes == 3 ) { set %FF.a4 %FF.answers }
  91.   if ( %FF.dashes == 4 ) { set %FF.a5 %FF.answers }
  92.   if ( %FF.dashes == 5 ) { set %FF.a6 %FF.answers }
  93.   if ( %FF.dashes == 6 ) { set %FF.a7 %FF.answers }
  94.   if ( %FF.dashes == 7 ) { set %FF.a8 %FF.answers }
  95.   if ( %FF.dashes > 7 ) {
  96.     set %FF.numcom $pos(%FF.answers, -, 1) - 1
  97.     set %FF.numcom2 $len(%FF.answers) - $pos(%FF.answers, -, 1)
  98.     set %FF.a8 $left(%FF.answers, %FF.numcom)
  99.     set %FF.answers $right(%FF.answers, %FF.numcom2)
  100.   }
  101.  
  102.  
  103.   inc %FF.dashes
  104.  
  105.   ;I was having issues with my other answer variables and timers so I just made a second set for the check alias.
  106.   set %FF.answerz 0
  107.   set %FF.a12 %FF.a1
  108.   set %FF.a22 %FF.a2
  109.   set %FF.a32 %FF.a3
  110.   set %FF.a42 %FF.a4
  111.   set %FF.a52 %FF.a5
  112.   set %FF.a62 %FF.a6
  113.   set %FF.a72 %FF.a7
  114.   set %FF.a82 %FF.a8
  115.   if (%FF.roundsplayed != $null) { msg %chanFF Round %FF.roundsplayed / %FF.rounds $+ $chr(124) $+ $chr(124) Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ): %FF.question }
  116.   else { msg %chanFF Question ( $+ $readn $+ / $+ $lines(FamFeud.txt) $+ ): %FF.question }
  117.   msg %chanFF There are %FF.dashes answers!
  118. }
  119.  
  120. alias game {
  121.   if (%FF.roundsplayed == $null || %FF.roundsplayed <= %FF.rounds) {
  122.     question
  123.     .timer1 1 60 game2
  124.     .timer3 1 40 remaining
  125.   }
  126.   else { FFstop }
  127. }
  128.  
  129. alias game2 {
  130.   if ( %FF.dashes == 1 ) { msg %chanFF That's it! The answer was: %FF.a12 }
  131.   if ( %FF.dashes == 2 ) { msg %chanFF That's it! The answers were (in order): %FF.a12 and %FF.a22 }
  132.   if ( %FF.dashes == 3 ) { msg %chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , and %FF.a32 }
  133.   if ( %FF.dashes == 4 ) { msg %chanFF That's it! The answers were (in order): %FF.a12 $+ , %FF.a22 $+ , %FF.a32 $+ , and %FF.a42 }
  134.   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 }
  135.   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 }
  136.   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 }
  137.   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 }
  138.   buildscores
  139.   if (%FF.roundsplayed != $null) { inc %FF.roundsplayed }
  140.   unset %FF.a*
  141.   if (%FF.roundsplayed > %FF.rounds) { FFstop }
  142.   if (%FF.on == 2) { msg %chanFF %FF.scoreoutput }
  143.   if (%FF.on == 2) { .timer2 1 10 game }
  144.   ;7 second delay between questions.
  145. }
  146.  
  147. alias remaining {
  148.   set %FF.remain The remaining answers are:
  149.   if ( %FF.a1 != $null ) { set %FF.remain %FF.remain #1 }
  150.   if ( %FF.a2 != $null ) { set %FF.remain %FF.remain #2 }
  151.   if ( %FF.a3 != $null ) { set %FF.remain %FF.remain #3 }
  152.   if ( %FF.a4 != $null ) { set %FF.remain %FF.remain #4 }
  153.   if ( %FF.a5 != $null ) { set %FF.remain %FF.remain #5 }
  154.   if ( %FF.a6 != $null ) { set %FF.remain %FF.remain #6 }
  155.   if ( %FF.a7 != $null ) { set %FF.remain %FF.remain #7 }
  156.   if ( %FF.a8 != $null ) { set %FF.remain %FF.remain #8 }
  157.   msg %chanFF %FF.remain
  158. }
  159.  
  160.  
  161. on *:TEXT:!ff*:%chanFF:{
  162.   if ($nick isop $chan) {
  163.     if ($2 != $null) { FFstart $nick $chan $2 }
  164.     else { FFstart $nick $chan 1 }
  165.   }
  166.   else {
  167.     msg $chan Sorry $nick $+ , you need to be an op to start Family Feud.
  168.   }
  169. }
  170.  
  171. alias FFstart {
  172.   if ( %FF.on != 2 ) {
  173.     msg %chanFF A game has been started by $1
  174.     set %FF.answerz 0
  175.     set %FF.on 2
  176.     set %FF.roundsplayed 1
  177.     if ($3 == unlimited) { unset %FF.roundsplayed }
  178.     else { set %FF.rounds $3 }
  179.     game
  180.   }
  181.   else { .msg $1 The game's already going, maybe you should try answering some questions now. }
  182. }
  183.  
  184. on *:TEXT:!ffstop:%chanFF:{
  185.   if ($nick isop $chan) {
  186.     FFstop $nick $chan
  187.   }
  188.   else {
  189.     msg $chan Sorry $nick $+ , you need to be an op to start Family Feud.
  190.   }
  191. }
  192.  
  193. alias FFstop {
  194.   if ( %FF.on == 2 ) {
  195.     if ($1 != $null) msg %chanFF Game stopped by $1 $+ .
  196.     else msg %chanFF Game over!
  197.     buildscores
  198.     msg %chanFF %FF.scoreoutput
  199.     .timer1 off
  200.     .timer2 off
  201.     .timer3 off
  202.     unset %FF.*
  203.   }
  204.   else { .msg $1 The game is not on. }
  205. }
  206.  
  207. on *:TEXT:!ffscore:%chanFF:{
  208.   if ( %FF.on == 2 && %chanFF == $chan ) {
  209.     if ( %FF.score. [ $+ [ $nick ] ] != $null ) {
  210.       .msg $nick Your score is %FF.score. [ $+ [ $nick ] ] $+ .
  211.     }
  212.     else {
  213.       .msg $nick Your score is 0.
  214.     }
  215.   }
  216.   else {
  217.     .msg $nick There's no game going on, dumbass.
  218.   }
  219. }
  220.  
  221.  
  222.  
  223. ;Text events for all 8 answers
  224.  
  225. on *:TEXT:%FF.a1:%chanFF:{
  226.   msg %chanFF Survey says, 50 points! $nick got the #1 answer, %FF.a1 $+ !
  227.   inc %FF.score. [ $+ [ $nick ] ] 50
  228.   unset %FF.a1
  229.   set %FF.answerz %FF.answerz + 1
  230.   check %FF.answerz
  231. }
  232.  
  233. on *:TEXT:%FF.a2:%chanFF:{
  234.   msg %chanFF Survey says, 35 points! $nick got the #2 answer, %FF.a2 $+ !
  235.   inc %FF.score. [ $+ [ $nick ] ] 35
  236.   unset %FF.a2
  237.   set %FF.answerz %FF.answerz + 1
  238.   check %FF.answerz
  239. }
  240.  
  241. on *:TEXT:%FF.a3:%chanFF:{
  242.   msg %chanFF Survey says, 28 points! $nick got the #3 answer, %FF.a3 $+ !
  243.   inc %FF.score. [ $+ [ $nick ] ] 28
  244.   unset %FF.a3
  245.   set %FF.answerz %FF.answerz + 1
  246.   check %FF.answerz
  247. }
  248.  
  249. on *:TEXT:%FF.a4:%chanFF:{
  250.   msg %chanFF Survey says, 20 points! $nick got the #4 answer, %FF.a4 $+ !
  251.   inc %FF.score. [ $+ [ $nick ] ] 20
  252.   unset %FF.a4
  253.   set %FF.answerz %FF.answerz + 1
  254.   check %FF.answerz
  255. }
  256.  
  257. on *:TEXT:%FF.a5:%chanFF:{
  258.   msg %chanFF Survey says, 15 points! $nick got the #5 answer, %FF.a5 $+ !
  259.   inc %FF.score. [ $+ [ $nick ] ] 15
  260.   /unset %FF.a5
  261.   set %FF.answerz %FF.answerz + 1
  262.   check %FF.answerz
  263. }
  264.  
  265. on *:TEXT:%FF.a6:%chanFF:{
  266.   msg %chanFF Survey says, 10 points! $nick got the #6 answer, %FF.a6 $+ !
  267.   inc %FF.score. [ $+ [ $nick ] ] 10
  268.   unset %FF.a6
  269.   set %FF.answerz %FF.answerz + 1
  270.   check %FF.answerz
  271. }
  272.  
  273. on *:TEXT:%FF.a7:%chanFF:{
  274.   msg %chanFF Survey says, 8 points! $nick got the #7 answer, %FF.a7 $+ !
  275.   inc %FF.score. [ $+ [ $nick ] ] 8
  276.   unset %FF.a7
  277.   set %FF.answerz %FF.answerz + 1
  278.   check %FF.answerz
  279. }
  280.  
  281. on *:TEXT:%FF.a8:%chanFF:{
  282.   msg %chanFF Survey says, 5 points! $nick got the #8 answer, %FF.a8 $+ !
  283.   inc %FF.score. [ $+ [ $nick ] ] 5
  284.   unset %FF.a8
  285.   set %FF.answerz %FF.answerz + 1
  286.   check %FF.answerz
  287. }
  288.  
  289.  
  290. alias buildscores {
  291.   set %FF.count 0
  292.   set %FF.added 0
  293.   set %FF.totalnicks $nick(%chanFF,0,a)
  294.   set %FF.highest 0
  295.   set %FF.highestnick $me
  296.   set %FF.x $var(%FF.score.*, 0)
  297.   set %FF.scoreoutput Scores:
  298.   while (%FF.added < %FF.x) {
  299.     while (%FF.count <= %FF.totalnicks) {
  300.       set %FF.testnick $nick(%chanFF,%FF.count,a)
  301.       if (%FF.score. [ $+ [ %FF.testnick ] ] != $null) && (%FF.score. [ $+ [ %FF.testnick ] ] >= %FF.highest) && (%FF.testnick !isin %FF.scoreoutput) {
  302.         set %FF.highest %FF.score. [ $+ [ %FF.testnick ] ]
  303.         set %FF.highestnick %FF.testnick
  304.       }
  305.       inc %FF.count
  306.     }
  307.     if (%FF.highest != 0) { set %FF.scoreoutput %FF.scoreoutput $+ %FF.highestnick $+ : %FF.highest $+ $chr(124) }
  308.     set %FF.highest 0
  309.     set %FF.highesttnick $me
  310.     inc %FF.added
  311.     set %FF.count 0
  312.   }
  313.   set %FF.chop $calc($len(%FF.scoreoutput) - 1)
  314.   set %FF.scoreoutput $left(%FF.scoreoutput,%FF.chop)
  315.   if (%FF.scoreoutput == Scores:) set %FF.scoreoutput Nobody has any points!
  316. }
  317.  
  318.  
  319. ;Checks to see if all answers have been said before time limit is up
  320. alias check {
  321.   if ( $1 == %FF.dashes ) {
  322.     .timer1 off
  323.     .timer3 off
  324.     game2
  325.   }
  326. }
  327.  
  328.  
  329. ;Accounts for nickname changes mid-game.
  330. on *:NICK:{
  331.   if ( %FF.score. [ $+ [ $nick ] ] != $null ) {
  332.     set %FF.score. [ $+ [ $newnick ] ] %FF.score. [ $+ [ $nick ] ]
  333.     unset %FF.score. [ $+ [ $nick ] ]
  334.   }
  335. }
  336.  
  337. ;msgs the scores of players in the channel in order to the person that said !scores
  338. on *:TEXT:!ffscores:%chanFF:{
  339.   buildscores
  340.   .msg $nick %FF.scoreoutput
  341. }
  342.  
  343. ;If you have another feature you would like to see, let me know and I'll add it if possible!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement