All pastes #142450 Raw Edit

Guess Script

public text v1 · immutable
#142450 ·published 2006-08-21 13:34 UTC
rendered paste body
+++++++++++++++++++++++++++ Guessing Script ++++++++++++++++++
on *:text:!startguess:#: {
  if (%guess == off) {
    set %guess on
    msg $chan 4Starting guessing game by Kakarot6. All numbers are between 1 and 100.
    set %guessnumber $rand(1,3)
    if ($rand(1,3) == 1) /set %guessnumber 1
    if ($rand(1,3) == 2) /set %guessnumber 2
    if ($rand(1,3) == 3) /set %guessnumber 3
  }
  elseif (%guess == on) {
    msg $chan 4There is allready an active guessing game on.
  }
}
on *:text:!tryguess *:#: {
  if (%guess == on) && ($2 == %guessnumber) {
    msg $chan 4You got the right number, $nick ! Way to go.
    set %guessnumber $rand(1,3)
    if ($rand(1,3) == 1) /set %guessnumber 1
    if ($rand(1,3) == 2) /set %guessnumber 2
    if ($rand(1,3) == 3) /set %guessnumber 3
  }
  if (%guess == on) && ($2 != %guessnumber) {
    if ($2 < %guessnumber) {
      msg $chan 4You got the wrong number, $nick . The right answer is higher.
    }
    if ($2 > %guessnumber) {
      msg $chan 4You got the wrong number, $nick . The right answer is lower.
    }
  }
  if (%guess == off) {
    msg $chan 4Guess game not activated. Type !startguess .
  }
}
on *:text:!stopguess:#:{
  if (%guess == on) {
    set %guess off
    msg $chan 4Guess game disabled. Type !startguess to enable.
  }
  elseif (%guess == off) {
    msg $chan 4Guess game is allready disabled. Type !startguess to enable.
  }
}