on $*:text:/^[!@]n(umber)?game/Si:#:{
if (!%ng) {
msg # Number game started - type !guess N to guess it! (1-50)
set %ng $r(1,50) $ctime
}
else .notice $nick There is already a game in progress!
}
on $*:text:/^[!@]guess/Si:#:{
if (%ng) {
if ($2 == $gettok(%ng,1,32)) {
msg # $nick Has guessed the correct number! It took them $+($duration($calc($ctime - $gettok(%ng,2,32))),.)
unset %ng
}
else msg $chan That is wrong $+($nick,$chr(44)) Try guessing: $iif($2 > $gettok(%ng,1,32),Lower,Higher)
}
else .notice $nick There is no game in progress!
}