Administrators chain Posted March 31 Administrators Report Share Posted March 31 ;;;Trivia by SlipknoT aka StonedStoner;;; ;;;Commands;;; ;!trivia - Start Trivia game ;!strivia - Stop current game ;!top5 - see the top 5 of weekor month ;example: !top5 week or !top5 month ;!reset - resets score specified ;example: !reset week or !reset month :*****DO NOT FORGET TO PUT YOUR NICK WHERE MasterNick IS!*****; on *:TEXT:*:#Trivia: { set %triv.text $strip($1-,c) if (%triv.text == !trivia) { trivia 0 } if (%trivia == on) { if ($1 == !top5) { top5 $2 } if (%triv.text == !strivia) { set %trivia off } if (%triv.text == %trivia.a) { if (%answered == yes) { halt } set %answered yes .timer 1 5 trivia.next trivia.answered $nick unset %trivia.a set %trivia.qn $calc(%trivia.qn + 1) } } if ($nick == MasterNick) { if ($1 == !reset) { reset $2 } } } alias trivia.answered { if ($1 == $null) { halt } else { set %trivia.week.add %trivia.week. [ $+ [ $1 ] ] set %trivia.month.add %trivia.month. [ $+ [ $1 ] ] set %trivia.week. [ $+ [ $1 ] ] $calc(%trivia.p + %trivia.week.add) set %trivia.month. [ $+ [ $1 ] ] $calc(%trivia.p + %trivia.month.add) msg #Trivia $trivtalk(CORRECT!) $+ 4 $1 $trivtalk(got the answer:) $+ 4 %trivia.a $trivtalk(In:) $+ 4 $duration($calc($ctime - %trivia.el)) $+ 14!4 $1 $trivtalk(is awarded:) $+ 4 %trivia.p 14. $trivtalk(Total Points This Week:) $+ 4 %trivia.week. [ $+ [ $1 ] ] $trivtalk(Total Points This Month:) $+ 4 %trivia.month. [ $+ [ $1 ] ] if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.1) { if ($readini(trivia.ini, week, 1) == $1) { set %trivia.week.1 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) { set %trivia.week.2 %trivia.week.1 set %trivia.week.1 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 2 $readini(trivia.ini, week, 1) writeini -s trivia.ini week 1 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this weeks) $+ 4 #1 P14layer! top5 week goto month } } if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.2) { if ($readini(trivia.ini, week, 2) == $1) { set %trivia.week.2 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) && ($readini(trivia.ini, week, 2) !== $1) { set %trivia.week.3 %trivia.week.2 set %trivia.week.2 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 3 $readini(trivia.ini, week, 2) writeini -s trivia.ini week 2 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this weeks) $+ 4 #2 P14layer! top5 week goto month } } if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.3) { if ($readini(trivia.ini, week, 3) == $1) { set %trivia.week.3 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) && ($readini(trivia.ini, week, 2) !== $1) && ($readini(trivia.ini, week, 3) !== $1) { set %trivia.week.4 %trivia.week.3 set %trivia.week.3 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 4 $readini(trivia.ini, week, 3) writeini -s trivia.ini week 3 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this weeks) $+ 4 #3 P14layer! top5 week goto month } } if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.4) { if ($readini(trivia.ini, week, 4) == $1) { set %trivia.week.4 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) && ($readini(trivia.ini, week, 2) !== $1) && ($readini(trivia.ini, week, 3) !== $1) && ($readini(trivia.ini, week, 4) !== $1) { set %trivia.week.5 %trivia.week.4 set %trivia.week.4 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 5 $readini(trivia.ini, week, 4) writeini -s trivia.ini week 4 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this weeks) $+ 4 #4 P14layer! top5 week goto month } } if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.5) { if ($readini(trivia.ini, week, 5) == $1) { set %trivia.week.5 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) && ($readini(trivia.ini, week, 2) !== $1) && ($readini(trivia.ini, week, 3) !== $1) && ($readini(trivia.ini, week, 4) !== $1) && ($readini(trivia.ini, week, 5) !== $1) { set %trivia.week.6 %trivia.week.5 set %trivia.week.5 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 5 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this weeks) $+ 4 #5 P14layer! top5 week goto month } } if (%trivia.week. [ $+ [ $1 ] ] > %trivia.week.6) { if ($readini(trivia.ini, week, 6) !== $1) { set %trivia.week.6 %trivia.week. [ $+ [ $1 ] ] goto month } if ($readini(trivia.ini, week, 1) !== $1) && ($readini(trivia.ini, week, 2) !== $1) && ($readini(trivia.ini, week, 3) !== $1) && ($readini(trivia.ini, week, 4) !== $1) && ($readini(trivia.ini, week, 5) !== $1) && ($readini(trivia.ini, week, 6) !== $1) { set %trivia.week.6 %trivia.week. [ $+ [ $1 ] ] writeini -s trivia.ini week 6 $1 goto month } } :month if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.1) { if ($readini(trivia.ini, month, 1) == $1) { set %trivia.month.1 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) { set %trivia.month.2 %trivia.month.1 set %trivia.month.1 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 2 $readini(trivia.ini, month, 1) writeini -s trivia.ini month 1 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this months) $+ 4 #1 P14layer! top5 month halt } } if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.2) { if ($readini(trivia.ini, month, 2) == $1) { set %trivia.month.2 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) && ($readini(trivia.ini, month, 2) !== $1) { set %trivia.month.3 %trivia.month.2 set %trivia.month.2 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 3 $readini(trivia.ini, month, 2) writeini -s trivia.ini month 2 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this months) $+ 4 #2 P14layer! top5 month halt } } if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.3) { if ($readini(trivia.ini, month, 3) == $1) { set %trivia.month.3 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) && ($readini(trivia.ini, month, 2) !== $1) && ($readini(trivia.ini, month, 3) !== $1) { set %trivia.month.4 %trivia.month.3 set %trivia.month.3 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 4 $readini(trivia.ini, month, 3) writeini -s trivia.ini month 3 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this months) $+ 4 #3 P14layer! top5 month halt } } if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.4) { if ($readini(trivia.ini, month, 4) == $1) { set %trivia.month.4 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) && ($readini(trivia.ini, month, 2) !== $1) && ($readini(trivia.ini, month, 3) !== $1) && ($readini(trivia.ini, month, 4) !== $1) { set %trivia.month.5 %trivia.month.4 set %trivia.month.4 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 5 $readini(trivia.ini, month, 4) writeini -s trivia.ini month 4 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this months) $+ 4 #4 P14layer! top5 month halt } } if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.5) { if ($readini(trivia.ini, month, 5) == $1) { set %trivia.month.5 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) && ($readini(trivia.ini, month, 2) !== $1) && ($readini(trivia.ini, month, 3) !== $1) && ($readini(trivia.ini, month, 4) !== $1) && ($readini(trivia.ini, month, 5) !== $1) { set %trivia.month.6 %trivia.month.5 set %trivia.month.5 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 5 $1 msg #Trivia $trivtalk(Congrats!) $+ 4 $1 $trivtalk(is now this months) $+ 4 #5 P14layer! top5 month halt } } if (%trivia.month. [ $+ [ $1 ] ] > %trivia.month.6) { if ($readini(trivia.ini, month, 6) !== $1) { set %trivia.month.6 %trivia.month. [ $+ [ $1 ] ] halt } if ($readini(trivia.ini, month, 1) !== $1) && ($readini(trivia.ini, month, 2) !== $1) && ($readini(trivia.ini, month, 3) !== $1) && ($readini(trivia.ini, month, 4) !== $1) && ($readini(trivia.ini, month, 5) !== $1) && ($readini(trivia.ini, month, 6) !== $1) { set %trivia.month.6 %trivia.month. [ $+ [ $1 ] ] writeini -s trivia.ini month 6 $1 halt } } } } alias trivia { if (%trivia == on) { HALT } else { if ($1 == 0) { set %trivia.max un set %trivia on set %trivia.qn 1 msg #Trivia $trivtalk(Trivia is now on! Get ready!) .timer 1 5 trivia.next } } } alias trivia.next { if (%trivia = off) { msg #Trivia $trivtalk(End of Round! Stopping Trivia.) halt } else { set %trivia.rand $rand(1,$lines(trivia.txt)) set %trivia.n $read(trivia.txt,%trivia.rand) set %trivia.q $gettok($read(trivia.txt,%trivia.rand),1,42) set %trivia.a $gettok($read(trivia.txt,%trivia.rand),2,42) set %trivia.h1 $trivhint(%trivia.a,2,*) set %trivia.h2 $trivhint(%trivia.a,3,*) set %trivia.h3 $trivhint(%trivia.a,4,*) set %trivia.p $rand(15,20) unset %trivia.n msg #Trivia 4[15 $+ %trivia.qn $+ 4]15 4[ $+ %trivia.rand 15/4 $lines(trivia.txt) $+ 4] [15 $+ %trivia.q $+ 4] 4[ $+ $trivtalk(Worth) $+ 4 %trivia.p 4P14oints4] set %trivia.el $ctime unset %answered .timerhint1 1 10 hint1 .timerhint2 1 20 hint2 .timerhint3 1 30 hint3 .timerq 1 40 trivia.unanswered } } alias trivia.unanswered { if (%answered == yes) { halt } msg #trivia $trivtalk(Question unanswered Answer was:) $+ 4 %trivia.a unset %trivia.a set %trivia.qn $calc(%trivia.qn + 1) .timer 1 5 trivia.next } alias top5 { if ($1 == week) { msg #trivia $trivtalk(Top 5 players of the week are 1st:) $+ 4 $readini(trivia.ini, week, 1) %trivia.week. [ $+ [ $readini(trivia.ini, week, 1) ] ] $+ , $trivtalk(2nd:) $+ 4 $readini(trivia.ini, week, 2) %trivia.week. [ $+ [ $readini(trivia.ini, week, 2) ] ] $+ , $trivtalk(3rd:) $+ 4 $readini(trivia.ini, week, 3) %trivia.week. [ $+ [ $readini(trivia.ini, week, 3) ] ] $+ , $trivtalk(4th:) $+ 4 $readini(trivia.ini, week, 4) %trivia.week. [ $+ [ $readini(trivia.ini, week, 4) ] ] $+ , $trivtalk(5th:) $+ 4 $readini(trivia.ini, week, 5) %trivia.week. [ $+ [ $readini(trivia.ini, week, 5) ] ] } if ($1 == month) { msg #trivia $trivtalk(Top 5 players of the month are 1st:) $+ 4 $readini(trivia.ini, month, 1) %trivia.month. [ $+ [ $readini(trivia.ini, month, 1) ] ] $+ , $trivtalk(2nd:) $+ 4 $readini(trivia.ini, month, 2) %trivia.month. [ $+ [ $readini(trivia.ini, month, 2) ] ] $+ , $trivtalk(3rd:) $+ 4 $readini(trivia.ini, month, 3) %trivia.month. [ $+ [ $readini(trivia.ini, month, 3) ] ] $+ , $trivtalk(4th:) $+ 4 $readini(trivia.ini, month, 4) %trivia.month. [ $+ [ $readini(trivia.ini, month, 4) ] ] $+ , $trivtalk(5th:) $+ 4 $readini(trivia.ini, month, 5) %trivia.month. [ $+ [ $readini(trivia.ini, month, 5) ] ] } } ;Made by FiberOptics alias trivhint { var %a, %b = $regsub($1,/(?<=\S{ $+ $2})\S/g,$replace($$3,\,\\,$,\$),%a) return %a } ; alias hint1 { if (%answered == yes) { halt } else { msg #Trivia 4[15 $+ %trivia.qn $+ 4] $trivtalk(Hint One:) $+ 4 %trivia.h1 } } alias hint2 { if (%answered == yes) { halt } else { msg #Trivia 4[15 $+ %trivia.qn $+ 4] $trivtalk(Hint Two:) $+ 4 %trivia.h2 } } alias hint3 { if (%answered == yes) { halt } else { msg #Trivia 4[15 $+ %trivia.qn $+ 4] $trivtalk(Hint Three:) $+ 4 %trivia.h3 } } ;did not make this talker; alias trivtalk { var %c1 4 var %c2 14 tokenize 32 $1- var %i $0,%t,%b = $iif(%b,$chr(2)),%u = $iif(%u,$chr(31)) while %i { var %w $ [ $+ [ %i ] ],%t = $+($chr(3),$base(%c1,10,10,2),$replace($left(%w,1),a, A,b, B,c, C,d, D,e, E,f, F,g, G,h, H,i, I,j, J,k, K,l, L,m, M,n, N,o, O,p, P,q, Q,r, R,s, S,t, T,u, U,v, V,w, W,x, X,y, Y,z, Z,[, 4[,], 4]),$chr(3),$base(%c2,10,10,2),%u,%b,$replace($mid(%w,2),:, 15:,!, 15!),$chr(15)) %t dec %i } return %t } ;not sure where i got it but if someone knows tell me and i will give credit; alias reset { if ($1 == week) { .timerresetweek -o 0 604800 reset week unset %trivia.week.* set %trivia.week.1 0 set %trivia.week.2 0 set %trivia.week.3 0 set %trivia.week.4 0 set %trivia.week.5 0 set %trivia.week.6 0 writeini trivia.ini week 1 none writeini trivia.ini week 2 none writeini trivia.ini week 3 none writeini trivia.ini week 4 none writeini trivia.ini week 5 none writeini trivia.ini week 6 none } if ($1 == month) { unset %trivia.month.* set %trivia.month.1 0 set %trivia.month.2 0 set %trivia.month.3 0 set %trivia.month.4 0 set %trivia.month.5 0 set %trivia.month.6 0 writeini trivia.ini month 1 none writeini trivia.ini month 2 none writeini trivia.ini month 3 none writeini trivia.ini month 4 none writeini trivia.ini month 5 none writeini trivia.ini month 6 none } } on *:JOIN:#trivia: { if (%trivia.month. [ $+ [ $nick ] ] <= 1) { notice $nick $trivtalk(welcome to $chan $nick $+ . it's time for you to start gettin points so get to it!) } elseif (%trivia.month. [ $+ [ $nick ] ] > 0) { notice $nick $trivtalk(welcome back $nick $+ . you have) $+ 4 %trivia.week. [ $+ [ $nick ] ] $trivtalk(points this week. and) $+ 4 %trivia.month. [ $+ [ $nick ] ] $trivtalk(points this month.) if ($readini(trivia.ini, week, 1) == $nick) { mode # +o $nick } if ($readini(trivia.ini, week, 2) == $nick) { mode # +v $nick } if ($readini(trivia.ini, week, 3) == $nick) { mode # +v $nick } if ($readini(trivia.ini, week, 4) == $nick) { mode # +v $nick } if ($readini(trivia.ini, week, 5) == $nick) { mode # +v $nick } } } on *:disconnect: { set %trivia off } on *:exit: { set %trivia off } Quote Link to comment Share on other sites More sharing options...