From WikiChip
mirc/identifiers/$nick
< mirc‎ | identifiers
Revision as of 17:39, 25 June 2014 by Zmodem (talk | contribs) (Created $nick identifier - mIRC)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The $nick identifier will return the nickname associated with a triggered event.

This identifier can also be used to retrieve information about nicknames on a certain channel.

Synopsis

$nick[(#,N/nick,aohvr,aohvr)[.property]]

Parameters

#The channel name to look up nickname information.

N/nickCan be either a number to look up a particular Nth user (if N is 0, returns total matching users based on criteria), or can be a nickname to target a specific user.

aohvrOptional: The first aohvr characters target all users of a specific type, while the second aohvr excludes a specific type from the target list.

Specific Types

Types Description
a All users
o Operators
h Helpers
v Voiced
r Regular users


Properties

Type Description
pnick Display the target result with their elevation level, eg: @,+,%. Regular users display normal.
idle Operators

Examples

Echo to the active screen the total amount of users in the channel:

//echo -a Total users: $iif($active ischan,$nick(#,0))

Echo to the active screen the number of operators in the channel:

//echo -a Total users: $iif($active ischan,$nick(#,0,o))

Echo to the active screen all elevated users only, excluding regular users:

//echo -a Total users: $iif($active ischan,$nick(#,0,a,r))

Create an alias that will open a custom @window, and detail the user list:

alias getUserDetails {
 
  ; Make sure the active window is a channel
  if ($active ischan) {
 
    ; Set the %c variable to the channel name
    var %c = $active
    window @getUserDetails 350 350 650 300
 
    ; Clear the window justin in case it
    ; was already opened previously
    clear @getUserDetails
 
    ; Echo all of the user details
    echo @getUserDetails Channel: %c
    echo @getUserDetails $crlf $crlf
    echo @getUserDetails Total Users: $nick(%c,0)
    echo @getUserDetails Operators: $nick(%c,0,o)
    echo @getUserDetails Voices: $nick(%c,0,v)
    echo @getUserDetails Helpers: $nick(%c,0,h)
    echo @getUserDetails Regular Users: $nick(%c,0,r)
    echo @getUserDetails $crlf $crlf
 
    ; Below lists elevated users, whom are the ops/voices/helpers
    echo @getUserDetails Total Elevated Users: $nick(%c,0,a,r)
    echo @getUserDetails $crlf $crlf
 
    ; Lastly, list the nickname of the first nickname in the
    ; op list, voice list, helper list, and regular user list
    echo @getUserDetails First operator/voice/helper/regular users:
    echo @getUserDetails $lf $iif($nick(%c,1,o),$v1,NONE)
    echo @getUserDetails $lf $iif($nick(%c,1,v),$v1,NONE)
    echo @getUserDetails $lf $iif($nick(%c,1,h),$v1,NONE)
    echo @getUserDetails $lf $iif($nick(%c,1,r),$v1,NONE)
  }
}

The above command is executed in a channel command-line by typing:

/getUserDetails

The results from the above will look something like this:

Shows the example results.

Compatibility

Added: mIRC v2.1a

Added On: 28/02/95

See Also