All pastes #142470 Raw Edit

Something

public text v1 · immutable
#142470 ·published 2006-08-21 13:46 UTC
rendered paste body
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 already 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
  }
  elseif (%guess == on) && ($2 != %guessnumber) {
    if ($2 < %guessnumber) msg $chan 4You got the wrong number, $nick . The right answer is higher.
    elseif ($2 > %guessnumber) msg $chan 4You got the wrong number, $nick . The right answer is lower.
  }
  elseif (%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.
}