Top

Simple number game

Please Register to submit score.
Average Score  3.0
Scores Submitted  1
Date Added  Sep 22, 2007
Last Updated  Sep 22, 2007
Tags  first  game  games  irc  mirc  number  numbers  simple 

Introduction

This is the first piece of IRC code I've made without any help. It needs improvement (i.e. preventing somebody from jumping in at the last second to win), but I'm still just learning. If you have any ideas that would help this script out, please tell. :)

Commands:

!number [number]
Replace [number] with a number, preferrably one that you could reach by counting by 2s and 3s. (don't make it much higher than 100, unless you plan on playinb for a long time.)

!stopnumber
The game starter (whoever said !number) may say this to stop the game and unset the variables.

The idea of this number game is to reach the number stated at the beginning of the game (!number [this one]). Going over the number counts as a win.

Once the game is started, anybody on the channel may say 2 or 3 to add that value to the number. Enjoy!

Grab the Code

Comments

  (4)  RSS
vegeto079
Comments: 28
 
mIRC Snippet:  Simple number game
Posted on Mar 8, 2008 3:42 am
There's always little sill things you could do to shorten the script. I'd review it and see if it works, but it seems you need 2 people to play, and nobody else is on right now ;P

Code:
  if (%numgame == 1) { msg $chan 12Game already in progress. }
  if (%numgame != 1) {

can simply be
Code:
if (%numgame == 1) { msg $chan 12Game already in progress. | HALT }


and
Code:
     if (%currentnum < %end) { msg $chan 12The number is now4 %currentnum }
    if (%currentnum >= %end) {

could simply be
Code:
if (%currentnum < %end) { msg $chan 12The number is now4 %currentnum | HALT }
vegeto079
Comments: 28
 
mIRC Snippet:  Simple number game
Posted on Mar 8, 2008 3:44 am
Oh, and I forgot to say, you should probably take out those two big blocks of code and put this:
Code:
on *:TEXT:*:#: {
if ($1- != 2) && ($1- != 3) { halt }
  if (%numgame == 1) && (%lastnick == $nick) { msg $chan 4You may not take 2 turns in a row!! }
  if (%numgame == 1) && (%lastnick != $nick) {
    set %currentnum %currentnum + $1-
    set %lastnick $nick
    if (%currentnum < %end) { msg $chan 12The number is now4 %currentnum }
    if (%currentnum >= %end) {
      msg $chan 12 $nick has won!!
      unset %end
      unset %currentnum
      unset %lastnick
      unset %ender
      set %numgame 0
    }
  }
}
wizard38
Comments: 2
 
mIRC Snippet:  Simple number game
Posted on May 18, 2008 4:21 pm
How i play this
!number 4 and then.....nothing
jonesy44
Comments: 618
 
mIRC Snippet:  Simple number game
Posted on May 18, 2008 4:30 pm
Is this loaded in a second mIRC window?
Sure you loaded the whole script?
Eny errorous scripts above this one?
Are any of the commands doubling up?
Read the introduction?

Please Register or Login to start posting comments.
Bottom