display | more...
mIRC features an extremely powerful scripting language built right into the executable itself. It has been my experience that there is very little that you cannot make (within reason) using mIRC Script. Both mIRC and it's scripting language were created and are being maintained by Khaled Mardam-Bey.

The language is primarily event driven with the format on <level>:<event type>:<commands>

For example:
on 10:TEXT:!opme:#mychannel:mode $chan +o $nick

The above line, when entered into a script file, would make the script give channel operator status to anybody with a level of 10 or above in the mIRC userlist who types !opme in #mychannel.
The commands section of an event is also where you can call your own functions, called aliases, to allow for code reuse and easier maintenance.

Strong points:
  • Support for creating your own popups just about anywhere (except the mIRC menubar, but even that has a place in which you can modify to your whim).
  • Support for creating your own functions that can optionally return data (called aliases and identifiers).
  • Tons of built in aliases and identifiers for a wide variety of purposes, all of which are well documented.
  • An internal userlist and global variable editor.
  • This language is by far the easiest to learn of any I have ever attempted.
  • It is well suited for making IRC Robots. Most mIRC scripters I know can make a basic bot in approximatly an hour.
  • Data types and function recognition are handled internally, so you don't have to worry about telling the parser the size of your string in advance, prototyping an alias you created, or converting an integer to long double.
  • Support for scripting with sockets (I have created a httpd, irc services, and a full featured bot that doesn't rely on mIRC's connection sequence).
  • Support for advanced functions such as creating GUI dialog boxes, custom windows of different types, DDE, working with binary files and hash tables to name a few.
Flaws (as of 06-24-2001):
  • The script editor is very weak in functionality and it only supports >=64k per file.
  • Error messages are oftentimes poorly explained.
  • No support for for looping and C-like structs.
  • The language is rather inefficient, which usually isn't a problem but some scripts have to make thousands of calculations per minute, and is very noticeable.
  • To the best of my knowledge, there have been no attempts to reproduce the language, and mIRC only runs on MS Windows (with the exception of WINE, which is shaky at best), so us Linux users are out of luck.
  • The syntax for many mIRC script functions is not strict at all, adding to already sloppy and unreadable results of many people's efforts. Example:
if %var > 3 { /echo -a %var is greater than 3. }
if (%var > 3) { echo -a %var is greater than 3. }
are both accepted by the mIRC Script parser (although the upper one is depreciated).

Final notes:
mIRC scripting is great for customizing a client to your needs but there are some serious shortcomings and scripts should defiantly not be used for anything business related.

Credits and more information:
This was written purely from memory but the more technical stuff was learned from the mIRC.hlp file, which comes with the mIRC program. You can get both at http://www.mirc.com/get.html

If you want an awesome mIRC Scripting tutorial, go to http://www.xcalibre.com/scripting.htm
You can also get mIRC scripting help at the message boards on the mIRC website.
Edit: I just noticed, the author of the original writeup said "for for loops" instead of "for loops". I'll leave this writeup standing though if nobody minds, since it is a pretty good description of simple mIRC looping. Actually, mIRC has support for looping, you can use goto loops and while loops.

Example:

(goto loop)
alias onetoten {
var %x = 0
:loop
inc %x
echo -a %x
if (%x < 10) goto loop
}

(while loop)
alias onetoten {
var %x = 0
while (%x < 10) {
inc %x
echo -a %x
}
}

Both are perfectly valid loops, I heard that while loops execute faster than goto loops but I'm not sure if it's true.

Log in or register to write something here or to contact authors.