Presentation is loading. Please wait.

Presentation is loading. Please wait.

MIRC Matthew Forest. Introduction mIRC itself is a program designed for text based messaging via the IRC (internet relay chat) protocol. (Link:

Similar presentations


Presentation on theme: "MIRC Matthew Forest. Introduction mIRC itself is a program designed for text based messaging via the IRC (internet relay chat) protocol. (Link:"— Presentation transcript:

1 mIRC Matthew Forest

2 Introduction mIRC itself is a program designed for text based messaging via the IRC (internet relay chat) protocol. (Link: http://www.mirc.com/ ) http://www.mirc.com/ It was designed in C++, and the scripting language that it now uses was not part of the original design, but rather came to being from suggestions from users of the program. Since mIRC’s internal language is a scripting language, it is naturally parsed at runtime rather than compiled.

3 Variables Variable names are prefixed by the percent symbol (%), are type-less, and are not case-sensitive. There are two types of variables, each with their own assignment command: Local variables are set with /var Global variables are set with /set The last set value, whether local or global, is evaluated for variables of the same name. Local variables can only be seen by the function which sets them.

4 Variables (cont.) Global variables in mIRC are stored in a separate (editable) file, from which the parser searches for the first match, and returns it. These can be declared in functions called by other functions, and will overwrite the previous value permanently. (Essentially dynamic scope) Variables have no set limit, but the parser tends to fail with strings of length greater than around 805, either for variable name or its value.

5 Functions Functions in mIRC are called “Aliases”, as they are designed to be called by a user, or by another function. By default, they have no set ‘footprint’, and merely accept all values passed to them. They have two forms: Functions preceded by a forward slash do not return values, and must be called on it’s own line. Everything following the function call on that line is passed to the function. Functions preceded by a dollar sign return a value, and must have it’s variables enclosed with parenthesis. Most of the time, these functions are designed to return an error if it does not receive the values in the order or format it expects. If defined with –l preceding the name, the function becomes visible only to other functions in the same file. (Similar to how protected classes in java are visible only to classes in the same package.)

6 Functions (cont.) For example: /test one two three four The strings “one”, “two”, “three”, and “four” are passed to test, from which it can access them through the default variables $1, $2, $3, and $4 respectively, or the entire string with $1-, which takes all arguments from $1 on. These types are more likely to have side effects, or handle user I/O. $test(one two, three four).five The strings “one two” and “three four” are passed to this function, which can return a value, which can then be passed to another function. These have a special name of “identifiers”. The postfix of.five is a special value called the “property”, and is stored in $prop.

7 Formatting Blocks are enclosed with {}s Brackets are used for evaluation rather than parenthesis, and can be nested. if and while evaluations are enclosed with parenthesis, and can be nested. White space is important: if ([statement]){  Does not work! if ([statement]) {  This however, does.

8 Structure mIRC does not contain a main function. Functions can only be called directly by the user, or via “events”, which are generated by the mIRC program (Usually due to user input at some point in time.), and in a few cases, by other functions.

9 What mIRC lacks There is no main function, so it cannot stand on its own. There are no arrays. mIRC does allow for dynamic variable naming (naming a variable by combining it with the value from another variable), but arrays are not directly supported. Regex matching is minimally supported, and only through functions built into the language. This is a rather large gap for a scripting language. There are no records, let alone objects. Variables are stored as strings only, and evaluated at runtime.

10 What I like File access in mIRC is quite streamlined, particularly for text files. To read from a file, simply call $read(“filename”, line#), and it will return the text at that line. A random line can be selected by simply omitting the line number. It’s also possible to retrieve a line from the file matching a string with wildcards or even regex with this function. It’s not really amazing, but it is rather easy and convenient sometimes. /write works much the same way, which is again, convenient and easy. As a user oriented language, basic GUI windows like error and input are supported with minimal hassle. For example: $?=“Query string” brings up a window with an edit box, and passes that value back into the calling function with no muss or fuss.

11 Thank you.


Download ppt "MIRC Matthew Forest. Introduction mIRC itself is a program designed for text based messaging via the IRC (internet relay chat) protocol. (Link:"

Similar presentations


Ads by Google