Quote:
And why does it work on one nick, but doesn't work on other?

I'm not certain what you meant by that, but the reason it had some of the addresses is that those people had done something since you joined the channel (e.g said something).


You can't just put "who #" at the start of the loop because you have to wait for the reply to be sent containing the addresses. There are two solutions. One is to use a timer to wait a suitable amount of time before starting the loop, this isn't ideal if you're lagged or using it on large channels, nor would it hide the /who output. The other would be to use raws to hide the output and wait until the /who list had been sent.

Solution 1:
Code:
alias loop1 {
  if ( $ialchan(*,#,0) != $nick(#,0) ) {
    who #
    .timer 1 10 loop2
  }
  else {
    loop2
  }
}
alias loop2 {
  var %i = 1
  while ( $address($nick(#,%i),5) ) {
    echo -a $ifmatch
    inc %i
  }
}

To start it type /loop1 in a channel. It should then wait 10 seconds and list the addresses of all users in the channel.

Solution 2:
This isn't perfect and might be overkill, but should set you in the right direction:

Code here to keep post short.

To start it type /loop1 in a channel. If the IAL for that channel has all the addresses it will goto loop2, otherwise it will /who the channel (hiding the output), then call loop2.