mIRC Scripting Language
The event-driven scripting language embedded in the mIRC client that powered a generation of IRC bots, channel-protection scripts, and custom chat tools on Windows.
Also known as: mSL
Created by Khaled Mardam-Bey
The mIRC scripting language — commonly abbreviated mSL — is the scripting language embedded inside mIRC, the long-running Internet Relay Chat (IRC) client for Microsoft Windows created by Khaled Mardam-Bey. mSL is a full event-driven, procedural programming language that lets users redefine commands, respond to chat events, build graphical dialogs, manipulate files, and automate nearly every aspect of the client. For a generation of internet users in the late 1990s and 2000s, mSL was the first programming language they ever wrote, learned in a chat window while building a bot to guard a favorite channel.
History & Origins
mIRC was created by Khaled Mardam-Bey, a British programmer, who began development in 1994 and released the first version, mIRC 1.0, on February 28, 1995. He has said he built it because the first IRC clients for Windows lacked some basic IRC features he wanted. The client quickly became one of the most popular ways to access IRC on Windows.
The scripting language grew organically alongside the client. In the earliest versions, only commands directly related to IRC were available, and capabilities were added on an ad-hoc basis as users demanded more customization. Through the mIRC 3.x and 4.x releases around 1997, mSL matured into the form recognizable today, acquiring aliases, remote event handlers, custom identifiers, and variables. This incremental, demand-driven evolution gave mSL both its flexibility and its quirks.
By the early 2000s, mIRC had been downloaded tens of millions of times — reportedly over 40 million by 2003, when it ranked among the top ten most popular internet applications. A vast ecosystem of user-written scripts, add-ons, and “war scripts” grew up around it, traded on websites and within IRC channels themselves.
Design Philosophy
mSL reflects the pragmatism of a language that evolved to serve a single application’s users rather than a formal specification. A few principles define its character:
Scripting Is the Application
In mIRC, scripting is woven into the client. Users can type mSL directly into the message box, save reusable commands as aliases, and register remote scripts that fire automatically when IRC events occur. The line between “using mIRC” and “programming mIRC” is deliberately blurry, which is a large part of why so many casual users ended up writing real code.
Code and Text Are the Same Thing
One of mSL’s most distinctive — and most divisive — design decisions is that it makes no syntactic distinction between code and plain text. Strings are not enclosed in quotes. Code is frequently embedded directly among ordinary text and evaluated in place. This makes simple scripts extremely concise, but it also creates parsing ambiguities that scripters must learn to navigate, and it is the root of an entire class of injection vulnerabilities.
Sigils Everywhere
mSL uses leading sigils to distinguish its constructs, a convention loosely reminiscent of shell and Perl scripting:
$precedes identifiers — both built-in functions like$me,$nick, and$time, and custom ones defined as aliases.%precedes ordinary variables, whether local or global.&precedes binary variables, used for handling raw byte data.
C-Flavored Structure
While its evaluation model is unusual, mSL inherits much of its block structure from the C programming language, using curly braces { } to group statements within aliases, events, and control-flow constructs like if, while, and goto.
Key Features
Aliases
Aliases are mSL’s equivalent of functions. They define new commands that can take parameters, return values, and even override built-in commands and identifiers. A trivial alias might look like:
alias greet {
msg $active Hello, $1 $+ ! Welcome to the channel.
}
Typing /greet Alice in a channel would send a greeting. Here $active is the active window, $1 is the first parameter, and $+ concatenates without a space.
Remotes and Events
Remote scripts are event handlers — they run automatically when a matching IRC event occurs. Events are declared with the on keyword:
on *:JOIN:#:{
msg $chan Welcome to $chan $+ , $nick $+ !
}
on *:TEXT:!time:#:{
msg $chan The current time is $time
}
The first handler greets anyone who joins a channel; the second responds to anyone who types !time. This event-driven model suits bots and channel automation.
Popups
Popups define entries in mIRC’s right-click context menus. Selecting a popup entry runs its associated mSL code, letting scripters add custom menu commands to nickname lists, channels, and the main window.
Dialogs and Custom GUIs
mSL includes a dialog system for building graphical windows with buttons, edit boxes, lists, and other controls. The community extended this further with native DLL libraries such as DCX and MDX, enabling sophisticated, modern-looking interfaces — control panels, games, and media tools — built entirely as mIRC scripts.
File and Data Handling
mSL provides extensive file system access — reading, writing, renaming, and deleting files — along with hash tables, INI-file manipulation, and binary variables for raw data. Combined with its code-is-text evaluation, this access also created real security risks.
Identifiers
Identifiers are built-in functions accessed with the $ sigil. mIRC ships with hundreds of them — $nick, $chan, $me, $server, $rand(1,100), $read(file.txt) — covering IRC state, math, string manipulation, files, and system information. Custom aliases can act as user-defined identifiers, returning values with the return command.
Variables and Hash Tables
Variables need no declaration. Local variables are created with /var and discarded when the current alias or event returns, while global variables are created with /set and persist until explicitly removed. Values are strings, and a number is simply a string that happens to look numeric. mSL has no array type, so the idiomatic structured-data store is the in-memory hash table. Binary variables can grow to large sizes in modern versions, although early builds capped them at 8,192 bytes.
Sockets and COM
The /sockopen and /sockwrite commands let scripts speak arbitrary text protocols, such as HTTP or custom bot links, well beyond IRC. The $com identifier exposes Windows Component Object Model objects to scripts, which lets mSL drive other Windows software.
Security and the $decode Exploit
mSL’s power over the file system and its lack of a code/text boundary made it a perennial security concern. The most infamous incident was the $decode exploit, which gained widespread notoriety around August 2001. Attackers would trick users into pasting an innocuous-looking encoded string into mIRC; when decoded and evaluated, it executed arbitrary mSL commands and could effectively hand control of the victim’s client — and files — to the attacker.
In response, later releases (notably version 6.17, released February 17, 2006) disabled the dangerous $decode/$encode evaluation behavior by default and added other safeguards. The episode remains a textbook example of the dangers of a scripting language that does not cleanly separate executable code from displayed text, a class of problem mSL scripters still guard against today through careful input handling.
Evolution
mSL has grown continuously alongside the mIRC client for three decades:
| Era | Approx. Year | Significance |
|---|---|---|
| mIRC 1.0 | 1995 | First release; rudimentary IRC-only scripting |
| mIRC 3.x–4.x | ~1997 | mSL matures into modern form: aliases, remotes, identifiers |
| mIRC 5.91 | late 1990s | Last version to support 16-bit Windows |
| mIRC 6.x | 2002+ | Drops 16-bit support; security hardening of the parser |
| mIRC 7.1 | 2010 | Adds Unicode and IPv6 support |
| mIRC 7.83 | 2025 | Latest maintenance release; mSL still actively developed |
Notable later additions included Unicode text handling (from version 7.1 in 2010), expanded binary variable limits and string lengths in the 6.x series, regular expression support via $regex, JSON handling in recent 7.x releases, and ongoing parser improvements. The scripting parser historically supported a maximum line length of around 8,292 characters, one of several limits scripters learned to work within.
Several releases stand out as inflection points. mIRC v5.3 added sockets in 1997, and v5.5 added the /dialog command and dialog table definitions in 1999, which made elaborate script packs possible. mIRC 6.35 was the last release to run on Windows 95/98/ME and NT 4.0, and version 7 requires Windows XP or later.
Current Relevance
IRC is no longer the dominant chat medium it was in the late 1990s and early 2000s, having ceded ground to Discord, Slack, and other platforms. Yet mIRC and its scripting language remain actively maintained: version 7.83 was released on November 12, 2025, more than thirty years after the original. The client continues to receive new identifiers, security fixes, and modern protocol support.
mSL’s reach also extends beyond mIRC itself. AdiIRC, another Windows IRC client, implements substantial compatibility with the mIRC scripting language, allowing many mSL scripts to run outside of mIRC. A dedicated community continues to document the language through resources such as the WikiChip mIRC reference and the mIRC Scripting Knowledge Base.
“mSL” is an informal abbreviation: the language has no official name of its own and no version number independent of the client that hosts it. It runs only on Windows or under Wine. mIRC’s built-in script editor and famously detailed help file made the on-ramp gentle, and on networks such as DALnet, EFnet and Undernet, mSL scripts ran file servers and DCC/XDCC distribution bots that queued and sent files to requesters.
Why It Matters
The mIRC scripting language occupies a special place in programming history not because of technical elegance — it has plenty of rough edges — but because of who it taught. For countless people, mSL was a first encounter with variables, conditionals, loops, event handling, and the thrill of making a computer do something on its own. The feedback loop was immediate and social: write a few lines, and a bot in your channel would greet your friends or win a trivia game.
mSL is also a case study in organic language design: it accreted features one user request at a time, embedded inside a single application. That history produced both its expressive convenience and its notorious security pitfalls — most memorably the $decode exploit. The mIRC scripting language shows how a chat client accidentally became a programming environment for a generation of internet users, and it is still in use.
Timeline
Notable Uses & Legacy
IRC Bots and Channel Management
mSL is widely used to write IRC bots that manage channels — greeting users, enforcing rules, kicking and banning troublemakers, maintaining op lists, and responding to commands. Many small channels ran entirely on a mIRC bot rather than a dedicated server-side bot.
Channel Protection and Anti-Flood Scripts
Operators built protection scripts in mSL to defend channels against floods, clones, and takeover attempts, automatically detecting abusive patterns and reacting with bans or mode changes in real time.
Custom Dialogs and GUI Tools
Using mSL's dialog support, often extended with libraries such as DCX and MDX, scripters created rich graphical add-ons — control panels, games, media players, and themed interfaces — layered on top of the mIRC client.
DCC File Sharing and Fserve Scripts
mSL powered file-serving scripts (fserves) and XDCC bots built on mIRC's DCC protocol support, which became a major file-distribution mechanism in IRC communities during the late 1990s and 2000s.
Trivia, Games, and Channel Entertainment
Community scripters built trivia bots, dice and card games, and interactive channel entertainment entirely in mSL, taking advantage of its tight integration with chat events and text output.
Script Packs and Client Themes
Full 'script packs' bundled aliases, popups, custom dialogs and toolbars to completely reskin and re-feature mIRC, distributed as downloadable .mrc files that users loaded into their client.
Language Influence
Influenced By
Influenced
Running Today
Related Languages
Sources & Further Reading
- mIRC (official site) Official
- mIRC Help: Scripts Documentation
- mIRC version history (versions.txt) History
- Khaled Mardam-Bey, mIRC developer History
- mIRC Discussion Forums Community
- mIRC scripting language (Wikipedia) Reference
- mIRC (Wikipedia) Reference
- mIRC 7.83 release (TG007) Reference