I need help with this script. Can somebody find the bug in here? It doesn't work at all yet.
Initialization: \game hilo #
-The first character is a backslash, not forward
-Replace # with the top number (random number between 1 and #)
People on the channel go in order, trying to guess the random number, and they are told whether it is higher or lower.
So can anybody help?
on *:TEXT:\game hi-lo *:#: {
set %hilotop $3
set %hilogameison 1
set %hiloender $nick
msg $chan Game Started: Hi-Lo ( $+ $nick $+ )
msg $chan I have selected a random number between 1 and %hilotop $+ . Guess a number and I'll say whether it's higher or lower.
msg $chan When stating your guess, say "hilo $chr(35) $+ ", replacing $chr(35) with your guess. Example: hilo 30
set %onchans 1
:hilonext
set %hilonextnick $nick(#,%onchans)
if ( %hilonextnick == $null ) goto hilodone
inc %onchans
set %hilonicklist %hilonextnick + $chr(44) + $chr(32)
goto hilonext
:hilodone
set %hilonicklists $left(%hilonicklist,2)
set %hiloplayers %onchans-1
msg $chan Players will go in this order- %hilonicklists $+ .
set %hilocurrentplayer 1
set %hilogoal $rand(1,%hilotop)
msg $chan $nick(#,%hilocurrentplayer) $+ , it's your turn. You have 15 seconds to make your guess or be kicked from the game.
.timer 1 15 set %hilofail [ $+ [ %hilocurrentplayer ] ] 1
}
on *:TEXT:hilo *:#: {
if ( %hilogameison == 1 ) {
if ( $2 > 0 && $2 <= %hilotop ) {
if ( $2 > %hilogoal ) {
msg $chan Guess lower.
.timer* off
inc %hilocurrentplayer
:hilonextplayer
if ( $nick(#,%hilocurrentplayer) == $null ) {
set %hilocurrentplayer 1
goto hilonextplayer
}
if ( %hilofail [ $+ [ %hilocurrentplayer ] ] == 1 ) goto hilonextplayer
msg $chan $nick(#,%hilocurrentplayer) $+ , it's your turn. You have 15 seconds to make your guess or be kicked from the game.
.timer 1 15 set %hilofail [ $+ [ %hilocurrentplayer ] ] 1
}
if ( $2 < %hilogoal ) { msg $chan Higher
.timer* off
inc %hilocurrentplayer
:hilonextplayer
if ( $nick(#,%hilocurrentplayer) == $null ) {
set %hilocurrentplayer 1
goto hilonextplayer
}
if ( %hilofail [ $+ [ %hilocurrentplayer ] ] == 1 ) goto hilonextplayer
msg $chan $nick(#,%hilocurrentplayer) $+ , it's your turn. You have 15 seconds to make your guess or be kicked from the game.
.timer 1 15 set %hilofail [ $+ [ %hilocurrentplayer ] ] 1
}
if ( $2 == %hilogoal ) {
msg $chan $nick is the winner!!
.timer* off
unset %hilo*
}
}
}
}
You should have posted it in the forums.. http://www.hawkee.com/phpBB2/viewforum.php?f=1