Advertisement
illpastethat

[Deprecated] Quotes Script

Jan 14th, 2013
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.10 KB | None | 0 0
  1. ;For the latest script see http://pastebin.com/cYT20YjT
  2. ;Written by nick1 on Jan 06 2011
  3. ;DIRECTIONS:
  4. ;Copy the entire code and paste it into the remotes section of mirc.
  5. ;/QuotesOn [[Enables The Script]]
  6. ;/QuotesOff [[Disables The Script and Deletes Quotes]]
  7. ;See !quotes help for Help on How work it
  8.  
  9. alias QuotesOn {
  10.   .write -c QuoteHelp.txt NOTE: All commands may be triggered by "!" "@"  or "." and followed by Quote or Quotes EX: .quotes help
  11.   .write QuoteHelp.txt Quotes: !quote add <quote> - adds given quote to database, must have voice or higher on channel.
  12.   .write QuoteHelp.txt Quotes: !quote del <number> - removes quote number from database, must be op or above or have added the quote.
  13.   .write QuoteHelp.txt Quotes: !quote search <word> - searches database for given word.
  14.   .write QuoteHelp.txt Quotes: !quote read <number> - messages quote matching given number.
  15.   .write QuoteHelp.txt Quotes: !quote random - messages a random quote.
  16.   .write QuoteHelp.txt Quotes: !quote total - messages number of quotes in database.
  17.   .remove Quote.txt
  18.   set %QuoteCount 0
  19.   set %QuoteNumber 0
  20.   .enable #quotes
  21.   //echo Quotes enabled! To disable use /QuotesOff
  22. }
  23.  
  24. alias QuotesOff {
  25.   .disable #quotes
  26.   .write -c QuoteHelp.txt Quotes Disabled
  27.   .write -c Quote.txt Quotes Disabled
  28.   unset %QuoteCount
  29.   unset %QuoteNumber
  30.   //echo Quotes disabled and deleted! To enable use /QuotesOn
  31. }
  32.  
  33. #quotes on
  34. on $*:text:/^[!@.]quote(s*)/Si:#: {
  35.   if (($nick($chan, $me, @&~)) && (Quotes !ison $chan)) {
  36.     if (!$2) {
  37.       notice $nick No Command! See !quote Help
  38.     }
  39.     else {
  40.       if ($2 == help) {
  41.         play -n $nick QuoteHelp.txt 2000
  42.       }
  43.       elseif ($2 == add) {
  44.         if (!$3) {
  45.           msg $chan $nick Enter a quote to add!
  46.         }
  47.         else {
  48.           inc %Quotenumber
  49.           inc %QuoteCount
  50.           write Quote.txt Quote Number %Quotenumber At $asctime By $nick $+ : $qt($3-)
  51.           msg $chan Added Quote Number %QuoteCount At $asctime By $nick
  52.         }
  53.       }
  54.       elseif ($2 == del) {
  55.         if ((!$3) || ($3 !isnum)) {
  56.           msg $chan $nick Enter a quote to delete!
  57.         }
  58.         elseif ($nick($chan, $nick, @&~)) {
  59.           dec %QuoteCount
  60.           .write -l $+ $3  Quote.txt
  61.           msg $chan Deleted Quote Number $3 $+ !
  62.         }
  63.         else {
  64.           if ($nick $+ : isin $read(Quote.txt,$3)) {
  65.             dec %QuoteCount
  66.             .write -l $+ $3  Quote.txt
  67.             msg $chan Deleted Quote Number $3 $+ !
  68.           }
  69.         }    
  70.       }
  71.       elseif ($2 == search) {
  72.         if (!$3) {
  73.           msg $chan $nick Enter a search term!
  74.         }
  75.         else {
  76.           var %search
  77.           var %i 1
  78.           while ($read(Quote.txt,%i)) {
  79.             if ($3- isin $read(Quote.txt,%i)) {
  80.               var %search $addtok(%search,%i,44)
  81.             }
  82.             inc %i
  83.           }
  84.           if (!%search) {
  85.             msg $chan No quotes found matchng $3- $+ .
  86.           }
  87.           elseif (*,* !iswm %search) {
  88.             msg $chan Quote found matching $qt($3-) $+ : %search
  89.             msg $chan $read(Quote.txt,%search)
  90.           }
  91.           else {
  92.             msg $chan Quotes found matching $qt($3-) $+ : %search
  93.           }
  94.         }
  95.       }
  96.       elseif ($2 == read) {
  97.         if ((!$3) || ($3 !isnum)) {
  98.           msg $chan $nick Enter a quote to read!
  99.         }
  100.         elseif ($read(Quote.txt,$3) == $null) {
  101.           msg $chan $nick Quote Not Found!
  102.         }
  103.         else {
  104.           msg $chan $read(Quote.txt,$3)
  105.         }
  106.       }
  107.       elseif ($2 == random) {
  108.         :RandomTop
  109.         var %quoterandom $rand(1,$lines(quote.txt))
  110.         if (*Quote* iswm $read(Quote.txt,%QuoteRandom)) {
  111.           msg $chan $read(Quote.txt,%QuoteRandom)
  112.         }
  113.         elseif (*Quote* !iswm $read(Quote.txt,%QuoteRandom))  goto RandomTop
  114.       }
  115.       elseif ($2 == total) {
  116.         if (%quoteCount > 0) {
  117.           msg $chan A Total of %quoteCount Quotes!
  118.         }  
  119.         else {
  120.           msg $chan No quotes in database!
  121.         }
  122.       }
  123.     }
  124.   }
  125. }
  126. #quotes end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement