From WikiChip
Editing mirc/aliases
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 27: | Line 27: | ||
<pre>Hello World!</pre> | <pre>Hello World!</pre> | ||
− | + | == Alias arguments == | |
Data can be passed to aliases via the argument list. The argument list is always evaluated from left to right. The arguments are passed to the alias via the $N identifiers, where N is a numeric value from starting at one. | Data can be passed to aliases via the argument list. The argument list is always evaluated from left to right. The arguments are passed to the alias via the $N identifiers, where N is a numeric value from starting at one. | ||
Line 41: | Line 41: | ||
The exact rules on how $N work is identical to the how they work with the [[Token Manipulation - mIRC#Tokenizing_a_string|/tokenize command]]. More information about $1- {{mIRC|$1-|here}} | The exact rules on how $N work is identical to the how they work with the [[Token Manipulation - mIRC#Tokenizing_a_string|/tokenize command]]. More information about $1- {{mIRC|$1-|here}} | ||
− | + | == Aliases Tab == | |
The aliases tab is designed specifically for aliases only. Note that because it can only be used for aliases, the "alias" prefix must be left out: | The aliases tab is designed specifically for aliases only. Note that because it can only be used for aliases, the "alias" prefix must be left out: | ||
Line 51: | Line 51: | ||
'''Note:''' Aliases from the aliases tab can freely call aliases from the remote tab and vice versa. | '''Note:''' Aliases from the aliases tab can freely call aliases from the remote tab and vice versa. | ||
− | |||
− | + | == Aliases Prefixes == | |
− | == | + | == Command Prefixes == |
− | + | = . prefix (silencing) = | |
− | |||
− | |||
You can prefix your command call by a dot '.' to prevent mIRC from displaying its typical message, such as {{mIRC|/timer|.timer}}. | You can prefix your command call by a dot '.' to prevent mIRC from displaying its typical message, such as {{mIRC|/timer|.timer}}. | ||
− | + | = ! prefix (built-in call) = | |
− | |||
− | |||
By default, a command call will call any custom alias you may have defined, you can force a call to a mIRC built-in command by using the '!' prefix, /!join makes sure it calls the mIRC built-in join command instead of the custom join alias you may have defined. | By default, a command call will call any custom alias you may have defined, you can force a call to a mIRC built-in command by using the '!' prefix, /!join makes sure it calls the mIRC built-in join command instead of the custom join alias you may have defined. | ||
− | + | == Identifier Prefixes == | |
− | |||
− | |||
− | |||
− | |||
− | + | = / and . prefix (custom call) = | |
By default, an identifier call will call the built-in mIRC identifier, you can force a call to your own custom identifier by using the '/' or '.' prefix, $/me makes sure it calls your custom identifier. If you do not have the alias defined, mIRC consider it a call to an alias named with the '/' or the '.' | By default, an identifier call will call the built-in mIRC identifier, you can force a call to your own custom identifier by using the '/' or '.' prefix, $/me makes sure it calls your custom identifier. If you do not have the alias defined, mIRC consider it a call to an alias named with the '/' or the '.' | ||
− | + | = ~ prefix (built-in call) = | |
− | + | You can force a call to an identifier to return $null if it's not a built-in identifier by using the '~' prefix, $~sup will always return $null. | |
− | |||
− | == | + | == Commands vs. Identifiers == |
− | + | in mSL, aliases can serve as both '''identifiers''' and '''commands'''. These two terms are used to describe the type of alias it is. In general, a '''command''' will usually not return anything but simply process some type of data. An '''Identifier''' on the other hand will generally return some kind of a value. | |
− | === | + | === Commands === |
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | ||
A command usually does not return any value, but instead, it processes the arguments it's given. In a command, every argument is separated by a space. $0 will contain the total number of arguments passed to that alias. $N (where N is a number 1 to $0) will contain the arguments. For example: | A command usually does not return any value, but instead, it processes the arguments it's given. In a command, every argument is separated by a space. $0 will contain the total number of arguments passed to that alias. $N (where N is a number 1 to $0) will contain the arguments. For example: | ||
Line 118: | Line 102: | ||
Arg3 = C</pre> | Arg3 = C</pre> | ||
− | == Identifiers == | + | === Identifiers === |
Generally, an identifier is a value-returning alias. This means we pass some arguments to that alias and we expect it to return something in return. Identifiers are prefixed with the dollar symbol ($). An identifier may or may not need arguments to be passed to it. If the identifier requires that some arguments be passed to it, the arguments must be in a parenthesis, comma delimited. | Generally, an identifier is a value-returning alias. This means we pass some arguments to that alias and we expect it to return something in return. Identifiers are prefixed with the dollar symbol ($). An identifier may or may not need arguments to be passed to it. If the identifier requires that some arguments be passed to it, the arguments must be in a parenthesis, comma delimited. | ||
Line 140: | Line 124: | ||
<pre>hello there!</pre> | <pre>hello there!</pre> | ||
− | + | === Identifiers Properties === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Identifiers Properties == | ||
Properties are a unique feature to identifiers with arguments. They allow you to pass one more additional remark to the alias. That remark can be retrieved from within the alias using the '''$prop''' identifier. Properties are usually a way to manipulate the arguments we pass to the alias. | Properties are a unique feature to identifiers with arguments. They allow you to pass one more additional remark to the alias. That remark can be retrieved from within the alias using the '''$prop''' identifier. Properties are usually a way to manipulate the arguments we pass to the alias. | ||
Line 217: | Line 187: | ||
<pre>/logfind *kicked* | <pre>/logfind *kicked* | ||
* Logfind Match: [12:33] * Foo was kicked by *.example.com (Flooding (Limit is 12 lines per 10 seconds))</pre> | * Logfind Match: [12:33] * Foo was kicked by *.example.com (Flooding (Limit is 12 lines per 10 seconds))</pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Additional alias features: == | == Additional alias features: == | ||
Line 310: | Line 226: | ||
<h3 id="shortcuts">Shortcuts and Function Keys</h3> | <h3 id="shortcuts">Shortcuts and Function Keys</h3> | ||
− | Aliases can be used to redefine function keys and shortcuts by simply renaming them the actual key or key combinations. For the F-keys all you need is to name the actual alias F1 through F12. C | + | Aliases can be used to redefine function keys and shortcuts by simply renaming them the actual key or key combinations. For the F-keys all you need is to name the actual alias F1 through F12. C and S can be used for the Shift and Ctrl Key. For example SF1 is Shift+F1 keys. |
For Example: | For Example: | ||
− | < | + | <syntaxhighlight lang="mIRC">alias SF1 { |
echo -a Shift+F1 was pressed! | echo -a Shift+F1 was pressed! | ||
− | } | + | }</syntaxhighlight> |
− | |||
− | |||
− | |||
− | |||
− | </ | ||
== Local Aliases == | == Local Aliases == | ||
Line 342: | Line 253: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
− | If some code local to that script file calls example, the local alias will execute. If some other code outside of this script file calls it the second alias will execute instead | + | If some code local to that script file calls example, the local alias will execute. If some other code outside of this script file calls it the second alias will execute instead. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[Category:mIRC|aliases]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |