Simple Channel Number Game

By [M]ike on Jan 22, 2007

Load the script then type !Ngame in a channel to activate the "game". From there type !guess to guess the number. Upon guessing wrong you will be given a hint whether to guess higher or lower. Very simple script I made in a matter of minutes.

Update:
You can play through mIRC now by using /startgame and /guess

Can also retrieve the answer easier by typing /answer (Only use when your not playing because it obviously spoils the game :P)

//Number Game Script by [M]ike
//For Hawkee.com

on *:TEXT:!ngame:#: {
  if (%numgame [ $+ [ $chan ] ] != $null) {
    notice $nick A Number Game Is Already Running In $chan $+ ! Use !Guess Number To Guess A Number
  }
  else {
    set %numgame [ $+ [ $chan ] ] on
    msg $chan 7Random Number Game Started! The Number Is Between 1-200, Use !Guess Number To Guess A Number!
    set %num [ $+ [ $chan ] ] $rand(1,200)
  }
}
on *:TEXT:!guess*:#: {
  if (%numgame [ $+ [ $chan ] ] != on) {
    notice $nick There is no active number game in $chan $+ ! Use !Ngame to start one!
  }  
  elseif ($2 !isnum) {
    notice $nick " $+ $2 $+ " Is Not A Number.. Enter A Valid Number
  }
  elseif ($2 > 200) {
    notice $nick The Maximum Number Is 200, Guess A Lower Number
  }
  elseif ($2 != %num [ $+ [ $chan ] ]) && ($2 > %num [ $+ [ $chan ] ]) {
    msg $chan 7 $nick Was Wrong! Keep Guessing! 4Try A Lower Number!
  }
  elseif ($2 != %num [ $+ [ $chan ] ]) && ($2 < %num [ $+ [ $chan ] ]) {
    msg $chan 7 $nick Was Wrong! Keep Guessing! 4Try A Higher Number!
  }
  elseif ($2 == %num [ $+ [ $chan ] ])  {
    msg $chan 4 $nick Got It Right! The Answer Was $2 $+ ! Type !Ngame to play again.
    unset %num [ $+ [ $chan ] ]
    unset %numgame [ $+ [ $chan ] ]
  }
}

//Aliases so you can play through mIRC but with the channel, use /startgame and /guess <number>
alias startgame {
  if (%numgame [ $+ [ $active ] ] != $null) {
    echo -a A Number Game Is Already Running In $chan $+ ! Use !Guess Number To Guess A Number
  }
  else {
    set %numgame [ $+ [ $active ] ] on
    msg $active 7Random Number Game Started! The Number Is Between 1-200, Use !Guess Number To Guess A Number!
    set %num [ $+ [ $active ] ] $rand(1,200)
  }
}
alias guess {
  if (%numgame [ $+ [ $active ] ] != on) {
    echo -a There is no active number game in $active $+ ! Use /startgame to start one!
  }  
  elseif ($1 !isnum) {
    echo -a " $+ $1 $+ " Is Not A Number.. Enter A Valid Number
  }
  elseif ($1 > 200) {
    echo -a The Maximum Number Is 200, Guess A Lower Number
  }
  elseif ($1 != %num [ $+ [ $active ] ]) && ($1 > %num [ $+ [ $active ] ]) {
    msg $active 7 $me Was Wrong By Guessing $1 $+ ! Keep Guessing! 4Try A Lower Number!
  }
  elseif ($1 != %num [ $+ [ $active ] ]) && ($1 < %num [ $+ [ $active ] ]) {
    msg $active 7 $me Was Wrong By Guessing $1 $+ ! Keep Guessing! 4Try A Higher Number!
  }
  elseif ($1 == %num [ $+ [ $active ] ])  {
    msg $active 4 $me Got It Right! The Answer Was $1 $+ ! Type !Ngame to play again.
    unset %num [ $+ [ $active ] ]
    unset %numgame [ $+ [ $active ] ]
  }
}
//Answer alias - ONLY USE IF YOUR NOT PLAYING (Spoils the game)
alias answer {
  if (%numgame [ $+ [ $active ] ] == $null) {
    echo -a 5There is no number game running in $active
  }
  else {
    echo -a 4The answer to $active $+ 's number game is: 7 %num [ $+ [ $active ] ]
  }
}

Comments

Sign in to comment.
[M]ike   -  Jan 23, 2007

Oh sorry, didn\'t see your script, I just posted this since I had it loaded in mIRC for some reason.

 Respond  
Lindrian   -  Jan 23, 2007

Very similiar to the script I made o.o

 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.