mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2004
Posts: 9
M
mrsk8r Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Nov 2004
Posts: 9
Hi!

I'm trying to make a script which finds the first shared channel, but unlike $comchan(), it should search on all active connections.

Here's what I have so far:
Code:
alias findfirstsharedchan {
  var %nick = SOMENICK
  var %network = 1
  var %chan
  while ((%network <= $scid(0)) && (!%chan)) {
    scon -s %network
    set %chan $comchan(%nick,1)
    inc %network
  }
  if (%chan) echo this is the first chan %nick is in: %chan
}


Unfortunately it doesn't find nicks on network 2 and on. Any ideas? (just change SOMENICK to a nick that you have on a network other than the first one)
Thanks in advance.

Last edited by mrsk8r; 09/05/07 09:32 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
alias findfirstsharedchan {
var %nick = $iif($1,$1,$$?="Enter nick")
.scon -at1 $!iif($comchan(%nick,1),echo -a First channel on $!network is $!v1)
}

This will display a list showing the first channel on each network that both you and the supplied nick share.

Usage: /findfirstsharedchan <nick>
NOTE: <nick> is required, however, if not supplied, you will be prompted for it.

Joined: Nov 2004
Posts: 9
M
mrsk8r Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Nov 2004
Posts: 9
Thanks!


Link Copied to Clipboard