Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:CONNECT: {
- if (!$hget(CLONES)) { hmake CLONES 1000 }
- }
- ON *:DISCONNECT: {
- if ($hget(CLONES)) { hfree $v1 }
- }
- ON ^*:SNOTICE:*Client connecting*: {
- haltdef
- if (!$hget(CLONES)) { hmake CLONES 1000 }
- var %nick = $4
- var %ip = $remove($6,[,])
- if (!%nick) && (!%ip) { return }
- if ($check_clones(%ip)) {
- var %nicks = $v1
- var %total = $numtok(%nicks,32)
- echo 4 -s Nickname %nick has %total clones already connected from the same ip %ip address! - Nicknames: %nicks
- }
- hadd CLONES %nick %ip
- }
- ON ^*:SNOTICE:*Client exiting*: {
- haltdef
- var %nick = $4
- if (!%nick) { return }
- if ($hget(CLONES,%nick)) { hdel CLONES %nick }
- }
- ON ^*:SNOTICE:*has changed their nickname*: {
- haltdef
- var %old_nick = $2
- var %new_nick = $9
- if (!%old_nick) && (!%new_nick) { return }
- var %ip = $hget(CLONES,%old_nick)
- if (!%ip) { return }
- hdel CLONES %old_nick
- hadd CLONES %new_nick %ip
- }
- alias check_clones {
- ; $check_clones(ip)
- if (!$1) || (!$hget(CLONES)) { return 0 }
- var %t = $hfind(CLONES,* $+ $1 $+ *,0,w).data
- if (!%t) { return 0 }
- var %i = 1
- while (%i <= %t) {
- var %n = $hfind(CLONES,* $+ $1 $+ *,%i,w).data
- if (%n) { var %total = $addtok(%total,%n,32) }
- inc %i
- }
- return $iif(%total,$v1,0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement