From WikiChip
Editing mirc/on events/on join

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 2: Line 2:
 
The '''ON JOIN''' event triggers when the mIRC client, or a remote user, joins a channel.
 
The '''ON JOIN''' event triggers when the mIRC client, or a remote user, joins a channel.
  
'''Note''': When you join a channel yourself, $nick($chan,0) is always 1 inside the ON JOIN event because mIRC has to send /names to get the nickname; if you want to undertake some processing once the channel user list is complete, then use the RAW 366 event which indicates the end of the user list. Similarly, if you're an operator on the channel, you won't have been opped at the point that the ON JOIN event runs, so if you need to use your op capabilities inside the event script then you should use the ON OP event instead.
+
'''Note''': When you join a channel yourself, $nick($chan,0) is always 1 inside the on join event because mIRC has to send /names to get the nickname; the same way, if you're an operator on the channel, you won't be opped inside the on join event.
  
 
== Synopsis ==
 
== Synopsis ==
Line 8: Line 8:
  
 
== Parameters ==
 
== 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;">'''<level>'''</span>The level for the event to trigger.
  
 
<span style="display: inline-block; width: 105px;">'''<#,[,#]>'''</span>The text that to be matched. Can also be a {{mirc|wildcard}}.
 
<span style="display: inline-block; width: 105px;">'''<#,[,#]>'''</span>The text that to be matched. Can also be a {{mirc|wildcard}}.
Line 18: Line 18:
 
== Examples ==
 
== Examples ==
  
The following example makes use of the [[on me - mIRC|ON ME]] event, which triggers only when the local mIRC client triggers the event, not remote users.
+
The above example makes use of the [[on me - mIRC|ON ME]] event, which triggers only when the local mIRC client triggers the event, not remote users.
<source lang="mIRC">ON ME:*:JOIN:#testing: { msg $chan Hello $chan - Today is $day and time is $time }</source>
 
  
The following example works for everyone else who joins but except your self.
+
When a user joins, send them a greeting:
<source lang="mIRC">ON !*:JOIN:#mychan: { msg $chan Hey $nick $+ ! Welcome in our channel. }</source>
 
 
 
Who ever joins, send them a greeting:
 
 
<source lang="mIRC">ON *:JOIN:#:msg # Welcome to # $+ , $nick $+ !</source>
 
<source lang="mIRC">ON *:JOIN:#:msg # Welcome to # $+ , $nick $+ !</source>
 
Override the join event to print a custom text and then tell mIRC to ignore it's own text.
 
<source lang="mIRC">
 
on ^*:JOIN:*:{
 
  echo -tcbf join $chan * $nick ( $+ $fulladdress $+ ) join $chan
 
  halt
 
}
 
</source>
 
  
 
== Compatibility ==
 
== Compatibility ==
{{mIRC compatibility|4.5}}
+
{{mIRC compatibility|2.1a}}
  
 
== See Also ==
 
== See Also ==

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)