Snippets
  • Uploaded By: entropy
  • Added: 2 years ago
  • Updated: 2 years ago
  • mIRC Version: v6.35+
  • Hits: 709
  • Size: 2.71KB
  • Downloads: 12
  • Review By: entropy



Quotes v2.9

Simple Quotes system for a specified channel.
Screenshot...

    
  1    0  Login to Vote.


Source Code:
  1. ; Quotes v2.9 - by entropy 2019
  2. ; syntax: !addquote <text> to add to it
  3. ; syntax: !quote [N/*wildcard*]
  4. ; syntax: !quotes
  5. ; syntax: !whoquote [N]
  6. ; syntax: !delquote [N]
  7.  
  8. #quotes on
  9. alias -l unsafe return $!decode( $encode($1-,m) ,m)
  10. alias quotesfile { return $qt($+($scriptdir,quotes,.,$network,.,#,.txt)) }
  11. alias -l doquotes {
  12. var %chan = $mid(#,2)
  13. if (?quote iswm $1 && $left($1,1) isin @!.) {
  14. if (!$2) {
  15. var %a = $rand(1,$lines($quotesfile))
  16. if (%a != $null && $lines($quotesfile) >= 1) { .timerquote -o 1 1 msg $unsafe( # ) $+(%a,$chr(41)) $unsafe( $gettok($read($quotesfile,n,%a),2-,32) ) }
  17. else { .timerquote -o 1 1 msg $unsafe( # ) No quotes! }
  18. }
  19. elseif (* isin $2) {
  20. var %a = 1, %b, %total = 0, %found
  21. while ($read($quotesfile,n,%a)) {
  22. %b = $v1
  23. if ($2 iswm %b && !$istok(%found,%a,32)) { inc %total | %found = %found %a }
  24. inc %a
  25. }
  26. if (%found) {
  27. if (%total > 5) { .timerquote -o 1 1 msg $unsafe( # ) Search criteria too broad! }
  28. elseif (%total == 1) { .timerquote -o 1 1 msg $unsafe( # ) $+(%found,$chr(41)) $unsafe( $gettok($read($quotesfile,n,%found),2-,32) ) }
  29. else { .timerquote -o 1 1 msg $unsafe( # ) Found: %found }
  30. }
  31. else { .timerquote -o 1 1 msg $unsafe( # ) No such quote! }
  32. }
  33. elseif ($2 isnum) {
  34. if ($read($quotesfile,n,$2)) { .timerquote -o 1 1 msg $unsafe( # ) $+($2,$chr(41)) $unsafe( $gettok($v1,2-,32) ) }
  35. else { .timerquote -o 1 1 msg $unsafe( # ) No such quote! }
  36. }
  37. else { .timerquote -o 1 1 msg $unsafe( # ) No such quote! }
  38. }
  39. elseif (?addquote iswm $1 && $left($1,1) isin @!.) {
  40. if (!$2) { .timerquote -o 1 1 msg $unsafe( # ) No Quote Specified! }
  41. else { write $quotesfile $nick $2- | .timerquote -o 1 1 msg $unsafe( # ) Quote: $lines($quotesfile) Added! }
  42. }
  43. elseif (?quotes iswm $1 && $left($1,1) isin @!.) {
  44. .timerquote -o 1 1 msg $unsafe( # ) Quotes: $lines($quotesfile)
  45. }
  46. elseif (?delquote iswm $1 && $left($1,1) isin @!. && $nick isop #) {
  47. if ($read($quotesfile,n,$2) && $2 isnum) {
  48. write $+(-dl,$2) $quotesfile
  49. .timerquote -o 1 1 msg $unsafe( # ) Deleted quote: $qt($2)
  50. }
  51. else { .timerquote -o 1 1 msg $unsafe( # ) No such quote to delete! }
  52. }
  53. elseif (?whoquote iswm $1 && $left($1,1) isin @!.) {
  54. if ($2 isnum && $read($quotesfile,n,$2)) { .timerquote -o 1 1 msg $unsafe( # ) Quote $2 by: $unsafe( $gettok($read($quotesfile,n,$2),1,32) ) }
  55. else { .timerquote -o 1 1 msg $unsafe( # ) No such quote! }
  56. }
  57. }
  58. on *:text:*:#:{ doquotes $1- }
  59. on *:input:#:{ doquotes $1- }
  60. #quotes end


Comments
No Comments.

Login to Comment.