Advertisement
westor

Add/Del/Viewlist commands for Kendy v1.2

Sep 4th, 2020 (edited)
3,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.54 KB | None | 0 0
  1. alias -l txt { return $mircdir $+ badnicks.txt }
  2. alias -l list_secs { return 5 }
  3. alias -l mychan { return #test }
  4.  
  5. ON *:TEXT:!*:$($mychan): {
  6.   tokenize 32 $strip($1-)
  7.  
  8.   if ($1 == !add) {
  9.     if (!$2) { msg $chan ( $+ $nick $+ ): Insert a nickname! | return }
  10.  
  11.     var %r = $read($txt,ntw,$2)
  12.     var %rn = $readn
  13.  
  14.     if (%r) || (%rn) { msg $chan ( $+ $nick $+ ): Error, $2 does already exists on the list! | return }
  15.  
  16.     write $qt($txt) $2
  17.  
  18.     msg $chan ( $+ $nick $+ ): $2 has been added on the list.
  19.   }
  20.  
  21.   if ($1 == !del) {
  22.     if (!$2) { msg $chan ( $+ $nick $+ ): Insert a nickname! | return }
  23.  
  24.     var %r = $read($txt,ntw,$2)
  25.     var %rn = $readn
  26.  
  27.     if (!%r) || (!%rn) { msg $chan ( $+ $nick $+ ): Error, $2 does NOT exists on the list! | return }
  28.  
  29.     write -dl $+ %rn $qt($txt)
  30.  
  31.     msg $chan ( $+ $nick $+ ): $2 has been removed from the list.
  32.   }
  33.  
  34.   if ($1 == !viewlist) {
  35.     var %t = $lines($txt)
  36.     var %s = $file($txt).size
  37.  
  38.     if (!%t) { msg $chan ( $+ $nick $+ ): Error There is NOT any nickname exists on the list! | return }
  39.  
  40.     msg $chan ( $+ $nick $+ ): Retriving the list... check your private!
  41.     msg $nick Start of file.. - (Items: %t $+ )
  42.  
  43.     var %i = 1
  44.     while (%i <= %t) {
  45.       var %r = $read($txt,nt,%i)
  46.  
  47.       if (%r) { .timer[MSG_ $+ $nick $+ _ITEM_ $+ %i $+ _LIST] 1 $calc(%i * $list_secs) msg $nick $+([,$chr(35),%i,]:) %r }
  48.  
  49.       inc %i
  50.     }
  51.  
  52.     .timer[MSG_ $+ $nick $+ _LISTEND] 1 $calc(%t * $list_secs + 1) msg $nick End of file. - (Size: $bytes(%s).suf $+ )
  53.   }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement