mIRC Home    About    Download    Register    News    Help

Print Thread
Big project: Returning the user with the most Comc #177893 01/06/07 11:43 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Returning the users with the most comchans.

Anybody think they can make a while loop for listing the users from the most comchans to the least (let's just say, down to 3 comchans)?

And perhaps on a local and global scale. Local is a bit unnecessary though.

For global, just scan it by nick. I.e., I have an alias that returns all the global comchans by nick, but it would be nice if someone could make an alias to /echo a list of who has the most comchans in all your channels globally down to persay, 3 or 2 comchans (since listing 1 comchan would be virtually your entire IAL).

An output like..

NickX - 8 comchans with you.
Nick2 - 6 comchans with you.
Etc.

And then, ties would be, well, in random or alphabetical order.

;/

Re: Big project: Returning the user with the most [Re: LostShadow] #177898 02/06/07 06:23 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Too late & too tired to write this up now, but I'll do it up after I get home from work, in about 10 hours.

BTW: Do you want the results shown to all in channel, just to you in channel, via a custom window, a dialog box or some combination there of.

Additionally, how are you defining the difference between local and global. If global is a match across all networks that you're on, note that it's possible for two different people to be using the same nick on two different networks, so your Global common channels won't technically be 100% correct.

On the other hand, if you mean local, as in on the same server that you're connected to, and global meaning all of the interlinked servers creating the network, this will be more difficult, and I believe, will require you to have IRCops level status on the network (referencing UnRealIRCd)

Re: Big project: Returning the user with the most [Re: LostShadow] #177900 02/06/07 07:10 AM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Here's a code using $ial

Code:
alias cc {
  var %i = $ial(*,0), %w = @comchans
  window %w
  while %i {
    if ( $ial(*,%i).nick != $me ) && ( $comchan($ial(*,%i).nick,0) > 1 ) aline %w $ial(*,%i).nick - $v1 comchans
    dec %i
  }
  filter -wwtcue 3 32 %w %w 
}


Usage: /cc

Another that will loop to all connections, channels, nicks & will distinguish to which connection that nick was

Code:
alias cc2 {
  var %s = $scon(0), %c, %n, %m, %w = @comchans
  window %w
  while %s {
    scon %s
    %c = $chan(0)
    while %c {
      %n = $nick($chan(%c),0)
      while %n {
        %m = $nick($chan(%c),%n) 
        if ( %m != $me ) && ( !$fline(%w,$network $+ : %m *,0) ) && ( $comchan(%m,0) > 1  ) aline %w $network $+ : %m - $v1 comchans
        dec %n
      }
      dec %c
    }
    dec %s
  }
  filter -wwtcue 4 32 %w %w 
}

Usage: /cc2

Last edited by xDaeMoN; 02/06/07 07:31 AM.

If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Re: Big project: Returning the user with the most [Re: RusselB] #180318 07/07/07 04:52 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: RusselB
Too late & too tired to write this up now, but I'll do it up after I get home from work, in about 10 hours.

BTW: Do you want the results shown to all in channel, just to you in channel, via a custom window, a dialog box or some combination there of.

Additionally, how are you defining the difference between local and global. If global is a match across all networks that you're on, note that it's possible for two different people to be using the same nick on two different networks, so your Global common channels won't technically be 100% correct.

On the other hand, if you mean local, as in on the same server that you're connected to, and global meaning all of the interlinked servers creating the network, this will be more difficult, and I believe, will require you to have IRCops level status on the network (referencing UnRealIRCd)


You can echo it to a custom window. As far as different people using the same nick on different networks, that's fine.