m (Bot: Adding a template) |
(→^ prefix) |
||
(27 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{mirc title|Access Levels}} |
'''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 <info> parameter is an optional parameter that can be used to store some additional information about the user or other useful miscellaneous data. | + | 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. |
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 | + | === Adding 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 35: | Line 36: | ||
</source> | </source> | ||
− | + | For example: | |
<source lang="mIRC"> | <source lang="mIRC"> | ||
/ruser madman 2 | /ruser madman 2 | ||
Line 41: | Line 42: | ||
</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 47: | Line 49: | ||
</source> | </source> | ||
− | === | + | == Event prefixes == |
− | The | + | mIRC offers a lot of prefixes to slightly alter how the event activates. |
+ | |||
+ | === * 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 | + | on *:text:!time:#:{ |
− | + | notice $nick the time for me is $time | |
+ | } | ||
+ | </source> | ||
+ | |||
+ | === Numeric prefixes === | ||
+ | Numeric prefixes allow any user with an access level >= the prefix to activate the event. | ||
+ | |||
+ | For example: | ||
+ | <source lang="mIRC"> | ||
+ | on +5:text:.h:#myChan:{ | ||
+ | mode $chan +h $nick | ||
} | } | ||
</source> | </source> | ||
+ | can be executed by any user with access level 5 or greater. | ||
+ | |||
+ | === ^ prefix === | ||
+ | |||
+ | 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. | ||
− | + | 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}}. | |
− | == | + | 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}} |
− | mIRC | + | |
+ | === + 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"> | ||
+ | on +5:text:.h:#myChan:{ | ||
+ | mode $chan +h $nick | ||
+ | } | ||
+ | </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 === | ||
− | The exclamation mark prefix can be used to prevent an event from being activated by you. | + | The exclamation mark prefix can be used to prevent an event from being activated by you (if ($nick != $me)). |
For example: | For example: | ||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
on !1:join:#support:{ | on !1:join:#support:{ | ||
Line 71: | Line 101: | ||
} | } | ||
</source> | </source> | ||
− | + | will never get activated by you joining #support, only other people. | |
− | |||
=== @ prefix=== | === @ prefix=== | ||
Line 78: | Line 107: | ||
For example: | For example: | ||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
on @10:text:.op:#myChan:{ | on @10:text:.op:#myChan:{ | ||
Line 84: | Line 112: | ||
} | } | ||
</source> | </source> | ||
− | + | 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. | + | 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). |
− | + | For example, given the following two on TEXT events placed in separate files... | |
− | |||
− | + | <cite>script1.mrc</cite> | |
+ | <source lang="mIRC">on *:TEXT:!test:?:haltdef</source> | ||
− | <source lang="mIRC"> | + | <cite>script2.mrc</cite> |
− | on *: | + | <source lang="mIRC">on &*:TEXT:*:?:echo -ga I triggered because $!halted == $halted $+ !</source> |
− | |||
− | |||
− | </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 === | |
+ | This event prefix means the matchtext of the event is a regular expression, the delimiter are required. | ||
<source lang="mIRC"> | <source lang="mIRC"> | ||
− | on | + | on $*:text:/^([!@.])test$/:#myChan:{ |
− | + | msg $chan $nick triggered test with $regml(1) | |
} | } | ||
</source> | </source> | ||
− | |||
− | |||
=== Named access levels === | === Named access levels === | ||
Line 130: | Line 152: | ||
} | } | ||
</source> | </source> | ||
− | |||
− | [[Category: | + | === me prefix === |
+ | 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]] |
Latest revision as of 15:44, 5 January 2019
- On events
- Access levels
- Raw Events
- Ctcp Events
Access levels in mIRC are a mechanism by which events can be restricted to certain user levels or named groups. Almost all events have a level parameter that specifies the event's access level.
Contents
User list[edit]
The list of users and their access is stored in the "users" tab of the script editor. Only a single address is stored per line and must follow the following syntax:
<levels>:<address> <additional info>
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.
10,20:some!one@example.com friend:dan!z@some.isp.net high school friend
Adding users[edit]
There are two commands that can be used to add a user to the access list, /auser and /guser. They follow this syntax:
/auser [-a] <levels> <name|address> [info] /guser [-a] <levels> <name> [addressType] [info]
Both /auser and /guser do the same thing, they add a specific user to the user list with the access levels specified (Comma delimited). The -a switch can be used to simply add additional access levels to an existing user, otherwise all the old levels gets replaced with the new ones. The fundamental difference between /auser and /guser is that /guser can be used to look up the address of a user while /auser requires you to provide it beforehand.
;Add joe (address mask type 2), access level 'friend' /guser friend joe 2 neighbor
Removing users[edit]
The /ruser command can be used to remove a user completely from the access list or simply remove one of his levels.
/ruser [levels] <name|address> [type]
For example:
/ruser madman 2 /ruser 2,10 foobar
Changing users' info[edit]
The user info parameter can be changed at any time using the /iuser command:
/iuser <name|address> [info]
Event prefixes[edit]
mIRC offers a lot of prefixes to slightly alter how the event activates.
* prefix[edit]
The * prefix is the most commonly used prefix, and allows any user to activate the event regardless of their access level.
For example:
on *:text:!time:#:{ notice $nick the time for me is $time }
Numeric prefixes[edit]
Numeric prefixes allow any user with an access level >= the prefix to activate the event.
For example:
on +5:text:.h:#myChan:{ mode $chan +h $nick }
can be executed by any user with access level 5 or greater.
^ prefix[edit]
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.
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: on action, on ban, on chat, on dehelp, on deop, on devoice, on help, on invite, on join, on kick, on mode, on nick, on notice, on op, on open, on part, on ping, on text, on unban, on usermode, on voice, on quit, on serv, on servermode, on serverop, on snotice, on tabcomp, on topic, on wallops.
This prefix, coupled with /halt or /haltdef, allows you to display your own message for a given event, or it allows you to prevent a query window from opening with on open, or to prevent a nick completion in on tabcomp
+ prefix[edit]
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:
on +5:text:.h:#myChan:{ mode $chan +h $nick }
will only work for users with access level of exactly 5. Any user with higher access level will not activate that event.
! prefix[edit]
The exclamation mark prefix can be used to prevent an event from being activated by you (if ($nick != $me)).
For example:
on !1:join:#support:{ msg $chan Hello $nick $+ , do you need help? }
will never get activated by you joining #support, only other people.
@ prefix[edit]
The @ symbol can be used as a prefix to indicate that the event can only be activated if you are an operator in the channel. You can think of it as "if ($me isop $chan) {"
For example:
on @10:text:.op:#myChan:{ mode $chan +o-v $nick $nick }
will only work if you are an operator in #myChan at the time the user typed ".o".
& prefix[edit]
The & prefix can be used to prevent the event from being executed if the previous event called the /haltdef or /halt commands (if $halted is $true).
For example, given the following two on TEXT events placed in separate files...
script1.mrc
on *:TEXT:!test:?:haltdef
script2.mrc
on &*:TEXT:*:?:echo -ga I triggered because $!halted == $halted $+ !
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[edit]
This event prefix means the matchtext of the event is a regular expression, the delimiter are required.
on $*:text:/^([!@.])test$/:#myChan:{ msg $chan $nick triggered test with $regml(1) }
Named access levels[edit]
Sometimes it's beneficial to give an access group a name instead of a numeric value. A good example is bot admins, friends, or even channel members. You can define such groups using the normal /guser and /auser commands:
/guser BotAdmin Mike123 2 /guser BotAdmin Joe73 2 /guser BotAdmin Dave12 2
With that you can use the named group level in events, for example:
on BotAdmin:text:!example:#:{ msg $chan Hello Bot Admin! }
me prefix[edit]
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:
on me:*:join:#support:{ msg $chan Hello $chan $+ , I need help! }
Note: Many events are not triggered when you meet the criteria and you need to code a separate 'me' event to handle it.