From WikiChip
Editing mirc/on events/on nick

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{mirc title|On Nick - Events}}
 
 
The '''ON NICK''' event triggers when a user is on the same channel as you, and they change their nickname.
 
The '''ON NICK''' event triggers when a user is on the same channel as you, and they change their nickname.
  
This event fills the '''{{mIRC|$newnick}}''' and '''{{mIRC|$nick}}''' identifiers.
+
This event fills the '''[[$chan identifier - mIRC|$chan]]''', '''[[$newnick identifier - mIRC|$newnick]]''', and '''[[$nick identifier - mIRC|$nick]]''' identifiers.
  
 
{| class="wikitable" style="line-height: 25px; margin-left: 75px;"
 
{| class="wikitable" style="line-height: 25px; margin-left: 75px;"
Line 8: Line 7:
 
! Identifier !! Description
 
! Identifier !! Description
 
|-
 
|-
| '''$newnick''' || The new nickname of the user. You can use it with $comchan for example.
+
| '''$chan''' || The channel name where the event occurred. This can also be '''#'''.
 +
|-
 +
| '''$newnick''' || The new nickname of the user.
 
|-
 
|-
 
| '''$nick''' || The user's previous nickname.
 
| '''$nick''' || The user's previous nickname.
Line 15: Line 16:
 
== Synopsis ==
 
== Synopsis ==
 
<pre>ON <level>:NICK:<commands></pre>
 
<pre>ON <level>:NICK:<commands></pre>
 
== Parameters ==
 
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The corresponding {{mIRC|access levels}} for the event to trigger.
 
 
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.
 
 
  
 
== Example ==
 
== Example ==
 
Echo the nickname change, and disregard mIRC's default nick change message:
 
Echo the nickname change, and disregard mIRC's default nick change message:
 
<source lang="mIRC">ON ^*:NICK: {
 
<source lang="mIRC">ON ^*:NICK: {
   echo $comchan($newnick,1) * $nick |==> $newnick
+
   echo $chan * $nick |==> $newnick
  
 
   ; Halt the default mIRC message
 
   ; Halt the default mIRC message
Line 36: Line 31:
 
Echo to the channel when the local nickname is changed, and halt mIRC's default message:
 
Echo to the channel when the local nickname is changed, and halt mIRC's default message:
 
<source lang="mIRC">ON ME:^*:NICK: {
 
<source lang="mIRC">ON ME:^*:NICK: {
   echo $comchan($newnick,1) You are now ==> $newnick
+
   echo $chan You are now ==> $newnick
  
 
   ; Halt the default mIRC message
 
   ; Halt the default mIRC message
Line 45: Line 40:
 
<pre>You are now ==> whoMe</pre>
 
<pre>You are now ==> whoMe</pre>
  
<source lang="mIRC">
+
== Compatibility ==
Because ON NICK is not associated with # or $chan, to show a nick change message in all channels you share with that nick, you can use $comchan. You can simulate mIRC's default Nick Change message in channels with:
+
Added: mIRC v2.1a
  
ON ^*:NICK:{
+
Added On: 28/02/95
  var %i $comchan($newnick,0)
 
  while (%i) {
 
    echo -ctg nick $chan(%i) * # $iif($nick == $me,Your nick # is now,$nick is now known as) $newnick
 
    dec %i
 
  }
 
; You can precede HALTDEF with a semi-colon to compare this messages with the default
 
haltdef
 
}
 
</source>
 
 
 
== Compatibility ==
 
{{mIRC compatibility|2.1a}}
 
  
 
== See Also ==
 
== See Also ==
Line 66: Line 49:
 
* [[On mode - mIRC|ON MODE]]
 
* [[On mode - mIRC|ON MODE]]
 
* [[On part - mIRC|ON PART]]
 
* [[On part - mIRC|ON PART]]
* {{mIRC|$newnick}}
+
* [[$newnick identifier - mIRC|$newnick]]
* {{mIRC|$nick}}
+
* [[$nick identifier - mIRC|$nick]]
{{mIRC on event list}}
 
  
[[Category:mIRC on events|nick]]
+
[[Category:mIRC on events]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)