Maybe something like this:
Code:
alias netcheck { 
  if ($1) { 
    scid -at1 whois $1 
    set %netcheck.total $scon(0) 
    set %netcheck.whois $1
  } 
  else { 
    echo -a ** Please specify the nick to scan for
  } 
}
raw 312:*: {
  if (%netcheck.whois) { 
    echo -a %netcheck.whois is connected to $network 
    if ($scid == %netcheck.total) {
      unset %netcheck.total | unset %netcheck.whois 
    }
  }
}


Good luck.
smile