Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ------- Settings --------
- alias -l aka_file { return aka.ini } ; = The database file.
- alias -l aka_excepts { return network1~nickname1~#channel1 network2~nickname2~#channel2 } ; = format is NETWORK~NICKAME~#CHANNEL so e.g ChatHUB~westor~#mSL
- ; ------- Settings --------
- ON *:TEXT:*:#: {
- tokenize 32 $strip($1-)
- if ($1 == !aka) {
- if (!$2) { msg $chan ( $+ $nick $+ ): Error, Please insert a nickname! | return }
- if ($2 == $me) || ($2 == $nick) { msg $chan ( $+ $nick $+ ): Error, Incorrect target! | return }
- var %nc = $+($network,~,$2,~,$chan)
- var %r = $readini($aka_file,n,%nc,nicks)
- var %t = $numtok(%r,32)
- if (!%r) { msg $chan ( $+ $nick $+ ): There are NOT any nickname changes saved for $bold($2) nickname on my database yet! | return }
- msg $chan ( $+ $nick $+ ): $iif(%t == 1,There is $bold(%t) nickname change,There are $bold(%t) nickname changes) for $bold($2) nickname.
- msg $chan ( $+ $nick $+ ): $iif(%t == 1,Nickname was:,Nicknames were:) $bold(%r)
- }
- }
- ON !*:NICK: {
- var %t = $comchan($newnick,0)
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($newnick,%i)
- var %nc1 = $+($network,~,$newnick,~,%c)
- var %nc2 = $+($network,~,$nick,~,%c)
- if (%c) && (!$istok($aka_excepts,%nc1,32)) && (!$istok($aka_excepts,%nc2,32)) {
- var %r1 = $readini($aka_file,n,%nc1,nicks)
- if (!%r1) { writeini -n $qt($aka_file) %nc1 nicks $nick }
- else { var %r1 = $addtok(%r1,$nick,32) | writeini -n $qt($aka_file) %nc1 nicks %r1 }
- var %r2 = $readini($aka_file,n,%nc2,nicks)
- if (!%r2) { writeini -n $qt($aka_file) %nc2 nicks $newnick }
- else { var %r2 = $addtok(%r2,$newnick,32) | writeini -n $qt($aka_file) %nc2 nicks %r2 }
- }
- inc %i
- }
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement