Return To Main MIRC Menu
MIRC Identifiers sound very technical, but its just a term for some characters that identify a value. Still sounds techie? An identifier is like a magic word that will be replaced by mIRC with whatever value it refers to.
The mIRC Identifier $me means your nickname. No matter how many times you change your nick, $me is the identifier for the current one. Wherever you use $me, mIRC will replace that identifier with your nickname.
Simple and good isn't it. The mIRC Identifiers are needed so that your scripts can find the values that may change. MIRC Identifiers are no more than that. There are many identifiers, since there are many things you may need to refer to in your scripts that can change between the time of scripting and the time of use.
Pretty much everything that you can select or change has an identifier. You can refer to the first word in any string of text ($1); the folder (directory) where you installed mIRC ($mircdir); the currently selected nicks in the nicklist ($snicks); etc.
Again, a full list of mIRC's identifiers can be found in the mIRC Help files. In this tutorial I will detail only a few examples of the most practical of the identifiers to start with.
MIRC Identifiers can be used at the command line as well as in scripts, but, for mIRC to evaluate them you must prefix the command with two '//' slashes rather than the normal one. If you only use 1 slash '/' mIRC will not convert the identifier given in an editbox to its value. This only applies to command lines - identifiers and variables are always evaluated in scripts.
NOTE: One essential thing to remember about identifiers is that they almost always will only work if there is at least one space on either side. If an identifier is not seperated by spaces from other characters in scripts then mIRC will usually fail to 'see' it. ALWAYS space identifiers from anything else in your scripts or commands.
$me identifies your current nick. It becomes very useful in scripting of all kinds.
$1 $2 $3 $4- identify parameters in text etc. These are both the simplest and most confusing of all identifiers since they can refer to a vast range of values. In text strings $1 is the first word, $2 is the second, and so on. Adding the dash '-' to the end means 'onwards'. So $1- equals all words from the first. $2- means from the second word onwards.
The reason for the confusion is that many things create strings which mIRC can choose the first parameter from. In popups for instance, $1 would be the nick selected in the case of nicklist popups.
With experience (or help files) you will learn what parameters mIRC will be evaluating in any given situation. This is because you are generally going to use $1 $2 etc. in very specific circumstances. You will learn about this in the scripting tutorials. For now it is enough to know that $1 means parameter 1.
$? is a very useful and powerful identifier. $? causes mIRC to prompt the user for a value to enter. You can also put your own text on the prompt. $?="Enter your name" will cause mIRC to open a dialog box that has the text 'Enter your name', a text field for you to enter your data into, and 'OK' and 'Cancel' buttons.
The $? identifier is pointless at the command line,
but is invaluable in scripts to get user input. To see it in action however
before the scripting tutorials just type:
/ECHO [-adetsl][channel OR nick] <text>
The switches select how to display the <text> specified. If a channel/nickname isn't specified, the -s switch echoes to the status window, the -d switch echoes to the dedicated message window (if you have one), and the -a switch echoes to the currently active window.
If you specify a channel or nick, the text will be displayed
in the channel window (or query window) that matches the given name. The
-etl switches can still be used with a named window.
The e switch encloses the line in line separators. The t swich adds a timestamp (e.g. [11:23] ) to the echoed text. The l makes the echo highlighted.
$wavedir is the folder you specified in the options for your .wav sound files. $mididir is the folder you specified for .mid files.
$fulldate is the current date in the format: Tue Sep 07 23:51:23 1999 $date is the date in day/month/year format. To get the date in the American month/day/year format use $adate. The $time gives the time according to your system clock in Hours Minutes and Seconds. $day returns the current day e.g. Tuesday.
That is enough identifiers to give you the idea. You can find all of the mIRC Identifiers in the mIRC help files whenever you wish. Identifiers are not really all that 'techie' at all.
Even if you are not yet comfortable with identifiers in mIRC you will still be able to begin scripting. MIRC Identifiers will become crystal clear once you get to use them a little in your scripts.
Back / Index / Next
©1999 The Black Knight
Copyright ©2001 MIRC
|Back To Top|