My number Guessing Game

By LizardKing on Aug 07, 2008

Alright, this is pretty much my 1st script. It's not perfect but it works well enough.
This was made as a game for a channel were the access list was cleared. I tried making it where when you typed !Join GG you were assigned %gg.1, or %gg.2 all the way up to 10 players. But that didn't work out for me.

To start a game- !Guessgame
To join the game- !Join GG (Or Voiced)
To guess- !Guess #
To end the game prematurely- !GGend

on *:TEXT:!guessgame:#: {
  if (%ggo == on ) {
    notice $nick A guessing game is already taking place, please wait until it is over.
    halt
  }
  else {
    set %numbanumba %numberr $rand(1,100)
    set %ggo on
    set %ggo2 on
    msg $chan 3 $+ The Guessing game is on! The number is 1-100, get guessing.
    msg $chan 3 $+ To join type: !join gg. You have 30 seconds to join.
    timer1 1 30 set %ggo2 off
    timer2 1 30 msg $chan 3 $+ The game is started!
    halt
  }
}
on *:Text:!Join gg:#: {
  if ($nick isvoice # ) {
    notice $nick You are already playing or you are already voiced.
    halt
   }
  if (%ggo2 == off ) {
    notice $nick Sorry, you are too late.
  halt }
  else {
    mode #zeppelin382 +v $nick
    msg $chan 3 $+ $nick has joined.
    halt
  }

}

on *:Text:!guess*:#: {
  if (%ggo == $null ) {
    notice $nick There is no game currently playing.
    halt
  }
  elseif (%gg02 == on ) {
    notice $nick Game hasn't officially started yet. Please wait.
    halt
  }
  if ($nick isvoice # ) {
    if ($2 == %numbanumba ) {
      msg $chan 3 $+ $nick got it right!
      msg $chan 3 $+ $nick wins the game
      set %ggo off
      unset %ggo2
      timer1 off
      timer2 off
      unset %numbanumba
      mode $chan +h $nick
      mode $chan -v $nick
      notice $nick Please refrain from playing as you have already advanced to the next round.
      halt
    }
    if ( $2 < %numbanumba ) /describe $chan 3 Sorry, $nick you are too low.
    if ( $2 > %numbanumba ) /describe $chan 3 Sorry, $nick you are too high.
  }
  else {
    notice $nick You are not playing.
    halt
  }
  elseif ($nick ishop # )
  notice $nick Please refrain from playing.
  halt
}
on *:text:!ggend:#: {
if (%ggo == off ) {
  notice $nick There is no game to end.
  halt
  }
  else ($nick isop # || $nick == Saint_Joe ) {
    set %ggo off
    unset %ggo2
    timer1 off
    timer2 off
    unset %numbanumba
    msg $chan 3 $+ The guessing game has been ended.
    halt
  }
}

Comments

Sign in to comment.
Fuzion   -  Aug 08, 2008

another guessing game :S isnt there like 50 of these on this site

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.