From WikiChip
Editing mirc/access levels

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|Access Levels}}
+
{{mIRC Guide}}
 
'''Access levels''' in [[mIRC]] are a mechanism by which events can be restricted to certain user levels or named groups. Almost all [[On events - mIRC|events]] have a level parameter that specifies the event's access level.
 
'''Access levels''' in [[mIRC]] are a mechanism by which events can be restricted to certain user levels or named groups. Almost all [[On events - mIRC|events]] have a level parameter that specifies the event's access level.
  
Line 9: Line 9:
 
Access levels are comma-delimited values that define the levels of the user. Although usually, the levels are numeric, you can use a name instead like "botAdmin" or "friends".
 
Access levels are comma-delimited values that define the levels of the user. Although usually, the levels are numeric, you can use a name instead like "botAdmin" or "friends".
  
The <additional info> parameter is an optional parameter that can be used to store some additional information about the user or other useful miscellaneous data.
+
The <info> parameter is an optional parameter that can be used to store some additional information about the user or other useful miscellaneous data.
  
 
  10,20:some!one@example.com
 
  10,20:some!one@example.com
 
  friend:dan!z@some.isp.net high school friend
 
  friend:dan!z@some.isp.net high school friend
  
=== Adding users ===
+
== Adding/Removing users ==
 
There are two commands that can be used to add a user to the access list, {{mIRC|/auser}} and {{mIRC|/guser}}. They follow this syntax:
 
There are two commands that can be used to add a user to the access list, {{mIRC|/auser}} and {{mIRC|/guser}}. They follow this syntax:
  
Line 29: Line 29:
 
</source>
 
</source>
  
=== Removing users ===
 
 
The {{mIRC|/ruser}} command can be used to remove a user completely from the access list or simply remove one of his levels.
 
The {{mIRC|/ruser}} command can be used to remove a user completely from the access list or simply remove one of his levels.
  
Line 36: Line 35:
 
</source>
 
</source>
  
For example:
+
=== For example: ===
 
<source lang="mIRC">
 
<source lang="mIRC">
 
/ruser madman 2
 
/ruser madman 2
Line 42: Line 41:
 
</source>
 
</source>
  
=== Changing users' info ===
 
 
The user info parameter can be changed at any time using the {{mIRC|/iuser}} command:
 
The user info parameter can be changed at any time using the {{mIRC|/iuser}} command:
  
Line 49: Line 47:
 
</source>
 
</source>
  
== Event prefixes ==
+
=== Usage ===
mIRC offers a lot of prefixes to slightly alter how the event activates.
+
The <level> parameter of an event is used to indicate which level/group can activate that event. For example:
 
 
=== * prefix ===
 
The * prefix is the most commonly used prefix, and allows any user to activate the event regardless of their access level.
 
  
For example:
 
 
<source lang="mIRC">
 
<source lang="mIRC">
on *:text:!time:#:{
+
on 10:text:.hello:#:{
   notice $nick the time for me is $time
+
   msg $chan Hello $nick $+ !
 
}
 
}
 
</source>
 
</source>
  
=== Numeric prefixes ===
+
Notice the access level defined is 10. In this case any user in your access list level 10 or above will trigger this event.
Numeric prefixes allow any user with an access level >= the prefix to activate the event.
 
  
For example:
+
== Event prefixes ==
<source lang="mIRC">
+
mIRC offers a verity of prefixes to slightly alter how the event activates.
on +5:text:.h:#myChan:{
 
  mode $chan +h $nick
 
}
 
</source>
 
can be executed by any user with access level 5 or greater.
 
  
=== ^ prefix ===  
+
=== me prefix ===
 +
The 'me' prefix can be used to get an event to trigger only if you triggered it (if ($nick == $me)
  
By default, your event are triggered after mIRC has processed this event itself. For example if someone talks to you in a query, mIRC will display the text in that window, triggers the various beep and flash option if any, and only then trigger on text.
+
'''Note''': the me prefix is a bit special, it requires a new semi colon before others prefixes.
  
The ^ prefix tells mIRC to process your event before it processes the event itself. This prefix typically only works with IRC event but here is a full list of supported events: {{mIRC|on action}}, {{mIRC|on ban}}, {{mIRC|on chat}}, {{mIRC|on dehelp}}, {{mIRC|on deop}}, {{mIRC|on devoice}}, {{mIRC|on help}}, {{mIRC|on invite}}, {{mIRC|on join}}, {{mIRC|on kick}}, {{mIRC|on mode}}, {{mIRC|on nick}}, {{mIRC|on notice}}, {{mIRC|on op}}, {{mIRC|on open}}, {{mIRC|on part}}, {{mIRC|on ping}}, {{mIRC|on text}}, {{mIRC|on unban}}, {{mIRC|on usermode}}, {{mIRC|on voice}}, {{mIRC|on quit}}, {{mIRC|on serv}}, {{mIRC|on servermode}}, {{mIRC|on serverop}}, {{mIRC|on snotice}}, {{mIRC|on tabcomp}}, {{mIRC|on topic}}, {{mIRC|on wallops}}.
+
For example:
 
 
This prefix, coupled with {{mIRC|/halt}} or {{mIRC|/haltdef}}, allows you to display your own message for a given event, or it allows you to prevent a query window from opening with {{mIRC|on open}}, or to prevent a nick completion in {{mIRC|on tabcomp}}
 
 
 
=== + prefix ===
 
By default, the numeric prefix means that level and any level higher can trigger that event. Using the + prefix, you can limit the event to be exactly the level specified.
 
  
For example:
 
 
<source lang="mIRC">
 
<source lang="mIRC">
on +5:text:.h:#myChan:{
+
on me:*:join:#support:{
   mode $chan +h $nick
+
   msg $chan Hello $chan $+ , I need help!
}
+
}</source>
</source>
 
