;Num Game
on 10:text:*:#:{
if (!nstart == $1) && (!%numg. [ $+ [ $address($nick,2) ] ]) {
set %num $rand(1,99)
set %ngame 1
msg # Guessing game is on.
}
elseif ($1 == !guess && $2 isnum) {
if (%ngame == 0) {
notice $nick Game is currently down.
inc -z %numg. [ $+ [ $address($nick,2) ] ] 900
}
elseif (%numg. [ $+ [ $address($nick,2) ] ] != $null) {
notice $nick You must wait $duration(%numg. [ $+ [ $address($nick,2) ] ] )
}
elseif ($2 < %num) {
notice $nick $2 is too low.
inc -z %numg. [ $+ [ $address($nick,2) ] ] 900
}
elseif ($2 > %num) {
notice $nick $2 is too high.
inc -z %numg. [ $+ [ $address($nick,2) ] ] 900
}
elseif ($2 == %num) {
msg # $2 is Correct! $nick is the winner.
set %num $rand(1,99)
hinc -m nwinners %numg. [ $+ [ $nick ] ] %win
}
}
elseif ($1 == !guess && $2 !isnum) {
notice $nick SYNTAX: !guess <number>
}
}