Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
MIRC scripting language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Language features== {{Technical|section|date=August 2012}} 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 [[function (computer science)|function]]s 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 handler|event-handling]] scripts. Remotes are called when the event they handle occurs. *All variables are [[dynamic typing|dynamically typed]]. *[[Hash table]]s are available for larger data storage; [[array]]s are not. *mIRC scripts make use of [[sigil (computer programming)|sigils]]. Identifiers (whether custom or built-in) are preceded by <code>$</code>, binary variables are preceded by <code>&</code>, and other variables (whether local or global) are preceded by <code>%</code>. 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 <code>/</code>). ===File handling=== *Scripts can read from and write to files [<code>$read(file,[args])</code> | <code>/write</code> ] The above is intended for singular access to the file. Because each time you issue <code>$read</code> or <code>/write</code> you open and close the file for access. Multiple accesses, during a loop for instance, is best handled through <code>/fopen</code>, <code>/fwrite</code> and <code>/fclose</code>. Since this opens the file only once. In some cases <code>/filter</code> and <code>/savebuf</code> is an even more efficient (non scripted loop) method. *Scripts can also copy and delete files. [<code>/copy</code> | <code>/remove</code>] ===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 <code>&</code> (e.g. <code>&Variable</code>) *Cannot be accessed other than by <code>/bread</code> and <code>/bwrite</code>, 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 <code>%</code> (e.g. <code>%Variable</code>) *Created using the <code>set</code> command or <code>var -g</code> or <code>%Variable = value</code> 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 <code>%</code> (e.g. <code>%Variable</code>) *Created using the <code>var</code> command. <code>var</code> is merely an internal alias for <code>set -l</code> but <code>var</code> poses the means to declare multiple local variables on a single line (e.g. <code>var %a = 1, %b, %c = 2</code>)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)