Advertisement
Guest User

Untitled

a guest
Sep 14th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. on *:TEXT:!*:#: {
  2. if ($right($1,-1) == quote) {
  3. if (((%floodquote) || ($($+(%,floodquote.,$nick),2))) && ( $nick)) {
  4. if ($nick isop $chan) { msg # [Random Quote] $read(quotes.txt,n) }
  5. else { return }
  6. {
  7. set -u60 %floodquote On
  8. set -u240 %floodquote. $+ $nick On
  9. }
  10. }
  11. if (!$2) { msg # [Random Quote] $read(quotes.txt,n) }
  12. elseif ($2 == del) && ($3 isnum) && ($lines(quotes.txt) >= $3) && ($nick isop #) { msg # [Quote Deleted] $3 $+ : $read(quotes.txt, $+ $3) | .write -dl $+ $3 quotes.txt }
  13. elseif ($2 isnum) && ($lines(quotes.txt) >= $2) { msg # [Quote $+($2,/,$lines(quotes.txt),]) $read(quotes.txt,n,$2) }
  14. elseif ($2 == find) && ($len($3) > 2) {
  15. var %x $lines(quotes.txt)
  16. while (%x) {
  17. if ($3- isin $read(quotes.txt,%x)) {
  18. inc %quotes.search
  19. set %quotes.return $addtok(%quotes.return,%x,32)
  20. }
  21. dec %x
  22. }
  23. if (!%quotes.search) { msg # [Quote Search] No quotes found with the string " $+ $3- $+ " | unset %quotes.* | halt }
  24. if (%quotes.search = 1) { msg # [Quote Search] One quote found: $+([,%quotes.return,]) $read(quotes.txt,n,%quotes.return) | unset %quotes.* }
  25. else {
  26. msg # [Quote Search] Found %quotes.search quotes that have the string $+(",$3-,") in them.
  27. .timer 1 2 msg # [Quote $+($gettok(%quotes.return,1,32),/,$lines(quotes.txt),]) $replace($read(quotes.txt, n, $gettok(%quotes.return,1,32)),|,$!chr(124))
  28. .timer 1 4 msg # [Quote Search] Other quote numbers: $right(%quotes.return,-2)
  29. unset %quotes.*
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement