Quote System
Commands:
!quote - Displays a random quote recorded by the script.
!quote info - Displays the number of available quotes.
Records everything said on a channel if the length of message is greater than or equal to thirty characters. Those messages are sent to a text file. It does distinguish between different channels, and quotes the messages accordingly.
on *:TEXT:*:#: {
if ($1 == !quote) && ($2 == info) {
if (!%waitthreeagain) {
msg $chan Total Number of Quotes: $+(,$lines(quotes. $+ $chan $+ .txt),)
msg $chan To prevent flooding, you can only request 1 quote every 3 seconds.
set -u3 %waitthreeagain 1
}
else { halt }
}
elseif ($1 == !quote) && (!$2) {
if (!%waitthree) {
msg $chan Quote: $read(quotes. $+ $chan $+ .txt)
set -u3 %waitthree 1
}
else { halt }
}
elseif ($len($1-) >= 30) {
write quotes. $+ $chan $+ .txt $1- [By: $nick $+ ]
}
}
1) Every message said in a channel that is 20 characters or more is saved in quotes.#channel.txt. These messages are then randomly chosen and sent to the designated channel upon typing the command: !quote
2) I\'ll update it to using only one \"on TEXT\" event soon.
3) I\'m not sure how I could make the variables any cleaner than they are. heh.