on *:TEXT:!8Ball*:#: {
if ($2 == del) {
if ($nick !isop $chan) { notice $nick Sorry you must be an op to use this command. | return }
remini 8ball.ini $chan responce. $+ $3
}
if ($2 == last) {
if (!%lastquestion. [ $+ [ $chan ] ]) { notice $nick The !8ball command has not been used yet. | return }
msg $chan The last question said was %lastquestion. [ $+ [ $chan ] ]
msg $chan The last responce was responce number %lresponcenum. [ $+ [ $chan ] ]
return
}
if ($2 == on) && ($nick isop $chan) { set %8ball on | msg $chan 8Ball is now on. | return }
if ($2 == off) && ($nick isop $chan) { set %8ball off | msg $chan 8Ball is now off. | return }
if (%8ball == off) { notice $nick 8ball is currently turned off. | return }
if ($2 == add) {
if ($nick !isop $chan) { notice $nick Sorry, you must be an op to use this command. | return }
set %responcenum. $+ $chan $calc(%responcenum. [ $+ [ $chan ] ] + 1)
writeini 8ball.ini $chan Responce. $+ %responcenum $3-
notice $nick Responce added.
return
}
else {
if (!%responcenum. [ $+ [ $chan ] ]) { msg $chan No responses at this time. | return }
set %lastquestion. $+ $chan $2-
msg $chan $nick $+ 's shakin up the 8ball..
var %8ballr $iif(%responcenum. [ $+ [ $chan ] ] == 1,1,$r(1,%responcenum. [ $+ [ $chan ] ]))
.timer 1 1 msg $chan 8Ball: $readini(8ball.ini,$chan,responce. $+ %8ballr)
set %lresponcenum. $+ $chan %8ballr
}
}