Advertisement
westor

Quotes for UniKKatiL v1.0

Nov 24th, 2019
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.41 KB | None | 0 0
  1. ON *:TEXT:!*:#: {
  2.   tokenize 32 $strip($1-)
  3.  
  4.   if ($1 == !quotehelp) { msg $chan ( $+ $nick $+ ): Quote Commands: !AddQuote <Text> - !DelQuote <ID> - !ClearQuotes - !Quotes - !Get [Number] }
  5.   if ($1 == !addquote) {
  6.     if (!$istok($quote_nicks,$nick,44)) { msg $chan ( $+ $nick $+ ): Access denied! | return }
  7.     if (!$2) { msg $chan ( $+ $nick $+ ): Error, Not enough paramaters, Insert a text! | return }
  8.  
  9.     var %f = quotes.txt
  10.  
  11.     var %r = $read(%f,nw,$2-)
  12.     if (%r) { msg $chan ( $+ $nick $+ ): Error, Already exists, Insert an other text! | return }
  13.  
  14.     write $qt(%f) $2-
  15.     var %t = $lines(%f)
  16.  
  17.     msg $chan ( $+ $nick $+ ): Quote $chr(35) $+ %t has been added.
  18.   }
  19.  
  20.   if ($1 == !delquote) {
  21.     if (!$istok($quote_nicks,$nick,44)) { msg $chan ( $+ $nick $+ ): Access denied! | return }
  22.     if (!$2) { msg $chan ( $+ $nick $+ ): Error, Not enough paramaters, Insert a ID number! | return }
  23.  
  24.     var %f = quotes.txt
  25.     var %l = $lines(%f)
  26.     if (!%l) { msg $chan ( $+ $nick $+ ): Quotes file is currently empty! | return }
  27.  
  28.     var %r = $read(%f,n,$2)
  29.     var %rn = $readn
  30.  
  31.     if (!%r) { msg $chan ( $+ $nick $+ ): Error, Not exists, Please use an other quote ID! | return }
  32.  
  33.     write -dl $+ %rn $qt(%f)
  34.  
  35.     msg $chan ( $+ $nick $+ ): Quote $chr(35) $+ %rn has been removed.
  36.   }
  37.  
  38.   if ($1 == !quotes) {
  39.     var %f = quotes.txt
  40.     var %l = $lines(%f)
  41.  
  42.     if (!%l) { msg $chan ( $+ $nick $+ ): Quotes file is currently empty! | return }
  43.  
  44.     msg $chan ( $+ $nick $+ ): There are $qt(%l) quotes in database!
  45.   }
  46.  
  47.   if ($1 == !clearquotes) {
  48.     if (!$istok($quote_nicks,$nick,44)) { msg $chan ( $+ $nick $+ ): Access denied! | return }
  49.  
  50.     var %f = quotes.txt
  51.     var %l = $lines(%f)
  52.  
  53.     if (!%l) { msg $chan ( $+ $nick $+ ): Quotes file is currently empty! | return }
  54.  
  55.     write -c $qt(%f)
  56.  
  57.     msg $chan ( $+ $nick $+ ): All $qt(%l) quotes have been cleared.
  58.   }
  59.  
  60.   if ($1 == !get) {
  61.     var %f = quotes.txt
  62.     var %l = $lines(%f)
  63.  
  64.     if (!%l) { msg $chan ( $+ $nick $+ ): Quotes file is currently empty! | return }
  65.  
  66.     if (!$2) {
  67.       var %r = $read(%f,n)
  68.  
  69.       msg $chan ( $+ $nick $+ ): %r
  70.  
  71.       return
  72.     }
  73.  
  74.     var %r = $read(%f,n,$2)
  75.     var %rn = $readn
  76.  
  77.     if (!%r) { msg $chan ( $+ $nick $+ ): Error, Not exists, Please use an other quote ID! | return }
  78.  
  79.     msg $chan ( $+ $nick $+ ): %r
  80.   }
  81. }
  82.  
  83. alias -l quote_nicks { return westor,tester }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement