From WikiChip
Difference between revisions of "mirc/identifiers/$nick"
< mirc‎ | identifiers

m (PatrolBot moved page $nick identifier - mIRC to mirc/identifiers/$nick: per new naming convention)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''$nick''' identifier will return the nickname associated with a triggered event.
+
{{mirc title|$nick identifier}}'''$nick''' can be called in two ways:
 +
 
 +
# '''$nick''' will return the nickname associated with an IRC event.
 +
# '''$nick(#channel,index)''' retrieves information about nicknames on a specific channel.
  
This identifier can also be used to retrieve information about nicknames on a certain channel.
 
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$nick[(#,N/nick,aohvr,aohvr)[.property]]</pre>
+
<pre>$nick</pre>
 +
<pre>$nick(#,N/nick,aohvr,aohvr)</pre>
  
 
== Parameters ==
 
== Parameters ==
Line 29: Line 32:
 
|}
 
|}
  
 +
Except for Type 'a' which has been defined as all users in the channel, channel modes given to users and pnick characters can also be used as nick types. This includes networks where channel owner is given mode +q and pnick character ! or ~, and superop is given mode +a and pnick character &. This next table assumes channel is at a network supporting the additional channel modes given to nicks.
  
== Properties ==
 
 
{| class="wikitable" style="margin-left: 105px;"
 
{| class="wikitable" style="margin-left: 105px;"
 
|-
 
|-
! Type !! Description
+
! Add'l Types !! Description
 +
|-
 +
| '''q''' || Channel Owner having mode +q
 +
|-
 +
| '''~''' || Channel Owner having pnick character ~
 
|-
 
|-
| <span style="margin-right: 15px;">'''pnick'''</span> || <span style="padding-left: 15px;">Display the target result with their elevation level, eg: @,+,%. Regular users display normal.</span>
+
| '''&''' || SuperOp (a.k.aa Protected Op)  having pnick character &
 
|-
 
|-
| <span style="margin-right: 15px;">'''idle'''</span> || <span style="padding-left: 15px;">Operators</span>
+
| '''@''' || Operators
 +
|-
 +
| '''%''' || Helpers
 +
|-
 +
| '''+''' || Voiced
 
|}
 
|}
 +
 +
 +
== Properties ==
 +
* '''.pnick''' - Returns the target result with their elevation level, eg: @,+,%. Regular users display normal.
 +
* '''.idle''' - Returns the current idle time for the nickname on the channel specified
 +
* '''.color''' - Returns the color for that user as set up in the Nick color dialog
  
 
== Examples ==
 
== Examples ==
Line 94: Line 111:
  
 
[[File:$nick identifer example results - mIRC.png|Shows the example results.]]
 
[[File:$nick identifer example results - mIRC.png|Shows the example results.]]
 +
 +
'''Note:''' A nick can have several channel modes, and the nicklist will display only the highest level. To have an exact count of the nicks displaying a certain nick type, you should have the 3rd parameter be the list of all types of that level and greater, then have the 4th parameter be the nick types greater than the specified level. For example, networks supporting levels above @Operator also give +o. ~ChannelOwner is given modes +qo and &ProtectedOp is given mode +ao. Some networks allow the Founder to give +q to several other users, so the ~ prefix isn't always an indication that someone is the channel owner/founder.
 +
 +
<pre>//echo -a There are $nick($chan,0,~&o,~&) nicks at the @operator level excluding Owners and SuperOps</pre>
  
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|2.1a}}
 
{{mIRC compatibility|2.1a}}
  
== See Also ==
+
== See also ==
 
* {{mIRC|$chan}}
 
* {{mIRC|$chan}}
* [[On events - mIRC|ON Events]]
+
* {{mIRC|on events}}
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
  
[[Category:MIRC identifiers]]
+
[[Category:mIRC identifiers|nick]]

Latest revision as of 06:05, 13 December 2018

$nick can be called in two ways:

  1. $nick will return the nickname associated with an IRC event.
  2. $nick(#channel,index) retrieves information about nicknames on a specific channel.


Synopsis[edit]

$nick
$nick(#,N/nick,aohvr,aohvr)

Parameters[edit]

#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[edit]

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

Except for Type 'a' which has been defined as all users in the channel, channel modes given to users and pnick characters can also be used as nick types. This includes networks where channel owner is given mode +q and pnick character ! or ~, and superop is given mode +a and pnick character &. This next table assumes channel is at a network supporting the additional channel modes given to nicks.

Add'l Types Description
q Channel Owner having mode +q
~ Channel Owner having pnick character ~
& SuperOp (a.k.aa Protected Op) having pnick character &
@ Operators
% Helpers
+ Voiced


Properties[edit]

  • .pnick - Returns the target result with their elevation level, eg: @,+,%. Regular users display normal.
  • .idle - Returns the current idle time for the nickname on the channel specified
  • .color - Returns the color for that user as set up in the Nick color dialog

Examples[edit]

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.

Note: A nick can have several channel modes, and the nicklist will display only the highest level. To have an exact count of the nicks displaying a certain nick type, you should have the 3rd parameter be the list of all types of that level and greater, then have the 4th parameter be the nick types greater than the specified level. For example, networks supporting levels above @Operator also give +o. ~ChannelOwner is given modes +qo and &ProtectedOp is given mode +ao. Some networks allow the Founder to give +q to several other users, so the ~ prefix isn't always an indication that someone is the channel owner/founder.

//echo -a There are $nick($chan,0,~&o,~&) nicks at the @operator level excluding Owners and SuperOps

Compatibility[edit]

Added: mIRC v2.1a
Added on: 28 Feb 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also[edit]

v · d · e mIRC identifier list

$ $$, $, $0, $1-, $!, $&, $*, $+, $++, $?

A $abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime

B $banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes

C $calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter

D $date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration

E $ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting

F $false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen

G $get, $getdir, $getdot, $gettok, $gmt, $group

H $halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot

I $iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf

K $keychar, $keyrpt, $keyval, $knick

L $lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer

M $maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags

N $N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick

O $ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os

P $parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok

Q $qt, $query

R $r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round

S $samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir

T $tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust

U $ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode

V $v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol

W $wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap

X $xor

Y $yes

Z $zip

= =$nick