;Simple quote system by Alucard (saturos at gmail dot com) ;------Usage------- ;Random quote: /quote ;Select a quote: /quote number ;Find quote matching *text*: /quote text ;Add a quote: /addquote quotes here ;Delete a quote: /delquote number alias addquote { write quotes.txt $+([,$adate,]:) $$1- if ($$1) { echo -a Quote $chr(35) $+ $lines(quotes.txt) added } } alias quote { if ($1 != $null) && ($1 isnum) { msg $active Selected Quote $+([,$1,/,$lines(quotes.txt),]) $read(quotes.txt,n,$1) } elseif ($1 != $null) { findquote $1- } else { var %q = $read(quotes.txt,n) msg $active Random Quote $+([,$readn,/,$lines(quotes.txt),]) %q } } alias delquote write -dl $+ $$1 quotes.txt | echo -a Quote $$1 deleted alias findquote { if ($1) { msg $active Looking for quotes matching * $+ $1- $+ * var %t = 1,%c = 0 while (%t <= $lines(quotes.txt)) { if (* $+ $1- $+ * iswm $read(quotes.txt,n,%t)) { msg $active $+([,$readn,/,$lines(quotes.txt),]) $read(quotes.txt,n,%t) inc %c } inc %t } msg $active Done ( $+ %c found). } }