Code:
;NCN(Network,Channel,Nick) : see if a nick is a in channel on a network
;usage $NCN(Network,Channel,Nick)
; result ON    (nick present)
; result OFF   (nick not present)
; result $null (your not in there, or you didnt supply all parameters)
;
alias NCN {
  if (($1) && ($2) && ($3)) {
    var %r
    scon -at1 if ( $!network == $1 ) $({,) if ( $!chan( $2 ) ) $({,) if ( $3 ison $2 ) $({,) var $+(%,r) = ON $(},) $(|,) else $({,) var $+(%,r) = OFF $(},) $(},) $(},)
    return %r
  }
}


This works on multiple networks and/or multiple connections to a same network.