Another Number guessing Game

By jonypaul on Jun 23, 2006

Well i'm here again...sorry for releasing so many snippets at the same time...but i had lots of ideas that thx to this site i could really do. This is another number guessing game, but with one difference:
Unlike the others, you cant always be guessing, so you've got to wait some time between two guesses...anyway, just copy this onto remotes and then right click the channel.
Well in this code i nearly dont take credit...credit goes to all the other ppl who posted previous versions of number guessing games and do the folks that helped me on the forum, and told me the stuff i needed to do this...
P.S. as usual i tested it, looks ok, but might still have bugs...so...you know where to find me

on *:TEXT:!on-nguess:%nguesschan:{
  /inc %guessgame 1
  /set %starter $nick
  /set %game on
  /set %number $rand(1,100)
  /describe $chan 7The game is now ON. To play, type !nguess <number>. The Secret Number can be between 0 and 100. This is game number %guessgame 
}
on *:TEXT:!nguess*:%nguesschan:{   
  if (on isin %game) {
    if ( $nick !isin %variable ) {      
      if ( $2 < %number ) /describe $chan  $2 is too low...( Last Winner was: %winner This is game number: %guessgame )
      if ( $2 > %number ) /describe $chan  $2 is too high...( Last Winner was: %winner This is game number: %guessgame )
      if ( $2 == %number ) { 
        /msg $chan 7Wowowowow $nick $+ !! That is right! The secret number was %number $+ .Now, type !on-nguess to start a new one.
        /mode $chan %prize $nick
        /set %winner $nick        
        /set %game off
      }
    }
    if ( $nick isin %variable ) /notice $nick Sorry, you are only allowed to guess once in every %waitingtime seconds.
    /set %variable $addtok(%variable,$nick,32)
    timer 1 %waitingtime set %variable $!remtok(%variable, $nick ,1,32)
    timer 1 %waitingtime2 describe $chan $nick can now play...
  }    
  if ( on !isin %game ) /describe $chan 7For the moment the game isn't on...to set the game on, type !on-nguess
}  
on 1:TEXT:!off-nguess:%nguesschan:{
  if ( $nick isin %starter ) {
    /msg $chan 7Guessing Game Has Been Stopped By $nick $+ ...The correct number was %number
    /unset %guess
  }
  if ( $nick !isin %starter ) /notice $nick You didn't start this game...so you cant stop it!
}

menu channel {
  .Number Guess
  ..Options
  ...Set Channel:/set %nguesschan $?="Enter the channel where the game is to be played. Ex: #YourChan"
  ...Show Nicks that can't play:/describe $chan 7Current players that can't guess: %variable
  ...Show correct number:/describe $chan 7The correct number is: %number
  ...Show Waiting time:/describe $chan 7You must wait %waitingtime secs between two guesses. 
  ...Set prize:/set %prize $?="Enter the prize for the person who gets the number right ( possible: +v/-v/+h/-h/+o/-o/+a/-a/+q/-q etc. )" 
  ...Set Waiting time for warning:/set %waitingtime2 $?="Set the time for the warning ( normally 1 sec more than the waiting time )"
  ...Set Waiting time:/set %waitingtime $?="Enter the number of seconds between guesses (example: 300)"
}

Comments

Sign in to comment.
jonypaul   -  Jul 29, 2006

Well just remember to SET the waiting times first so that this works

 Respond  
Sasuke   -  Jul 05, 2006

<.<

 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.