Advertisement
westor

AKA for TRK v1.1

Nov 22nd, 2020 (edited)
1,959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.80 KB | None | 0 0
  1. ; ------- Settings --------
  2.  
  3. alias -l aka_file { return aka.ini } ; = The database file.
  4. alias -l aka_excepts { return network1~nickname1~#channel1 network2~nickname2~#channel2 } ; = format is NETWORK~NICKAME~#CHANNEL so e.g ChatHUB~westor~#mSL
  5.  
  6. ; ------- Settings --------
  7.  
  8. ON *:TEXT:*:#: {
  9.   tokenize 32 $strip($1-)
  10.  
  11.   if ($1 == !aka) {
  12.     if (!$2) { msg $chan ( $+ $nick $+ ): Error, Please insert a nickname! | return }
  13.     if ($2 == $me) || ($2 == $nick) { msg $chan ( $+ $nick $+ ): Error, Incorrect target! | return }
  14.  
  15.     var %nc = $+($network,~,$2,~,$chan)
  16.     var %r = $readini($aka_file,n,%nc,nicks)
  17.     var %t = $numtok(%r,32)
  18.  
  19.     if (!%r) { msg $chan ( $+ $nick $+ ): There are NOT any nickname changes saved for $bold($2) nickname on my database yet! | return }
  20.  
  21.     msg $chan ( $+ $nick $+ ): $iif(%t == 1,There is $bold(%t) nickname change,There are $bold(%t) nickname changes) for $bold($2) nickname.
  22.     msg $chan ( $+ $nick $+ ): $iif(%t == 1,Nickname was:,Nicknames were:) $bold(%r)
  23.   }
  24.  
  25. }
  26.  
  27. ON !*:NICK: {
  28.   var %t = $comchan($newnick,0)
  29.   var %i = 1
  30.  
  31.   while (%i <= %t) {
  32.     var %c = $comchan($newnick,%i)
  33.     var %nc1 = $+($network,~,$newnick,~,%c)
  34.     var %nc2 = $+($network,~,$nick,~,%c)
  35.  
  36.     if (%c) && (!$istok($aka_excepts,%nc1,32)) && (!$istok($aka_excepts,%nc2,32)) {
  37.  
  38.       var %r1 = $readini($aka_file,n,%nc1,nicks)
  39.  
  40.       if (!%r1) { writeini -n $qt($aka_file) %nc1 nicks $nick }
  41.       else { var %r1 = $addtok(%r1,$nick,32) | writeini -n $qt($aka_file) %nc1 nicks %r1 }
  42.  
  43.       var %r2 = $readini($aka_file,n,%nc2,nicks)
  44.  
  45.       if (!%r2) { writeini -n $qt($aka_file) %nc2 nicks $newnick }
  46.       else { var %r2 = $addtok(%r2,$newnick,32) | writeini -n $qt($aka_file) %nc2 nicks %r2 }
  47.  
  48.     }
  49.  
  50.     inc %i
  51.   }
  52.  
  53. }
  54.  
  55. alias -l bold { return $+($chr(2),$1-,$chr(2)) }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement