Common Chans for mIRC

By Tritonio on Jan 22, 2015

The implementation is inefficient in many ways but I just threw it together quickly to check how interesting it is. It is interesting. :-)

Press F6 while you're in a channel and it will open a new window where for each of the users in the chan, it will show you any other chans that you share in common with that user. For big rooms it will take some time, don't worry it doesn't crash but mIRC might go "white" for a few minutes if you run this on a 1000+ users room and you are also on a couple other rooms with a lot of users.

alias F6 {
  window -a @commonchans
  var %myserver = $cid
  var %mychanname = $chan
  var %mynick = $mnick
  var %h = 1
  aline 9 @commonchans ----------------------------------
  aline 9 @commonchans $chr(160) $chr(160) CHANNEL $chan
  aline 9 @commonchans ----------------------------------
  while ($nick(#,%h)) {
    ;aline @commonchans Checking $nick(#,%h) $+ ...
    var %nicktoseek = $nick(#,%h)
    var %i = 1
    while ($scon(%i)) {
      scid $scon(%i)
      var %j = 1
      while ($chan(%j)) {
        if ($chan(%j) != %mychanname || $scon(%i) != %myserver) {
          var %k = 1
          while ($nick($chan(%j),%k)) {
            if (%nicktoseek == $nick($chan(%j),%k) && %mynick != %nicktoseek) {
              aline 4 @commonchans $nick($chan(%j),%k) is also on $chan(%j)
            }
            inc %k
          }
        }
        inc %j
      }
      scid -r
      inc %i
    }
    inc %h
  }
}   

Comments

Sign in to comment.
HeilTec   -  Feb 05, 2015

As I read this I am reminded of an old script I made using the built-in mIRC variable $comchan - pasted a long time ago - http://pastebin.com/dNQjvM4g

menu nicklist {
  Common channels $1: /comchans $1
}
alias comchans {
  var %n $comchan($1,0)
  var %i 0
  var %t %n common channels for $1 $+ :
  while (%i < %n) {
    inc %i 1
    var %t %t $comchan($1,%i)
  }
  echo -a %t
}

More primitive output directly in the channel but it has served me well showing a single user at the time.
Scanning all users could be useful - sometimes.

Tritonio  -  Mar 02, 2015

Thanks for pointing out $comchan. Never seen it before. I wonder if it spans multiple servers too like my version of it.

Sign in to comment

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.