will only work for users with access level of exactly 5. Any user with higher access level will not activate that event.
 
  
 
=== ! prefix ===
 
=== ! prefix ===
Line 96: Line 77:
  
 
For example:
 
For example:
 +
 
<source lang="mIRC">
 
<source lang="mIRC">
 
on !1:join:#support:{
 
on !1:join:#support:{
Line 101: Line 83:
 
}
 
}
 
</source>
 
</source>
will never get activated by you joining #support, only other people.
+
 
 +
The event above will never get activated by you joining #support, only other people.
  
 
=== @ prefix===
 
=== @ prefix===
Line 107: Line 90:
  
 
For example:
 
For example:
 +
 
<source lang="mIRC">
 
<source lang="mIRC">
 
on @10:text:.op:#myChan:{
 
on @10:text:.op:#myChan:{
Line 112: Line 96:
 
}
 
}
 
</source>
 
</source>
will only work if you are an operator in #myChan at the time the user typed ".o".
+
 
 +
The code above will only work if you are an operator in #myChan at the time the user typed ".o".
  
 
=== & prefix ===
 
=== & prefix ===
The '''& prefix''' can be used to prevent the event from being executed if the previous event called the {{mIRC|/haltdef }} or {{mIRC|/halt}} commands (if $halted is $true).
+
The '''& prefix''' can be used to prevent the event from being executed if the previous event called the {{mIRC|/haltdef }} or {{mIRC|/halt}} commands.
  
For example, given the following two on TEXT events placed in separate files...
+
=== * prefix ===
 +
This prefix can be used to allow any user to activate the event regardless of their access level.
  
<cite>script1.mrc</cite>
+
For Example:
<source lang="mIRC">on *:TEXT:!test:?:haltdef</source>
 
  
<cite>script2.mrc</cite>
+
<source lang="mIRC">
<source lang="mIRC">on &*:TEXT:*:?:echo -ga I triggered because $!halted == $halted $+ !</source>
+
on *:text:.calc *:#:{
 +
  notice $nick $2- = $calc($replace($2-, pi, $pi))
 +
}
 +
</source>
  
The second event will trigger upon recieving any msg sent via query ''except'' '''!test''', because the first event calls the ''haltdef'' command upon receiving '''!test'''.
+
=== + prefix ===
 +
By default, the numeric prefix means that level and any level higher can trigger that event. Using the + prefix, you can limit the event to be exactly the level specified.
  
=== $ prefix ===
+
For example:
This event prefix means the matchtext of the event is a regular expression, the delimiter are required.
 
  
 
<source lang="mIRC">
 
<source lang="mIRC">
on $*:text:/^([!@.])test$/:#myChan:{
+
on +5:text:.h:#myChan:{
   msg $chan $nick triggered test with $regml(1)
+
   mode $chan +h $nick
 
}
 
}
 
</source>
 
</source>
 +
 +
The code above will only work for users with access level of exactly 5. Any user with higher access level will not activate that event.
  
 
=== Named access levels ===
 
=== Named access levels ===
Line 153: Line 143:
 
</source>
 
</source>
  
=== me prefix ===
+
[[Category:mIRC]]
The 'me' prefix can be used to get an event to trigger when you meet the criteria (only if $nick == $me). The 'me' prefix is a bit special; it requires a new colon before others prefixes.
 
 
 
For example:
 
<source lang="mIRC">
 
on me:*:join:#support:{
 
  msg $chan Hello $chan $+ , I need help!
 
}</source>
 
 
 
'''Note:''' Many events are '''not''' triggered when you meet the criteria and you need to code a separate 'me' event to handle it.
 
 
 
[[Category:mIRC|access levels]]
 

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)