Repeats a loop containing a set of commands while the expression in brackets is true. If you do not reset the error, it will propagate backwards to any calling aliases until an :error is found and will halt the script as usual. You can reset the error with /reseterror. When an error occurs, the script will jump to :error and continue running. Script errors can be caught by adding an :error goto point to your script. In scripts, all lines are assumed to start with a command, so you do not need to use the / command prefix. This is because the command prefix is really only needed when entering a command on the command line. Note: I did not prefix the above commands with the / command prefix. You can break out of a currently running script by pressing Control+Break. Using a goto incorrectly could lead to an infinite loop. The /goto command allows you to jump from one point in a script to another point. This creates an alias which tests if the parameter you supplied is the number 1 or the number 2.įor more information, see the if-then-else section. You can use if-then-else statements to decide which parts of your script executes based on the evaluation of a comparison. This allows you to create an alias which performs several commands. You can create multi-line scripts by using the brackets. You can also force a previously evaluated identifier to be re-evaluated by using extra brackets. Identifiers within these brackets will be evaluated first, from left to right. If you want greater control over the order of evaluation of identifiers, you can use the brackets. So to write an alias that kicks and bans someone: You can now deop three users by typing /dop goat dog cat.įor multiple commands you should use a | character (the shifted character usually under the \ key). To op someone you can now just type /op goat instead of the whole /mode command. So if you are on channel #blah, and you type /p then mIRC replaces the # sign with #blah, and the final command is /part #blah. The # sign refers to the channel you are currently on. To make mIRC combine parameters you can use the $+ identifier. Parameters are normally separated by a space. So if in the above example we type /laugh goat the final command would be /me laughs at goat's joke. You can also specify $2-5 which means use only parameters 2 to 5.Īnything appended to a $ parameter is appended to the final parameter. if you type /slap sheepy a large trout the final line will be /me slaps sheepy around with a large trout.
![mirc variables mirc variables](https://www.trsohbet.com/en/assets/thumb/trmirc-ekran-goruntusu2.jpg)
The $2- indicates that everything following and including parameter 2 should be appended to the command line. In the first case the parameter is necessary for the command to be executed, in the second case it is not. If parameter one does notexist, ask for it. You can also do $$?1 or $?1 which means try to fill this value with parameter one if it exists. If you specify only one parameter in the above command it will not be executed. The double $$ means that this command will only be executed if a parameter is specified. This saves you having to type the same message twice.
![mirc variables mirc variables](http://4.bp.blogspot.com/_B4JB4jIPVoc/SgwDHniDsRI/AAAAAAAAAHk/u4hcn2Ivvxg/w1200-h630-p-k-no-nu/RemoteEditor.gif)
This refers to the text you just typed into the parameter box.
![mirc variables mirc variables](https://i1008.photobucket.com/albums/af208/5th-Axis-Consulting/MDtoCDthroughMD_zps2accf41a.png)
This is similar to the line above except for the addition of the $! parameter. aw /away $?="Enter away message:" | /say $! This does the same thing but now the dialog will have the "Enter channel to join:" line displayed inside it. The # sign indicates that the parameter you specify should be prefixed with a hash indicating that it is a channel. If you enter #gb then the final command will be /join #gb. So if you type /jj a dialog will pop up asking you for the channel you want to join. The parameter you supply will be inserted in the line at that point. The question mark indicates that you should be asked to fill in this parameter. If you now type /yell There! Hello the action command will be /me Hello There! The number after $ specifies the number of the parameter in the string that you entered. The $1 refers to the first parameter in the line that you supply. If we type /j #gb this is the same as typing /join #gb. If you now type /gb this is the same as typing /join #gb.
#Mirc variables how to
The following examples show you how to create aliases that perform simple functions. An alias cannot call itself recursively mainly because this seems to cause more problems for users than it solves. To create aliases you must know some Basic IRC commands.Īliases can be called from the command line, from other aliases, and from popup and remote scripts. MIRC allows you to create aliases and scripts to speed up your IRC session or to perform repetitive functions more easily.