Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;For the latest script see http://pastebin.com/cYT20YjT
- ;Written by nick1 on Jan 06 2011
- ;DIRECTIONS:
- ;Copy the entire code and paste it into the remotes section of mirc.
- ;/QuotesOn [[Enables The Script]]
- ;/QuotesOff [[Disables The Script and Deletes Quotes]]
- ;See !quotes help for Help on How work it
- alias QuotesOn {
- .write -c QuoteHelp.txt NOTE: All commands may be triggered by "!" "@" or "." and followed by Quote or Quotes EX: .quotes help
- .write QuoteHelp.txt Quotes: !quote add <quote> - adds given quote to database, must have voice or higher on channel.
- .write QuoteHelp.txt Quotes: !quote del <number> - removes quote number from database, must be op or above or have added the quote.
- .write QuoteHelp.txt Quotes: !quote search <word> - searches database for given word.
- .write QuoteHelp.txt Quotes: !quote read <number> - messages quote matching given number.
- .write QuoteHelp.txt Quotes: !quote random - messages a random quote.
- .write QuoteHelp.txt Quotes: !quote total - messages number of quotes in database.
- .remove Quote.txt
- set %QuoteCount 0
- set %QuoteNumber 0
- .enable #quotes
- //echo Quotes enabled! To disable use /QuotesOff
- }
- alias QuotesOff {
- .disable #quotes
- .write -c QuoteHelp.txt Quotes Disabled
- .write -c Quote.txt Quotes Disabled
- unset %QuoteCount
- unset %QuoteNumber
- //echo Quotes disabled and deleted! To enable use /QuotesOn
- }
- #quotes on
- on $*:text:/^[!@.]quote(s*)/Si:#: {
- if (($nick($chan, $me, @&~)) && (Quotes !ison $chan)) {
- if (!$2) {
- notice $nick No Command! See !quote Help
- }
- else {
- if ($2 == help) {
- play -n $nick QuoteHelp.txt 2000
- }
- elseif ($2 == add) {
- if (!$3) {
- msg $chan $nick Enter a quote to add!
- }
- else {
- inc %Quotenumber
- inc %QuoteCount
- write Quote.txt Quote Number %Quotenumber At $asctime By $nick $+ : $qt($3-)
- msg $chan Added Quote Number %QuoteCount At $asctime By $nick
- }
- }
- elseif ($2 == del) {
- if ((!$3) || ($3 !isnum)) {
- msg $chan $nick Enter a quote to delete!
- }
- elseif ($nick($chan, $nick, @&~)) {
- dec %QuoteCount
- .write -l $+ $3 Quote.txt
- msg $chan Deleted Quote Number $3 $+ !
- }
- else {
- if ($nick $+ : isin $read(Quote.txt,$3)) {
- dec %QuoteCount
- .write -l $+ $3 Quote.txt
- msg $chan Deleted Quote Number $3 $+ !
- }
- }
- }
- elseif ($2 == search) {
- if (!$3) {
- msg $chan $nick Enter a search term!
- }
- else {
- var %search
- var %i 1
- while ($read(Quote.txt,%i)) {
- if ($3- isin $read(Quote.txt,%i)) {
- var %search $addtok(%search,%i,44)
- }
- inc %i
- }
- if (!%search) {
- msg $chan No quotes found matchng $3- $+ .
- }
- elseif (*,* !iswm %search) {
- msg $chan Quote found matching $qt($3-) $+ : %search
- msg $chan $read(Quote.txt,%search)
- }
- else {
- msg $chan Quotes found matching $qt($3-) $+ : %search
- }
- }
- }
- elseif ($2 == read) {
- if ((!$3) || ($3 !isnum)) {
- msg $chan $nick Enter a quote to read!
- }
- elseif ($read(Quote.txt,$3) == $null) {
- msg $chan $nick Quote Not Found!
- }
- else {
- msg $chan $read(Quote.txt,$3)
- }
- }
- elseif ($2 == random) {
- :RandomTop
- var %quoterandom $rand(1,$lines(quote.txt))
- if (*Quote* iswm $read(Quote.txt,%QuoteRandom)) {
- msg $chan $read(Quote.txt,%QuoteRandom)
- }
- elseif (*Quote* !iswm $read(Quote.txt,%QuoteRandom)) goto RandomTop
- }
- elseif ($2 == total) {
- if (%quoteCount > 0) {
- msg $chan A Total of %quoteCount Quotes!
- }
- else {
- msg $chan No quotes in database!
- }
- }
- }
- }
- }
- #quotes end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement