All pastes #799816 Raw Edit

Stuff

public text v1 · immutable
#799816 ·published 2007-11-27 21:57 UTC
rendered paste body
code:

on *:text:!setowner*:#:{
  if ($nick == seen) {
    set %owner $2
    msg $chan 2 The person who can change commands has been set to %owner
  }
}

on *:text:!addquestion*:#:{
  if ($nick == %owner || $address($nick,2) == $address($me,2)) {
    /write trivia.txt $2-
    msg $chan 2 A new question has been added to my trivia!
  }
}

on *:text:!trivia*:%chans:{
  if (%trivia = $Null) {
    msg $chan 2 Trivia has been started you have 30 seconds to reply.
    set %thing $read(trivia.txt)  
    set %question $gettok(%thing,1,124)
    set %trivia on
    set %answer $gettok(%thing,4,124)
    set %chan #
    .timer1 1 15 msg $chan 4[-HINT-]:2 $gettok(%thing,2,124)
    .timer2 1 25 msg $chan 4[-HINT-]:2 $gettok(%thing,3,124)
    .timer3 1 35 wrong
    haltdef
  }
  else notice $nick Trivia is already in action stupid!
}

alias wrong {
  if (%trivia == on) {
    msg %chan 12You Failed To Answer The Question! next Question in4 5 12seconds!
    unset %answer
    unset %question
    unset %thing  
    .timer 1 5 new
    haltdef
  }
}

alias new {
  if (%trivia == on) {
    set %thing $read(trivia.txt)
    set %question $gettok(%thing,1,124)
    set %trivia on
    set %answer $gettok(%thing,4,124)
    msg %chan 12New Question:4 %question
    .timer1 1 15 msg $chan 4[-HINT-]:2 $gettok(%thing,2,124)
    .timer2 1 25 msg $chan 4[-HINT-]:2 $gettok(%thing,3,124)
    .timer3 1 35 wrong
    haltdef
  }
}

on *:text:*:%chans: {
  if ($1 == %answer) {
    .timer3 off
    .timer1 off
    .timer2 off
    msg %chan 2Well done $Nick ! thats right:4 $+(%answer,!)$+ $+(2,$nick)$+ 4Has2 %score [ $+ [ $nick ] ] Point(s)!
    inc %score [ $+ [ $nick ] ]
    unset %answer
    unset %question
    unset %thing
    .timer 1 5 new
    haltdef
  }
  if ($1 == !STOP) {
    msg %chan 2Trivia Has Been Halted!
    .timer1 off
    .timer2  off
    .timer3 off
    .timer4 off
    unset %trivia
    unset %answer
    unset %question
    unset %thing
    haltdef
  }
  if ($1 == !points) {
    if (%score [ $+ [ $nick ] ] == $null) {
      notice $nick You Have 0 Points
    }
    elseif (%score [ $+ [ $nick ] ] != $null) {
      notice $nick You Have %score [ $+ [ $nick ] ] Points! get 50+ for halfop and 100+ for op
    }
  }
}

on *:join:%chans: {
  if ($me isop #) {
    if (%score [ $+ [ $nick ] ] > 49) && (%score [ $+ [ $nick ] ] < 99) {
      mode # +h $nick
    }
    elseif (%score [ $+ [ $nick ] ] > 99) {
      mode # +o $nick
    }
    elseif (%score [ $+ [ $nick ] ] == $null) {
      msg $chan 2Welcome to4 $chan 2Type !trivia to play the Trivia Rpg, Type !stop to stop The game
    }
  }
}

on *:text:!setchan*:#:{ 
  if ($nick isop $chan) {
    set %chans $2
    msg $chan 2 The trivia channel has been set to %chans
  }
}