ArticleslgStudy

science

MIRC scripting language

MIRC scripting language is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MIRC scripting language rather than just read about it. In short: The mIRC scripting language (often unofficially abbreviated to "mSL") is the scripting language embedded in mIRC and Adiirc, IRC clients for Windows, and also through the WINE compatiblity layer for Linux. Primary uses Light channel and personal protection against many types of attacks (flooding, spamming, takeovers, etc.).

MIRC scripting language — main illustration
MIRC scripting language — illustration

Key takeaways

  • MIRC scripting language belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MIRC scripting language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MIRC scripting language from memory before moving on to harder problems.

Reference excerpt

The mIRC scripting language (often unofficially abbreviated to "mSL") is the scripting language embedded in mIRC and Adiirc, IRC clients for Windows, and also through the WINE compatiblity layer for Linux.

Primary uses Light channel and personal protection against many types of attacks (flooding, spamming, takeovers, etc.). Dialog windows can be created in mIRC to better serve user-compatibility; rather than everything in popup menus. Popular mIRC dialog extensions include MDX (mIRC Dialog Extension) and DCX (Dialog Control Extension). There are also a few versions of mdx.dll and dcx.dll modded by IRC hackers. Bots that provide automated IRC channel management, trivia or other games, and other desired functions for chatters. Commands that save typing or otherwise simplify life on IRC (such as automatically identifying as the owner of a nickname). Proxy CONNECT servers (www.mslscript.com) and Bounce servers (ZNC) to replace some mSL scripting with faster code and convenient features.

Script storage Scripts are stored as either plain text files, usually with a .mrc file extension, or as INI files. They, however, can be stored with any extension. Multiple script files can be loaded at one time, although in some cases, one script will conflict with another and cause one or both of them to no longer work properly. The order in which in the script files are loaded may make a difference if the script functions properly or not. A (un)loader-script MUST be used for semi-large scripts to function as intended.

Language features

mIRC scripting language uses its own nomenclature to refer to language constructs. (However, whilst this can be a little confusing to newcomers, they do not impact on the functionality of mSL.)

Built-in functions are termed commands or, if they return a value, identifiers. Custom scripted functions are called aliases. Aliases that return a value are known as custom identifiers. Both are called from the command line or other parts of a script in the same ways as built-in commands and identifiers (and can even supersede them). Popups are scripted context menu items. Popups are called when they are selected by the user. The term originally referred to the menus—which pop up upon a right click. It is still used this way in the manual. Remotes are event-handling scripts. Remotes are called when the event they handle occurs. All variables are dynamically typed. Hash tables are available for larger data storage; arrays are not. mIRC scripts make use of sigils. Identifiers (whether custom or built-in) are preceded by $, binary variables are preceded by &, and other variables (whether local or global) are preceded by %. Commands and aliases are not preceded by any particular character (although when entered from a window's command line they must be preceded by the command prefix, usually /).

File handling Scripts can read from and write to files [$read(file,[args]) | /write ] The above is intended for singular access to the file. Because each time you issue $read or /write you open and close the file for access. Multiple accesses, during a loop for instance, is best handled through /fopen, /fwrite and /fclose. Since this opens the file only once. In some cases /filter and /savebuf is an even more efficient (non scripted loop) method.

Scripts can also copy and delete files. [/copy | /remove]

Binary variables Contain unlimited (8192 bytes prior to mIRC 6.1) raw data Globally accessible via commands and identifiers Automatically unset when script returns control to mIRC (and not to another part of a script) Prefixed with & (e.g. &Variable) Cannot be accessed other than by /bread and /bwrite, so these variables cannot be passed onto other parts of the script

Hash tables May contain unlimited binary data or up to 4,150 (950 prior to mIRC 6.32) bytes of plain text. This limit is imposed by mIRC's scripting parser's own line length limitation (unless assigning a binary variable) Globally accessible via commands and identifiers Automatically unset when exiting mIRC as they are only stored in memory Can be saved for later use Not prefixed Faster than accessing from a file, as hash tables are stored in memory rather than the hard disk Size limited only by the computer's memory limits. Allows any bucket size to be used

Global variables May contain up to 4,150 (950 prior to mIRC 6.32) bytes of data including its name (however due to line-length limitations in mIRC's scripting parser, a maximum of 4,146 bytes can be assigned explicitly using /set or /var — this number decreasing as the variable's name grows longer) Cannot store NUL (ASCII 0) or trailing spaces Globally accessible Do not automatically unset unless a switch is used (stored automatically in a mIRC initialization file) Prefixed with % (e.g. %Variable) Created using the set command or var -g or %Variable = value notation

Local variables May contain up to 4,150 (950 prior to mIRC 6.32) bytes of data including the variable name (however due to line-length limitations in mIRC's scripting parser, a maximum of 4,146 bytes can be assigned explicitly using the /set or /var commands — this number decreasing as the variable's name grows longer) Can store NUL (ASCII 0) or trailing spaces Are destroyed when the triggered alias or event ends Prefixed with % (e.g. %Variable) Created using the var command. var is merely an internal alias for set -l but var poses the means to declare multiple local variables on a single line (e.g. var %a = 1, %b, %c = 2)

Limitations Scripting parser supports a maximum of 8,292 (950 prior to mIRC 6.32) characters per line (not including newlines or indentation). Strings are not syntactically enclosed, creating ambiguities in code where characters meant as literal strings are treated as part of the language's syntax. Each line of code is broken down into a set of space-delimited tokens. As mIRC's parser does not support null tokens and the language doesn't provide a syntax to clearly differentiate literal strings from code; Prior to mIRC version 6.2 it was impossible to pass multiple consecutive spaces to any command or alias. However, this was fixed with the introduction of the returnex command which allows the preservation of spaces.

Code examples The code below is in the remote scripts format. If placed into an alias file, the command names should not be preceded by the word "alias". Test Comments include the common /* comment */ and ;comment. Here is an example of a Hello World alias:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with MIRC scripting language

Start with the simplest possible case. Write down what MIRC scripting language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MIRC scripting language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MIRC scripting language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MIRC scripting language

In research
MIRC scripting language appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MIRC scripting language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MIRC scripting language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Scripting languages, so understanding it makes those chapters shorter.
In everyday life
Look for MIRC scripting language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MIRC scripting language” →

How to study MIRC scripting language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MIRC scripting language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MIRC scripting language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MIRC scripting language in simple terms?

The mIRC scripting language (often unofficially abbreviated to "mSL") is the scripting language embedded in mIRC and Adiirc, IRC clients for Windows, and also through the WINE compatiblity layer for Linux. Primary uses Light channel and personal protection against many types of attacks (flooding, s…

Why does MIRC scripting language matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MIRC scripting language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MIRC scripting language.

Tags

  • Scripting languages

Keep exploring