Extended $network Identifier

By gooshie on Dec 06, 2009

This extends the $network identifier to
act simular to the $server identifier
and also includes a list function.

Example: $network(0)
Returns: Total Number of Networks

Example: $network(1)
Returns: First Networks Name

Example: $network(list)
Returns: Comma separated List of Network Names

Hint: Use $cand($network(list)) together for
use in a sentence. (see my $cand identifier)

Image

alias network {
  var %i 1,%n
  while $scon(%i) {
    scid $v1
    if ($status = connected) %n = $addtok(%n,$network,44)
    inc %i
  }
  if ($1 = 0) %n = $numtok(%n,44)
  elseif ($1 isnum 1- $scon(0)) %n = $gettok(%n,$1,44)
  elseif ($1 != list) %n = ""
  return %n
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.