Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ------- Settings --------
- alias -l ipn_file { return ipnicks.ini } ; = The database file.
- alias -l ipn_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 == !ipnick) {
- if (!$2) { msg $chan ( $+ $nick $+ ): Error, Please insert an IP Address! | return }
- if (!$check_ipv4($2)) { msg $chan ( $+ $nick $+ ): Error, Please insert a valid IP Address! | return }
- var %r = $readini($ipn_file,n,$2,nicks)
- var %t = $numtok(%r,32)
- if (!%r) { msg $chan ( $+ $nick $+ ): No results founded for $bold($2) IP Address! | return }
- msg $chan ( $+ $nick $+ ): $iif(%t == 1,There is $bold(%t) nickname change,There are $bold(%t) nickname changes) from $bold($2) IP Address.
- msg $chan ( $+ $nick $+ ): $iif(%t == 1,Nickname was:,Nicknames were:) $bold(%r)
- }
- }
- ON !*:NICK: {
- var %p = $gettok($msgtags(unrealircd.org/userip).key,2,64)
- if (!%p) || (!$check_ipv4(%p)) { return }
- var %t = $comchan($newnick,0)
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($newnick,%i)
- var %nc1 = $+($network,~,$nick,~,%c)
- var %nc2 = $+($network,~,$newnick,~,%c)
- if (!%c) { goto next }
- var %r = $readini($ipn_file,n,%p,nicks)
- if (!$istok($ipn_excepts,%nc1,32)) { var %r = $addtok(%r,$nick,32) }
- if (!$istok($ipn_excepts,%nc2,32)) { var %r = $addtok(%r,$newnick,32) }
- if (%r) { writeini -n $qt($ipn_file) %p nicks %r }
- :next
- inc %i
- }
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
- alias -l check_ipv4 {
- if (!$1) { return 0 }
- if ($regex($1,/^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})$/Sx)) && ($iptype($1) == ipv4) { return 1 }
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement