Commands : !hilo , then !start to start the game.. !high or !low to play.
Multiplayer version coming soon.
############################################################
## Hi-Lo Script ##
## Version: 1.0 ##
## By: manish17 ##
## irc.lunarirc.net #LunarIRC Talk with me : User - manish
Follow my blog : https://manishsnippets.blogspot.com ##
############################################################
on *:TEXT:!hilo*:#: {
if ( %hilo != on ) {
set %hilo on
set %o 0
msg $chan 3 Hi-Lo game has been started. 13 cards are taken, and a random card is drawn and removed every time. You need to guess whether the next card is higher or lower than the previous card.
if ( %champ == $null ) { msg $chan 9 Nobody has ever won this game yet. Win this game to become the first champion! }
else { msg $chan 3 The current champion is 9 %champ 3 . Win this game to become the new champion! }
msg $chan 9 Type !start to start the game.
}
}
on *:TEXT:!start*:#: {
if ( %hilo == on ) && ( %o == 0 ) {
inc %o
set %nick $nick
set %chan $chan
msg $chan 6 Game of High-Low has been started by $nick .
start
msg $chan 4,0♥ $+ %oldcard 4,010 has been chosen! 12 cards remaining in the deck.
msg $chan 6 $nick may choose to go !high or go !low
timer 1 30 timeout
}
elseif ( %o == 1 ) {
msg $chan 7 A game of High-Low is already in progress in this channel.
}
else {
msg $chan 6 Please start a game of High-Low by typing !hilo . }
}
alias start {
set %score 0
set %cards 2.3.4.5.6.7.8.9.10.J.Q.K.A
set %total $numtok(%cards,46)
set %x $rand(1,%total)
set %oldcard $gettok(%cards,%x,46)
%cards = $deltok(%cards,%x,46)
}
on *:TEXT:!high*:#: {
timers off
if ( $nick == %nick) {
timer 1 1 msg $chan 10 $nick goes for high.
set %total $numtok(%cards,46)
set %x $rand(1,%total)
set %newcard $gettok(%cards,%x,46)
%cards = $deltok(%cards,%x,46)
set %oldval $value(%oldcard)
set %newval $value(%newcard)
if ( %newval > %oldval ) {
inc %score
timer 1 5 msg $chan 14 The next card is 4,0♥ $+ %newcard 4,0 .
timer 1 5 msg $chan 6 $numtok(%cards,46) cards remaining in the deck.
timer 1 5 msg $chan 6 $nick makes a correct choice and is still in the game.
timer 1 7 msg $chan 10 Current score of $nick : %score
timer 1 37 timeout
if ( %score == 12 ) {
timer 1 8 msg $chan 9 $nick has won the game of High-Low with a top-class score of 12, and is the new champion!
set %champ $nick
unset %o
timer 1 9 notice $nick Please Wait 60 seconds if you want to play again.
timer 1 9 ignore -cu60 $nick
set %hilo off
unset %nick
}
}
else {
timer 1 4 msg $chan 14 The next card is 4,0♥ $+ %newcard 4,0 .
timer 1 5 msg $chan 4 Game Over! $nick loses the game with a total score of %score . Well played!
unset %o
timer 1 6 notice $nick Please Wait 30 seconds if you want to play again.
timer 1 6 ignore -cu30 $nick
set %hilo off
unset %nick
}
set %oldcard %newcard
}
}
on *:TEXT:!low*:#: {
timers off
if ( $nick == %nick) {
timer 1 1 msg $chan 10 $nick goes for low.
set %total $numtok(%cards,46)
set %x $rand(1,%total)
set %newcard $gettok(%cards,%x,46)
%cards = $deltok(%cards,%x,46)
set %oldval $value(%oldcard)
set %newval $value(%newcard)
if ( %newval < %oldval ) {
inc %score
timer 1 5 msg $chan 14 The next card is 4,0♥ $+ %newcard 4,0 .
timer 1 5 msg $chan 6 $numtok(%cards,46) cards remaining in the deck.
timer 1 5 msg $chan 6 $nick makes a correct choice and is still in the game.
timer 1 7 msg $chan 10 Current score of $nick : %score
timer 1 37 timeout
if ( %score == 12) {
timer 1 8 msg $chan 9 $nick has won the game of High-Low with a top-class score of 12, and is the new champion!
set %champ $nick
unset %o
set %hilo off
unset %nick
timer 1 9 notice $nick Please Wait 60 seconds if you want to play again.
timer 1 9 ignore -cu60 $nick
}
}
else {
timer 1 4 msg $chan 14 The next card is 4,0♥ $+ %newcard 4,0 .
timer 1 5 msg $chan 4 Game Over! $nick loses the game with a total score of %score . Well played!
unset %o
timer 1 6 notice $nick Please Wait 30 seconds if you want to play again.
timer 1 7 ignore -cu30 $nick
set %hilo off
unset %nick
}
set %oldcard %newcard
}
}
alias value {
if ( $1 == J ) { %value = 11 }
elseif ( $1 == Q ) { %value = 12 }
elseif ( $1 == K ) { %value = 13 }
elseif ( $1 == A ) { %value = 14 }
else { %value = $1 }
if ($isid) { return %value }
}
alias timeout {
msg %chan 4 Sorry %nick , you ran out of the time-limit (30 seconds) and eventually lose the game with the score %score .
unset %o
set %hilo off
notice %nick Please Wait 30 seconds if you want to play again.
ignore -cu30 %nick
unset %nick
}