/ccs { //set %z 123nick /set %x 1 while (%x <= $comchan($me,0)) { /set %y 1 while (%y <= $nick($comchan($me,%x),0)) { if ($comchan($nick($comchan($me,%x),%y),0) > $comchan(%z,0)) && ($nick($comchan($me,%x),%y) != $me) { //set %z $nick($comchan($me,%x),%y) } /inc %y 1 } /inc %x 1 } //msg $active  $+ %z has the most common channels with me, totaling $comchan(%z,0) $+ ! /unset %x %y %z }