You could...

eg:
Code:
; 1 problem with the following event: it has no way of tracking nick changes.
on 1:OPEN:?:*: who $nick
on 1:JOIN:#: who $chan

alias GetNicksByHostname {
  var %hostname = $+(*!*@,$1)
  var %r, %x = $ial(%hostname,0).nick

  while (%x) {
    %r = %r $ial(%hostname,%x).nick
    inc %x
  }

  return %r
}

alias GetNicksByHostname_TestCase {
  ; you need to run it on both, because the IRCd might use either hostname or IP...
  echo -a 127.0.0.1: $GetNicksByHostname(127.0.0.1)
  echo -a localhost: $GetNicksByHostname(localhost)

  var %myhost = $gettok($ial($me,1),2,$asc(@))
  echo -a %myhost $+ : $GetNicksByHostname(%myhost)
}