# number guessing

### By Sephiroth1n6 on Sep 22, 2007

a simple number guessing game

``````on *:TEXT:!nguess*:#:{
if (%numberz == \$null) goto this
if (%numberz != \$null) goto that
:this
msg \$chan 7 \$Nick 4has started a number guessing game!guess by saying !ng NUMBER.
set %numberz \$rand(0,10000)
echo 3 -a %numberz
.notice Sephiroth1n6 4The answer is7 %numberz
halt
:that
.notice \$Nick 4a game is in progress. please wait until the game is over, or you could just type !stopnumber.
halt
}
on *:TEXT:!stopnumber*:#:{
if (%numberz != \$null) goto not
if (%numberz == \$null) goto yup
:not
msg \$chan 4Number Guessing Stopped By7 \$nick \$+ .4 The Answer Was7 %numberz \$+ .
unset %numberz
halt
:yup
.notice 7 \$nick 4There Is Currently No Game In Progress.
halt
}
on *:TEXT:!ng *:#:{
if (\$2 > %numberz) goto greater
if (\$2 < %numberz) goto lesser
if (\$2 == %numberz) goto equal
if (%numberz == \$null) goto whom
else goto what
:greater
msg \$chan 7 \$Nick \$+ ,4 That Answer Was Wrong! But Keep Guessing. 7Try a Lower Number!
halt
:lesser
msg \$chan 7 \$nick \$+ ,4 That Answer Was Wrong! But Keep Guessing. 7Try a Higher Number!
halt
:equal
msg \$chan 7 \$nick 4Guessed The Correct Number of7 %numberz \$+ 4!!!
unset %numberz
halt
:what
halt
:whom .notice \$nick 4There is currently no game in progress. Type !nguess to start a game.
halt
}
``````