on *:TEXT:!numbers*:#:{
set %rnum $rand(1,25)
writeini join.ini [ $+ [ $chan ] ] $nick
msg $chan $nick has started the random number game, type !join to join in.
timer 0 120 writeini over.ini Started
}
on *:TEXT:!join*:#:{
if ($readini(over.ini) == Started) { timers off | halt }
if ($lines(over.ini) = 10) { msg $chan We now have 10 players, type !geuss 1-25 to start }
if ($lines(over.ini) > 10) { notice $nick There is already a game going on! | halt }
writeini join.ini [ $+ [ $chan ] ] $nick
msg $chan We now have $lines(join.ini) players.
}
on *:!geuss*:#:{
if ($readini(over.ini) == Started) {
if ($readini(over.ini,$chan,$nick)) {
writeini geuss.ini [ $+ [ $chan ] ] $2
msg $chan $nick Geussed $2 and was...
if ($2 == %rnum) {
timer 0 5 msg $chan RIGHT!
unset %rnum
remini over.ini
remini join.ini
}
else {
timer 0 5 msg $chan $nick was WRONG. He was apprx, $calc(%rnum / $2 ($rand(-,+) 3)) off.
}
}
}
}