Clones color

By Corne on May 07, 2005

This snippet checks users on join and if there are 2 or more with the same !@host.domain.com it changes their nicknames' color. If there are more than 14 pairs of clones then the nicknames' colors will start to repeat. It also has a popup which allows you to kick/ban clones easier. Just try it...

ON *:JOIN:#:{
  var %clone = 1
  if ($ialchan($wildsite,#,0) > 1) && ($($+(%,clones,.,$wildsite,.,$chan,.,$network),2) == $null) {
    if ($($+(%,colors,.,$chan,.,$network),2) == $null) { 
      set $+(%,colors,.,$chan,.,$network) 2 
      set $+(%,clones,.,$wildsite,.,$chan,.,$network) $ialchan($wildsite,#,0) $($+(%,colors,.,$chan,.,$network),2)
      while %clone <= $ialchan($wildsite,#,0) {
        cline $gettok($($+(%,clones,.,$wildsite,.,$chan,.,$network),2),2,32) # $ialchan($wildsite,#,%clone).nick 
        inc %clone
      }    
    }    
    elseif ($($+(%,colors,.,$chan,.,$network),2) != $null) && ($($+(%,colors,.,$chan,.,$network),2) < 15) {
      inc $+(%,colors,.,$chan,.,$network)
      set $+(%,clones,.,$wildsite,.,$chan,.,$network) $ialchan($wildsite,#,0) $($+(%,colors,.,$chan,.,$network),2)
      while %clone <= $ialchan($wildsite,#,0) {
        cline $gettok($($+(%,clones,.,$wildsite,.,$chan,.,$network),2),2,32) # $ialchan($wildsite,#,%clone).nick 
        inc %clone
      }
    }
    elseif ($($+(%,colors,.,$chan,.,$network),2) != $null) && ($($+(%,colors,.,$chan,.,$network),2) > 15) {
      set $+(%,colors,.,$chan,.,$network) 2 
      set $+(%,clones,.,$wildsite,.,$chan,.,$network) $ialchan($wildsite,#,0) $($+(%,colors,.,$chan,.,$network),2)
      while %clone <= $ialchan($wildsite,#,0) {
        cline $gettok($($+(%,clones,.,$wildsite,.,$chan,.,$network),2),2,32) # $ialchan($wildsite,#,%clone).nick 
        inc %clone
      }    
    }    
  }
  elseif ($ialchan($wildsite,#,0) > 1) && ($($+(%,clones,.,$wildsite,.,$chan,.,$network),2) != $null) {
    set $+(%,clones,.,$wildsite,.,$chan,.,$network) $ialchan($wildsite,#,0) $gettok($($+(%,clones,.,$wildsite,.,$chan,.,$network),2),2,32)
    while %clone <= $ialchan($wildsite,#,0) {
      cline $gettok($($+(%,clones,.,$wildsite,.,$chan,.,$network),2),2,32) # $ialchan($wildsite,#,%clone).nick 
      inc %clone
    }
  }
}
menu nicklist {
  $iif(($me isop #), Ban clones):{
    set %reason $?="Reason ?"
    if ($ialchan($address($1,2),#,0) > 1) { 
      var %nicks = 1
      var %addrs = ($ialchan($address($1,2),#,0)
      while $ialchan($address($1,2),#,%nicks) >= %addrs {
        if (%reason != $null) .ban -k $chan $ialchan($address($1,2),#,%nicks).nick 2 %reason | unset $+(%,clones,.,$address($1,2),.,$chan,.,$network)
        inc %nicks
      }
      dec $+(%,colors,.,$chan,.,$network)
    }
    elseif ($ialchan($address($1,2),#,0) == 1) { 
      if (%reason != $null) .ban -k $chan $1 2 %reason
    }
  }
}
ON *:DISCONNECT:{ unset $+(%,clones,.,*,.,*,.,$network) | unset $+(%,colors,.,*,.,$network) }
ON me:*:PART:#:{ unset $+(%,clones,.,*,.,*,.,$network) | unset $+(%,colors,.,$chan,.,$network) }
ON *:PART:#:{ if ($($+(%,clones,.,$address($nick,2),.,$chan,.,$network),2) != $null) && ($ialchan($address($nick,2),#,0) == 1) { dec $+(%,colors,.,$chan,.,$network) | unset $+(%,clones,.,$address($nick,2),.,$chan,.,$network) } }
ON *:KICK:#:{ if ($($+(%,clones,.,$address($knick,2),.,$chan,.,$network),2) != $null) && ($ialchan($address($knick,2),#,0) == 1)  { dec $+(%,colors,.,$chan,.,$network) | unset $+(%,clones,.,$address($knick,2),.,$chan,.,$network) } }
on me:*:join:#:{ 
  inc $+(%,who,.,$cid,#) 
  .timer 1 5 who # 
} 
raw 352:*:{ if ($($+(%,who,.,$cid,$2),2)) halt }
raw 315:*:{ halt } 

Comments

Sign in to comment.
Joshuaxiong1   -  Oct 08, 2007

Nice idea but will it work when I join in last before the clone did? No

 Respond  
guest598594   -  Jul 13, 2007

nvm

 Respond  
guest598594   -  Jul 13, 2007

is there any way to change the color?

 Respond  
stargazer989   -  Jul 03, 2007

So before i ask anything dumb could you post the commands for me?

 Respond  
Corne   -  Jun 07, 2005

thanks

 Respond  
F*U*R*B*Y*   -  Jun 07, 2005

great ascript not bad going on bot thanks

 Respond  
dem0n   -  Jun 06, 2005

Cool. Good job!

 Respond  
boris1   -  May 14, 2005

it`s working i tested on my mirc

 Respond  
Corne   -  May 10, 2005

You can use this: /cline color_number #channel nickname to change the color of one nickname

 Respond  
WDragon   -  May 10, 2005

how do i change the colour of the clones shown from dark blue to red ??

 Respond  
Corne   -  May 09, 2005

I\'ve updated the code. Now it is multi-channel and multi-server and I also fixed the part, kick, disconnect events.

 Respond  
Corne   -  May 07, 2005

I like it too :)

 Respond  
Ville   -  May 07, 2005

I like this alot.. one of the best snippets ive seen on hawkee. keep up thee good work.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.