on *:input:*: {
if ($1 == !quote) {
var %who = $iif($chan,$chan,$me)
if ($chan) {
if (!$istok([color:red]#channel1 #channel2 #channel3 #channel4 #channel5[/color],$chan,32)) { return }
if (%quote.delay) {
echo -a Please try again after $duration(%quote.delay) or use !quote in a PM.
return
}
else {
var %delay = $rand([color:blue]600,5400[/color])
set -u [ $+ [ %delay ] ] %quote.delay %delay
}
}
if ($2) {
if ($2 !isnum) { msg %who $2 is not a number. | return }
if ($lines(quotes.txt) < $2) { msg %who Quote # $+ $2 doesn't exist. | return }
msg %who $read(quotes.txt,$2)
}
else msg %who $read(quotes.txt)
}
elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
elseif ($1 == !addquote) {
if ($2 == $null) { echo -a You need to include a quote to add. }
else write quotes.txt $2-
}
}