All pastes #900884 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-12 07:33 UTC
rendered paste body
on *:TEXT:.trivia:#rspc-staff: {
  if (%trivia [ $+ [ $chan ] ] != on) {
    set %trivia [ $+ [ $chan ] ] on
    msg $chan Trivia in2 $chan is now turned on.
    .timer 1 5 question $chan
  halt }
  if (%trivia [ $+ [ $chan ] ] == on) {
    unset %*
    msg $chan Trivia in2 $chan is now turned off.
    .timers off
  }
}
alias question {
  set %trivia [ $+ [ $1 ] ] on
  set %question [ $+ [ $1 ] ] $r(1,2)
  msg $1 [2Question]2 $readini(trivia.ini,questions,%question [ $+ [ $1 ] ]) You have 0230 seconds to answer.
  msg $1 [2Hint] $readini(trivia.ini,hints,%question [ $+ [ $1 ] ])
  .timer 1 30 over $1
}
alias over {
  msg $1 Time's up! The answer was2 $readini(trivia.ini,answers,%question [ $+ [ $1 ] ]) $+ .
  msg $1 10 seconds until the next question.
  timers off
  unset %*
  .timer 1 10 question $1
}
on *:TEXT:*:#rspc-staff: {
  if (%trivia [ $+ [ $chan ] ] == on) {
    if ($readini(trivia.ini,answers,%question [ $+ [ $chan ] ]) == $1-) {
      if ($readini(trivia.ini,points,$nick) == $null) { writeini trivia.ini points $nick 0 }
      writeini trivia.ini points $nick $calc($readini(trivia.ini,points,$nick) + 500)
      msg $chan [2Answer]2 $nick was right!2 $nick gains 02500 points, and has a total of2 $readini(trivia.ini,points,$nick) points.
      msg $chan 10 seconds until the next question.
      unset %*
      timers off
      .timer 1 10 question $chan
    }
  } 
}
on *:TEXT:.points*:#rspc-staff: {
  if ($readini(trivia.ini,points,$nick) == $null) { writeini trivia.ini points $nick 0 }
  if ($readini(trivia.ini,points,$nick != $null) {
    msg $chan 2 $+ $2 now has $readini(trivia.ini,points,$nick) points.
  }
}