[script]
n0=;--------------------------------------------------------------------------------------------------------------------
n1=
n2=raw 352:*:halt 
n3=raw 315:*:halt   
n4=
n5=; as you join channels, this'll check for clones,
n6=; display them, and color them; works the same if
n7=; clones join any channels that you may be on
n8=
n9=on 1:JOIN:#:{
n10=  if (!$ial) .ial on
n11=  if ($nick == $me) { %chanx = $chan | who %chanx | .timer [ $+ [ $ticks ] ] 1 3 ccheck }
n12=  if ($nick != $me) {
n13=    %chan = $chan
n14=    %addy = $wildsite
n15=    %clones = $cclone(%addy,%chan)
n16=    if (%clones) {
n17=      if (!$hget(color,%addy)) {
n18=        %colornum = $iif(%colornum == 11,1,$calc(%colornum + 1))
n19=        %usecolor = $gettok(3.4.6.7.8.9.10.11.12.13.14,%colornum,46)
n20=      }
n21=      var %y = 1
n22=      while (%y <= $numtok(%clones,32)) {
n23=        cline $iif($hget(color,%addy),$ifmatch,%usecolor) %chan $gettok(%clones,%y,32)
n24=        inc %y
n25=      }
n26=      if (!$hget(color,%addy)) hadd -m color %addy %usecolor
n27=      echo -bf %chan (4ÊËÎÓÍÛ): %clones
n28=      hfree clone
n29=    }
n30=    unset %chan %addy %clones %usecolor
n31=  }
n32=}
n33=
n34=; ccheck is the alias called to check for clones
n35=; as you join channels
n36=
n37=alias -l ccheck {
n38=  var %x = 1
n39=  while (%x <= $nick(%chanx,0)) {
n40=    %addyx = $address($nick(%chanx,%x),2)
n41=    %clones = $cclone(%addyx,%chanx)
n42=    if (%clones) { 
n43=      if (!$hget(color,%addyx)) {
n44=        %colornum = $iif(%colornum == 11,1,$calc(%colornum + 1))
n45=        %usecolor = $gettok(3.4.6.7.8.9.10.11.12.13.14,%colornum,46)
n46=      }
n47=      var %y = 1
n48=      while (%y <= $numtok(%clones,32)) {
n49=        cline $iif($hget(color,%addyx),$ifmatch,%usecolor) %chanx $gettok(%clones,%y,32)
n50=        inc %y
n51=      }
n52=      if (!$hget(color,%addyx)) hadd -m color %addyx %usecolor
n53=      echo -bf %chanx (4ÊËÎÍÛ): %clones
n54=    }
n55=    inc %x
n56=  }
n57=  if ($hget(clone)) hfree clone
n58=  unset %chanx %addyx %clones %usecolor
n59=}
n60=
n61=; $cclone([addy],[chan]) is what i used to 
n62=; loop thru any clone matches and append them to
n63=; a variable that i could use later
n64=
n65=alias -l cclone {
n66=  if ($ialchan($1,$2,0) >= 2) && (!$hget(clone,$1)) {
n67=    var %x = 1
n68=    while ($ialchan($1,$2,%x)) {
n69=      var %c.l = $addtok(%c.l,$ialchan($1,$2,%x).nick,32)
n70=      hadd -m clone $1 %c.l
n71=      inc %x
n72=    }
n73=  }
n74=  return $iif(%c.l,$ifmatch,$null)
n75=}
n76=
n77=; as clones leave, are kicked or quit irc; we
n78=; need to uncolor the remaining match (if 1)
n79=; so i assigned the required data to variables
n80=; that i use later in the nocl alias
n81=
n82=on 1:PART:#:{ if ($ialchan($wildsite,#,0) >= 2) { %c.w = $wildsite | %c.c = $chan | .timer [ $+ [ $ticks ] ] 1 1 nocl } }
n83=on 1:KICK:#:{ if ($ialchan($wildsite,#,0) >= 2) { %c.w = $address($knick,2) | %c.c = $chan | .timer [ $+ [ $ticks ] ] 1 1 nocl } }
n84=on 1:QUIT:{ if ($comchan($nick,0) > 0) { var %x = 1 | while ($comchan($nick,%x)) { %c.c = $comchan($nick,%x) | inc %x } } | if ($ialchan($wildsite,%c.c,0) >= 2) { %c.w = $wildsite | .timer [ $+ [ $ticks ] ] 1 1 nocl } | else unset %c.* }
n85=
n86=; the nocl alias loops thru each channel you're  
n87=; on, and uncolors any existing clone matches, if 
n88=; only one still remains
n89=
n90=alias -l nocl {
n91=  var %x = 1
n92=  while ($chan(%x)) {
n93=    if ($ialchan(%c.w,$chan(%x),0) == 1) {
n94=      cline -r $chan(%x) $ialchan(%c.w,$chan(%x),1).nick
n95=    }
n96=    inc %x
n97=  }
n98=  unset %c.*
n99=}
