Accepting Files on IRC and the Internet in General
Sharing files on IRC is part of what makes IRC fun, however it's important to be careful about who you accept files from and which types of files you accept.
Although most files are safe, there are always a few that may be infected with a virus, or may be malicious programs that try to damage your computer. Since it's impossible to know in advance whether a file that is being sent to you might cause a problem, following a few common sense rules can help:
Only accept files from people that you know and trust. You should never accept files from people you don't know, and never accept files without knowing what their purpose is, even from someone you know.
Files ending in .BAT, .COM, .EXE, .DLL have the most potential to cause problems. You should not accept such files from people you don't know, or download them from web/ftp sites which don't appear trustworthy.
Aliases, Popups, or Scripts that can be loaded or typed into your IRC client can also cause problems. mIRC, and most other IRC clients, allow you to create scripts that perform useful functions, but these can also cause problems if misused. You should make sure that you know and trust the source of these files before using them.
Certain types of Document files can contain macros which are run by your Word Processor when you open the document to view it, so these are also potentially harmful. You should make sure that you have macro-warnings turned on in your Word Processer. It is also safer to view any documents that you receive in a plain-text editor first if possible.
If you have an anti-virus program, you should use it to scan all files that you download before you use them. However, IRC is a highly interactive medium where information spreads very quickly, so using an anti-virus program does not guarantee that a file will be safe since it takes time for anti-virus programs to be updated.
Access Levels
Access levels are assigned both to a user and to an event and serve to limit a user's access to only certain events.
The default access level is 1 for users that are not listed in the Users list. All users can access level 1 events. The higher a user's access level is, the more events that user can access. You can change the default user level to allow unlisted users to access more commands.
Users
In the Users section you can specify a list of users and their access levels using the format:
<level1,level2,...,levelN>:<useraddress>
3,5,6:goat!khaled@mirc.com
The first level is a general access level, which means that the user can access all levels equal to or less than 3. All the other levels are levels that an event must specifically have to allow a user to access it.
If you want to force the first access level to be a specific level instead of a general access level, you can prefix it with an equal sign.
=3,5,6:goat!khaled@mirc.com
Now this user has access specifically to level 3, 5, and 6 event and to no other events.
Events
In general the format of an event is:
<prefix> <level>:<event>:<window>:<commands>
ctcp 1:HELP:*:/msg $nick No help is available for level 1 users
The above ctcp command can be accessed by all users because it is a level 1 command. So if a user with nickname goat sends you a /ctcp yournick HELP, your script will send them the above reply.
Only the highest level matching event is triggered for a user.
Named Levels
You can also used named levels which work the same way as a specific level but are easier to understand and read than a number.
friend:goat!khaled@mirc.com
on @friend:JOIN:#mIRC:/mode $chan +o $nick
This treats the word friend as a specific access level and matches the user with the event, and because the user is your friend, you give him ops.
Limiting Access
You can limit access to an event by specifying a special prefix which determines how an event is processed or triggered by users.
The + prefix
You can limit an event to users with a specific access level by using the + prefix.
10:goat!khaled@mirc.com
ctcp +5:HELP:*:/msg $nick You have accessed a level +5 event
The above user can't access this ctcp event even though he has an access level higher than 5 because the event is limited only to level 5 users.
The * prefix
You can allow any user to trigger an event regardless of their access level by using the * prefix.
on *:TEXT:help:#:/msg $nick you have accesed a * level event
The ! prefix
You can prevent an event from being triggered if it was initiated by you by using the ! prefix.
ctcp !2:HELP:*:/msg $nick You have accessed a level 2 event
You would be unable to access the above event regardless of your access level.
The @ prefix
You can limit events to being executed only when you have Ops on a channel by using the @ prefix.
10:goat!khaled@mirc.com
on @2:JOIN:#mIRC:/mode $chan +o $nick
When the above user joins channel #mIRC and you have Ops on #mIRC, the associated /mode command will be executed, in this case giving the user Ops. If you don't have Ops, the event will not trigger.
The & prefix
You can prevent an event from being triggered if a previous script used /halt or /haltdef to halt the display of default text for an event by using the & prefix.
on &1:TEXT:*:?:/echo this event won't trigger if $halted is true
The $ prefix
Indicates that the matchtext section of a definition contains a regular expression.
on $*:TEXT:m/regular expression/switches:#:/echo message: $1-
The 'm' and switches are optional. The // are required. If switches are used they must be standard PCRE switches, otherwise the match will fail. You can use switch 'S' to strip control codes from $1-.
The = suffix
You can prevent users with higher access levels from accessing all lower access level events by using the = suffix.
10:goat!khaled@mirc.com
ctcp 2:HELP:*:/msg $nick You have accessed a level 2 event
ctcp 5:HELP:*:=
The above user can't access any of these events because the level 5 event prevents him from accessing all HELP events with access levels lower than 5.
The ! suffix
You can prevent commands for a certain event level from being processed by using the ! suffix.
ctcp 5:PING:*:echo PING!
ctcp 5:*:*:!
The ! at the end of the line tells the remote to halt any further processing of level 5 commands.
Creating Groups
You can create separate groups in scripts by using the # hash prefix.
#group1 on
...
[ list of events ]
...
#group1 end
You can use the /enable and /disable commands to enable or disable groups. A group that is disabled will be ignored when processing events. A disabled group looks like this:
#group1 off
...
[ list of events ]
...
#group1 end
You cannot have groups within groups.
Order of definitions
Many of the prefixes and controls are sensitive to numerical order of the definitions. The safest thing is to order your definitions starting with the lowest access levels first and increasing numerically down the list, this makes it easier to keep track of which events should trigger first.
Acknowledgements
After so many years of working on mIRC, it's hard to remember all of the people who have been involved with some aspect or other of its development; some I haven't heard from in a very long time, while others I still talk to today. They've all contributed in some way, whether through bug reports, suggestions, answering questions, beta-testing, helping out on IRC channels, or creating helpful scripts, documentation, and web pages.
I receive emails every day from people from all over the world, emails which are often very touching and heartfelt, and I know that their kind words are as much a tribute to all of you who have helped to bring so many people together.
Thanks to...
Tjerk Vonck who created the first #mIRC channel, the mIRC homepage, and mIRC FAQ, and has contributed to mIRC in too many ways to mention.
The mIRC Beta-testers, past and present, for their hard work in catching bugs and suggesting features.
The Helpers on IRC channels who help out new users day after day, and create helpful webpages, documentation, and scripts.
Jarkko Oikarinen, creator of IRC, and all of the ircd coders after him who have worked hard to improve IRC for all of us.
Nicolas Pioch for his short IRC primer, Ramji, Bibbly, Stimps, Mike, James G., Edward, Bunster for the queen-size futons, Peeg for the *bonk*s over the head, and Viv :)
Kevin Day, for coding and contributing various routines.
Andrzej Kowalik, for contributing his work on the toolbar icons.
M.Hunnibell, M.Overtoom, Mark "Too Slick" Hanson, Ron R., and Dan Lawrence for their technical help.
Richard "Budman" Jones, who designed and contributed the
logo.
Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England.
JPEG support is based on the work of the Independent JPEG Group.
PNG support is based on the work of a variety of Authors and Group 42, Inc.
Zlib support is based on the work of Jean-loup Gailly and Mark Adler.
Address Book
The Address Book can be used to store various types of information about users. It can be accessed via the Tools menu, the toolbar, or by pressing Alt+B, or by using the /abook [nickname] command.
Address
The Address section allows you to store basic information about users on IRC.
Nickname
Nickname on IRC. Information in the Address Book is stored according to nickname.
Real Name
Real name.
Email address. If you click on the Email button, mIRC will start up your email software.
Website
Website address. If you click on the View button, mIRC will start up your web browser.
IP Address
IP Address. If you click the Chat button, mIRC will initiate a DCC Chat directly to this user's DCC Server instead of using the IRC Server.
Note: A user may not always have the same IP Address.
Notes
Notes. You can enter various notes about a user.
Picture
If a user sends you their picture, you can associate it with their nickname in the address book.
Info
The Info section displays the result of the /uwho command which looks up information for a user on IRC. The format of the /uwho command is:
/uwho [nick] [nick]
This performs a /whois on the specified nickname to look up their server information and then displays it in the info section of the address book. Because of the way IRC Servers work, you may need to specify the nickname a second time in order to look up information such as idle time or the away message, however this information usually takes longer to retrieve.
Note: The address shown in the Info dialog may not be an email address, it is mainly an indication of the user's internet provider.
Notify
The Notify list is a like a buddy list, it notifies you whenever a nickname is on IRC.
Control
The Control section performs functions related to channel and user control.
Nick
The Nick colors section allows you to assign colors to nicknames.
Agents
mIRC supports Microsoft Agent if you have it installed on your system. An agent is an animated character that can speak text and perform actions.
Note: The agent dialog will only be visible if agent is already installed on your system. If it isn't installed, you can find links to related websites and resources, as well as download information, on the mIRC website.
The agent section in the options dialog allows you to change the way agent behaves and to specify the events that you want agent to speak.
Agent Settings
This main section of the agent dialog allows you to select your default agent character, the size of the character, and various display options.
The auto-hide feature hides the agent whenever mIRC is minimized, though note that if agent needs to speak it will become visible again.
Agent Events
You can enable agent for channel, private, and other events, and more precisely specify which events you want spoken in the the Agent Events dialog.
Lexicon
The lexicon allows you to replace words or characters in spoken text with other words or characters, eg. you could replace :) with smiley face.
Speech Options
The speech settings allowing you to change the speed, pitch, and volume of spoken text.
The lowercase options change nicknames, channels, or the whole line of text into lowercase. This is useful since agent speaks uppercase characters as individual letters.
The ignore message feature stops agent speaking a line of text if the line contains a certain percentage of non-alphanumeric characters, ie. letters and numbers, which can happen when users play ascii text pictures.
The only speak if channel name has changed option stops mIRC from speaking the channel name for every message.
Agents
mIRC supports Microsoft Agent either through scripting or through the Agents section in the options dialog. An agent is an animated character that can speak text and perform actions.
You can find links to related websites and resources, as well as download information, on the mIRC website.
Agent commands
The following commands allow you to manipulate agents, to make them speak, play animations, and more.
/gload <-h> <name> <filename | N | default>
You must use /gload to load an agent before you can use it.
The name you give an agent is the name you will use to refer to it in all of the other commands and identifiers.
You can load an agent either by specifying its filename, if you know it, or by loading the Nth installed agent on your system, or by specifying default, which will load the default agent for your system.
If you specify the -h switch, mIRC will hide the agent whenever mIRC is minimized. You can also use the -h switch with the other agent commands to prevent them from popping the agent when mIRC is minimized and has the -h setting.
Note: You can't load more than one of the same agent. You can however load as many different agents as you want.
/gunload <name>
This unloads the specified agent. The name is the name you gave your agent when you loaded it with /gload, not the filename of the agent.
/gshow <name> [x y]
This shows an agent in its most recent or default position, or at the specified x y position.
/ghide <name>
This hides an agent.
/gmove <name> <x> <y> [speed]
This moves an agent to the <x> and <y> position on your screen. If a speed isn't specified, it uses a default speed. If you specify a speed of 0, it moves instantly to the new position.
/gsize <name> <w> <h>
This resizes an agent to the specified width and height.
/gtalk -kwlu <name> <text | <wavefile | text>>
This makes an agent speak the specified text.
If you want the agent to think the text in a balloon without speaking it, you can use the -k switch.
If you want the agent to play a wave sound file, you can use the -w switch, and specify a wave filename. You should also specify text after the filename, the agent will show it in a ballon while playing the wave sound.
The -l switch applies the lexicon settings in the lexicon dialog to the text.
The -u switch applies the speech settings in the speech options dialog.
/gplay <name> <anim | N> [timeout]
This makes an agent play one of its animations.
You can either specify the name anim of an animation, if you know it, or ask it to play the Nth animation.
Some animations are looping animations, which repeat continuously, and prevent an agent from doing anything else until you /gstop the agent. The [timeout] value allows you to specify a timeout for an animation after which it is automatically stopped, and the agent will then perform any remaining queued requests. If you don't specify a timeout value, the default is 5 seconds. If no play or talk requests are pending, the looping animation continues beyond the timeout until there are.
/gpoint <name> <x y>
This makes an agent point towards the specified <x> <y> screen position.
/gstop -c <name> [talk play]
This stops an agent from doing what it's currently doing, and removes all queued requests for the agent.
If you wish to only stop the current action, you can use the -c switch.
If you wish to stop only talk or only play requests, you can specify talk or play.
/gopts -bieqnh <name> <on off size pace hide nosize nopace nohide langid>
This sets various options relating to how the agent behaves.
The -b switch turns balloons on or off. You can also make ballons size to fit the text being spoken, pace to display text word by word as it is being spoken, and hide to hide the balloons when no text is being spoken.
The -i switch turns idle effects on or off.
The -e switch turns sound effects on or off.
The -n switch allows you to set a language id, where langid is the hex id value.
The -h switch turns the auto-hide feature on or off (see /gload for more info).
/gqreq <on | off>
By default mIRC queues all requests and plays them one after the other to ensure that even if you use multiple agents at the same time, all messages will be heard, and all agents will act in the order that you requested. You can turn queuing on/off on the fly.
Agent Identifiers
The following identifiers allow you to access information about an agent that is currently loaded.
$agentver
Returns the version of the Agent installed on your system, 0 if not installed.
$agentstat
Returns 1 if Agent is ready, or 0 if busy/speaking.
$agentname
Returns the name of the agent in an on AGENT event.
$agent(N).char
Returns the filename of the Nth available agent installed on your system.
If you specify 0, returns total number of installed agents.
$agent(name)
Returns information about a currently loaded agent.
Properties: name, fname, visible, x, y, w, h, ow, oh, speed, pitch, idle, effects, active, langid, balloon, hide
name the name you gave to this agent
fname the filename of the agent or default
visible returns $true or $false
x,y,w,h left/top position, width/height.
ow, oh original width/height
speed speaking speed
pitch speaking pitch
idle if idle behaviour is on or off
effects if sound effects are on or off
active if this agent is active/topmost
langid language id of system
balloon current setting: on off size pace hide
hide returns auto-hide setting
$agent(name,N)
Returns information on animations and queued lines for an agent.
Properties: anim, line
anim returns the names of the animations available for this agent.
If you specify N, returns the name of the Nth animation.
If you specify 0, returns the total number of animations.
line returns the list of lines currently queued for talking for this character.
If you specify N, returns the Nth line.
If you specify 0, returns total number queued lines.
Tags in spoken text
You can use tags in <text> in /gtalk which may be recognized by the text-to-speech engine, these are a few:
\spd=n\ set speed of spoken text
\pit=n\ set pitch of spoken text
\vol=n\ set volume of spoken text
\chr="text"\ where text is normal, monotone, or whisper
\ctx="text"\ where text is address, email, unknown
\emp\ emphasize next word
\pau=n\ pause speech nnn milliseconds
\rst\ reset settings to default
$notags(text)
Removes the above tags from text. Only tags that are valid and correctly written as above are removed.
Aliases
mIRC allows you to create aliases and scripts to speed up your IRC session or to perform repetitive functions more easily. To create aliases you must know some IRC commands.
Aliases can be called from the command line, from other aliases, and from popup and remote scripts. An alias cannot call itself recursively mainly because this seems to cause more problems for users than it solves.
Examples
The following examples show you how to create aliases that perform simple functions.
/gb /join #gb
If you now type /gb this is the same as typing /join #gb.
/j /join $1
We have now added a parameter string. If we type /j #gb this is the same as typing /join #gb. The $1 refers to the first parameter in the line that you supply.
/yell /me $2 $1
If you now type /yell There! Hello the action command will be /me Hello There! The number after $ specifies the number of the parameter in the string that you entered.
/jj /join $?
The question mark indicates that you should be asked to fill in this parameter. The parameter you supply will be inserted in the line at that point. So if you type /jj a dialog will pop up asking you for the channel you want to join. If you enter #gb then the final command will be /join #gb.
/jj /join #$1
the # sign indicates that the parameter you specify should be prefixed with a hash indicating that it is a channel.
/jj /join $?="Enter channel to join:"
This does the same thing but now the dialog will have the "Enter channel to join:" line displayed inside it.
/aw /away $?="Enter away message:" | /say $!
This is similar to the line above except for the addition of the $! parameter. This refers to the text you just typed into the parameter box. ie. the away message. This saves you having to type the same message twice.
/give /me gives $$1 a $$2
The double $$ means that this command will only be executed if a parameter is specified. If you specify only one parameter in the above command it will not be executed. You can also do $$?1 or $?1 which means try to fill this value with parameter one if it exists. If parameter one doesnt exist, ask for it. In the first case the parameter is necessary for the command to be executed, in the second case it isn't.
/slap /me slaps $1 around with $2-
The $2- indicates that everything following and including parameter 2 should be appended to the command line. if you type /slap Sheepy a large trout the final line will be /me slaps Sheepy around with a large trout.
You can also specify $2-5 which means use only parameters 2 to 5.
/laugh /me laughs at $1's joke
Anything appended to a $ parameter is appended to the final parameter. So if in the above example we type /laugh mimi the final command would be /me laughs at mimi's joke.
/silly /say Hel $+ lo th $+ ere $+ !
Parameters are normally separated by a space. To make mIRC combine parameters you can use the $+ identifier. The above line will say Hello there!.
/p /part #
The # sign refers to the channel you are currently on. So if you are on channel #blah, and you type /p then mIRC replaces the # sign with #blah, and the final command is /part #blah.
/op /mode # +o $1
To op someone you can now just type /op goat instead of the whole /mode command.
/dop /mode # -ooo $1 $2 $3
You can now deop three users by typing /dop goat mike bongo.
For multiple commands you should use a | character (the shifted character usually under the \ key). So to write an alias that kicks and bans someone:
/dkb /kick # $1 | /mode # +b $1
The [ ] evaluation brackets
If you want greater control over the order of evaluation of identifiers, you can use the [ ] brackets. Identifiers within these brackets will be evaluated first, from left to right. You can nest brackets.
/say % [ $+ [ $1 ] ]
You can also force a previously evaluated identifier to be re-evaluated by using extra [ ] brackets.
/set %x %y
/set %y Hiya!
/echo [ [ %x ] ]
The { } brackets
You can create multi-line scripts by using the { } brackets. This allows you to create an alias which performs several commands.
/poem {
/msg $1 The Wendigo, the Wendigo,
/msg $1 It's eyes are ice and indigo...
}
The If-then-else statement
You can use if-then-else statements to decide which parts of your script executes based on the evaluation of a comparison.
/number {
if ($1 == 1) echo One
elseif ($1 == 2) echo Two
else echo Unknown number!
}
This creates an alias which tests if the parameter you supplied is the number 1 or the number 2.
For more information, see the if-then-else section.
The Goto command
The /goto command allows you to jump from one point in a script to another point.
/number {
if ($1 == 1) goto one
elseif ($1 == 2) goto two
else goto unknown
:one
echo One
halt
:two
echo Two
halt
:unknown
echo Unknown number!
halt
}
Using a goto incorrectly could lead to an infinite loop. You can break out of a currently running script by pressing Control+Break.
Note: I didn't prefix the above commands with the / command prefix. This is because the command prefix is really only needed when entering a command on the command line. In scripts, all lines are assumed to start with a command, so you don't need to use the / command prefix.
Error handling
Script errors can be caught by adding an :error goto point to your script. When an error occurs, the script will jump to :error and continue running. $error returns the error message.
You can reset the error with /reseterror. If you don't reset the error, it will propagate backwards to any calling aliases until an :error is found and will halt the script as usual.
While Loops
Repeats a loop containing a set of commands while the expression in brackets is true.
var %i = 1
while (%i <= 10) {
echo 2 %i
inc %i
}
The expression in brackets uses the same format as an if-then-else statement.
Multiple while loops can be embedded. You can use /break to break out of the current loop, and /continue to jump to the beginning of the loop.
The Return command
The /return command halts a currently executing script and allows the calling routine to continue processing.
You can also optionally specify a return value which will be stored in the $result identifier. The $result can then be used in the calling routine.
/return [value]
The Halt command
The /halt command halts a script and prevents any further processing. You can use this in remote scripts to prevent mIRC from replying to normal ctcp messages, or in aliases to halt an alias, and any calling aliases, completely.
Identifiers and Variables
An Identifier returns the value of a built-in mIRC variable. For example, $time would return the current time. Whenever mIRC finds an identifier in your command, it replaces it with the current value of that identifier.
For a list of identifiers, see the Identifiers section.
Variables are identifiers whose values you can create and change yourself and use later in your scripts.
For more information on variables, see the Variables section.
Custom Identifiers
A custom identifier is just an alias which returns a value, and you can use that aliases name with an identifier prefix.
For example, create an /add alias such as:
add {
%x = $1 + $2
return %x
}
And then use it in a command:
//echo Total is: $add(1,2)
You can supply as many parameters as you want, ie. $add(1,2,...,N).
You can also use the $prop identifier to refer to your own custom properties:
add {
%x = $1 + $2
if ($prop == negative) return $calc(-1 * %x)
return %x
}
//echo Total is: $add(1,2).negative
Note: Built-in identifiers of the same name have priority.
Remote Scripts
You can add aliases to remote scripts by using the alias prefix and then entering your alias as usual.
alias add {
%x = $1 + $2
return %x
}
This is the same custom identifier as above, except it uses the alias prefix.
If you specify the -l switch in the alias definition, the alias becomes accessible only by commands in the same script and invisible to the command line and other scripts.
alias -l add {
%x = $1 + $2
return %x
}
Function Key support
You can redefine function keys to perform certain commands, just like aliases. For example:
/F1 /say Hello!
/sF2 /query $1
/cF3 /ctcp $1 version
The s and c prefixes for Shift key and Control key respectively.
Note: A function key will behave differently depending on the window in which it is used. For example, when using it in a query window the $1 parameter refers to the selected users nickname. If you're on a channel and the nickname listbox is active then the function key will work on the selected nicknames. If the listbox is not active, the function key will just work on the channel.
Command prefixes
If you are executing a command from the command line ie. by typing it into an editbox, you can force mIRC to evaluate identifiers in that command by prefixing it with two // instead of one /. For example:
/echo My nickname is $me
Would print out "My nickname is $me" and would not evaluate the $me.
//echo My nickname is $me
Would print out "My nickname is Pengy" if your nickname was Pengy.
If you want to force a command to perform quietly ie. without printing out any information, then you can prefix it with a "." fullstop. For example:
/ignore somenick
Would print out information telling you that you are now igoring "somenick". If you don't want this information to be displayed, then you can use:
/.ignore somenick
If you want to perform a command without it being processed as an alias, you can prefix it with a ! exclamation mark.
Comments
You can add comments to your scripts by using the ; semi-colon at the start of a line, or /* and */ to enclose text.
;This is a comment
/*
This is a comment
*/
You can place comments anywhere in a script, they are ignored during processing.
The $& identifier
This identifier allows you to break up a single line into multiple lines which are combined when the script is performed, so you can edit long commands more easily:
longline {
echo This is an example of a long $&
line that has been split into multiple lines $&
to make it easier to edit
}
The Author
In short, mIRC has been ...
... a personal work of care and optimism, created with passion and human intent, with the hope of making a difference in the world, and following my own path to that end. A journey that has lasted, with the help of many others, many more years than I expected!
My thanks to those who have stayed the path with me, and who have helped in one way or another, who have written, and cheered, and criticised.
Khaled Mardam-Bey
Binary Files
mIRC allows you to read and write binary files, and to modify binary variables, by using the following commands and identifiers.
/bread [-t] <filename> <S> <N> <&binvar>
This reads N bytes starting at the Sth byte position in the file and stores the result in the binary variable &binvar.
The -t switch reads data up to the next CR/LF.
/bwrite <filename> <S> [N] <text|%var|&binvar>
This writes N bytes from the specified text, %var, or &binvar, to the file starting a the Sth byte position. Any existing information at this position in the file is overwritten.
Note: If S is -1, the bytes are appended to the end of the file. If N is -1, all of the specified data is written to the file.
/bset [-t] <&binvar> <N> <asciivalue> [asciivalue ... asciivalue]
This sets the Nth byte in binary variable &binvar to the specified ascii value.
If you try to /bset a variable that doesnt exist, it is created and zero filled up to N bytes. If &binvar exists and you specify an N position beyond it's current size, it is extended to N bytes.
If you specify multiple asciivalues, they are copied to successive positions after byte position N.
The -t switch indicates that /bset should treat the values as plain text and copy them directly into &binvar.
/bunset <&binvar> [&binvar ... &binvar]
This unsets the specified list of &binvars.
/bcopy [-zc] <&binvar> <N> <&binvar> <S> <M>
This copies M bytes from position S in the second &binvar to the first &binvar at position N. This can also be used to copy overlapping parts of a &binvar to itself.
If you specify the -z switch, the bytes in the second &binvar that were copied are zero-filled after the copy.
If you specify the -c switch, the first &binvar is chopped to length N + M.
Note: If M is -1, all of the bytes from position S onwards are copied.
/breplace <&binvar> <oldvalue> <newvalue> [oldvalue newvalue...]
This replaces all matching ascii values in &binvar with new values.
/btrunc <filename> <bytes>
This truncates/extends a file to the specified length.
$bvar(&binvar,N,M)
Returns M ascii values starting from the Nth byte
Properties: text, word, nword, long, nlong
$bvar(&v,0) returns the length of the binary variable
$bvar(&v,1) returns ascii value at positon N
$bvar(&v,5,3) returns ascii values from 5 to 8
$bvar(&v,5,3).text returns plain text from 5 to 8 up to the first zero character
The word, nword, long, and nlong properties return values in host or network byte order.
Notes on &binvar binary variables
Binary variables have no size limit, and are limited only by memory, can only be accessed by commands /bread and /bwrite, so they can't be printed or assigned or edited, and are automatically destroyed when a script finishes processing.
$bfind(&binvar, N, M)
Searches a &binvar for a matching value, starting from position N. M can be a character value, ie. 0 to 255, or text. The search is case-insensitive.
Properties: text
$bfind(&test, 1, mirc) finds "mirc" starting from pos 1
$bfind(&test, 5, 32) finds char 32 (a space) from pos 5
$bfind(&test, 1, 87 65 86) finds WAV from pos 1
You can use $bfind().text to force a text search if the search text is a number.
Catcher
This feature looks for any text that looks like a URL or Email address in incoming messages and saves it for your future reference.
Enable catching for...
If this option is turned on mIRC will catch references to URLs and Emails and store them in the URLs list window.
mIRC looks for URLs beginning with "http://", "ftp://", "gopher://", "www.", and "ftp.". mIRC also checks to make sure addresses are not added to a list if they already exist. Addresses longer than 256 characters are ignored.
mIRC will also catch any text that looks like an email as long as the word "mail" is mentioned in the same line of text as the email address.
Chat links
These options enable or disable support for chat links, and allow you to specify whether you want a confirm dialog to be displayed whenever a chat link asks mIRC to connect to a server.
Web browser
When you open a URL, mIRC can optionally open a new browser window and activate it if required.
Place ? items at top
If this is checked then mIRC will place ? marked URLs at the top of the URL list, otherwise they will be placed at the bottom of the list.
Delete ? items on exit
To prevent your URL list getting too long you can choose to have all ? marked items deleted when you exit mIRC. Any items whose marker has been changed to something other than ? will remain in your list for future reference.
On Send
When sending URLs to a channel, query, etc. mIRC can send only the URL or both the URL and it's description.
Hint: You can click your right mouse-button in the URL window for a popup menu which provides various URL functions.
Changing Colors
mIRC uses black text on a white background by default because this allows colored text to appear clearly and crisply. However, if you find the color scheme too bright, or if you want something a bit more fun, you can change the text and background, as well as other specific types of text eg. your own messages, to other colors.
To change the color settings, select the Colors dialog from the Tools Menu. It will popup up and show you the different types of messages in their current color settings.
To change the color of an item, just click on it and you'll see it's name appear in the listbox at the bottom. Then click on any of the colored squares, and you'll see the color of the text for that item change accordingly.
To change the background color, just click on the background itself and select a color as usual. You can also click on the background of the editbox and the listbox to change their colors as well.
If you don't like the changes you've made you can either click cancel or you can click the reset button which will reset the colors back to the default mIRC colors.
To customize the color of one of the color boxes, just click your right mouse button on it and a custom color dialog will pop up allowing you to choose a new color for it.
Once you've finished making changes, click on the Ok button, and hey presto you should now feel a bit more colorful!
mIRC also allows you to interactively change the color, as well as the appearance, of text as you type. You can find out how to do this in the Control Codes section. However remember that other people might have a background color that's different from yours, so what appears clearly on your background color might be hard to read on someone else's.
Channel Central
The channel central dialog allows you to set various channel modes if you're an Op on a channel. If you're not an Op you will not be able to change the channel modes and they will appear disabled.
You can find out more about channel modes in the IRC Commands section.
Topic History
Lists the current topic, and the history of topic changes during your stay on a channel.
Bans List
This allows you to view, edit, or remove various types of mode settings, such as bans, exceptions, and invites. Most IRC networks support ban lists, however few support exception and invite lists currently.
Only Ops set topic
This allows only Ops on a channel to change the channel topic.
No external messages
This prevents users who are not on the channel from sending messages to the channel.
Invite only
This setting prevents users from joining the channel unless someone on the channel has specifically invited them using the /invite command, eg. /invite nickname #channel
Moderated
This prevents users from speaking on a channel unless they have been given a voice on the channel by an Op. This feature allows you to moderate the channel for events such as interviews, etc.
Key
This option allows you to set a password for the channel if you are an Op. Any user who wishes to join your channel will need to specify the password when joining, eg. /join #channel password
Limit to N users
This limits the number of people who can be on the channel at any one time to N people.
Private
This prevents a channel from being seen in a /whois unless the person issuing the /whois request is on the same channel. A channel that is +p will still show up in the channels list though.
Secret
This prevents a channel from being listed in the channels list retrieved by the List Channels dialog.
Note: The Events dialog for a channel can now be accessed via the System menu.
Chatting Privately
As well as being able to chat on public channels, mIRC also allows you to chat privately with someone.
If you're on a channel, and you see someone you'd like to chat with, you can double-click on their nickname in the nickname listbox and a private query window will open up. You can then start chatting privately to them through the query window. Alternatively, you can click your right mouse button in the nickname listbox and a popup menu will appear with various options, one of which will be to open a private query window to the person selected in the nickname listbox.
If you're not on a channel, you can type the command /query nickname, where nickname is the person you want to chat with. Press the enter key, and a query window will open up and you can start chatting privately, assuming of course that the person is on IRC. You can find out if a person is on IRC by using the /whois nickname command.
There is another way to chat privately called DCC Chat. This method is more secure and usually faster because it doesn't rely on the IRC Server to relay your messages. Instead it connects directly to the other person's IRC Client. However it does need to use the IRC Server to initiate the chat session.
To DCC Chat someone, you can click on the Chat button in the toolbar, and a DCC Chat dialog will pop up. Enter the person's nickname, and click on the Chat button, and if the person accepts your DCC Chat request, you will be able to start talking to them privately.
If a user sends you a chat request, a chat dialog will pop up asking you whether you want to accept their chat request. You can then accept or decline. You can find out more about DCC Chat related settings in the DCC Section.
The /dcc chat <nickname> command is another way of initiating a dcc chat, where nickname is the user you with whom want to dcc chat.
Note: DCC Chat needs to use your IP address to initiate a connection with another client. If you are having trouble initiating a connection then your IP address might be wrong. See the Local Info section for more information.
COM Objects
mIRC allows you to call COM objects via scripts. You must have experience with COM objects in order to use this feature.
/comopen name progid
This opens a COM connection to object progid eg. Excel.Application, and assigns the connection a name.
You should check $comerr after making this call to confirm that the COM conection was successful.
/comclose name
This closes the specified COM connection.
/comreg -u filename
This registers/unregisters a COM DLL with windows.
example {
comopen name progid
; if comopen failed, maybe the DLL that came with the script isn't registered
if ($comerr) {
;register the DLL
comreg test.dll
;try to open it again
comopen name progid
; still failed, halt the script
if ($comerr) halt
}
}
$comerr
This should be checked after a call to any COM command or identifier. Returns 1 if there was an error, 0 otherwise.
$com(name,member,method,type1,value1,...,typeN,valueN)
This calls a member of an open COM connection with the specified method and parameters.
name - connection name.
member - member name.
method - Combination of the following values added together:
1 = DISPATCH_METHOD
2 = DISPATCH_PROPERTYGET
4 = DISPATCH_PROPERTYPUT
8 = DISPATCH_PROPERTYPUTREF
type - the variable type, can be: i1, i2, i4, ui1, ui2, ui4, int, uint, r4, r8, cy, date, decimal, bool, bstr, variant, dispatch, unknown, error.
VB equivalents are: boolean, byte, currency, date, double, integer, long, single, string, variant.
To make a variable by reference, use * in the type name, eg. i1*
To assign a name to a variable for later reference after a call, append it to the type, eg. i1* varname
When using a variant you must also specify the variable type after it, eg. variant bool.
value - the value assigned to the variable type.
Returns: 1 = ok, 0 = fail.
After you've opened a COM conection or made a call to $com() you can use the following forms of $com():
$comcall(name,alias,...)
$comcall() uses the same format as $com() apart from the alias. It is multi-threaded so it will not halt the script and will call the specified alias once the call returns.
$com(name/N)
Returns name if connection is open, or name of Nth connection. N = 0 returns number of open connections.
Properties: progid, dispatch, unknown, result, error, errortext, argerr
progid - object name.
result - the value returned by the COM object member after the call.
error - error value, if there was an error.
errortext - error description associated with error.
argerr - Nth argument that caused the error, if the error was due to an invalid variable type.
$com(name/N,varname)
Returns value of the specified variable name.
$comval(name,N,member)
Returns member value for the Nth instantiation of the enumerated collection in name.
Dispatch and Unknown
The two variable types dispatch and unknown allow you to pass dispatch/unknown pointers as parameters in a $com() call, or retrieve dispatch/unknown pointers from a $com() call, by reference.
To pass a dispatch/unknown pointer as a parameter in $com(), specify the variable type as dispatch/unknown, and specify the name of an existing $com() connection as the value.
To retrieve a dispatch/unknown pointer through a call to $com(), specify a dispatch* item, with a variable name, as the last parameter in a $com() call, without assigning it a value. When $com() returns, mIRC will create a new $com() item with that variable name and assign it the dispatch or unknown pointer. See example script #2 below.
In the case of retrieving an unknown pointer, mIRC will extend it to a dispatch pointer if it can, allowing you to call it directly via $com().
You can use $com().dispatch or $com().unknown to see if a pointer exists for that $com() item.
Example Script #1
The following script is a simple example that connects to excel and then retrieves and sets the visible property.
excel {
comopen excel Excel.Application
if ($comerr) {
echo comopen failed
halt
}
; check if excel window is visible
if ($com(excel,Visible,3) == 0) {
echo $com failed
goto finish
}
echo Visible: $com(excel).result
; make excel window visible
if ($com(excel,Visible,5,i4,1) == 0) {
echo $com failed
goto finish
}
; check visibility again
if ($com(excel,Visible,3) == 0) {
echo $com failed
goto finish
}
echo Visible: $com(excel).result
:finish
comclose excel
}
Example Script #2
The following script retrieves information about your CPU. It displays debugging information so see you can see whether a call succeeded or not, the value it returned, and whether a new COM object was created.
cpu {
comopen Locator WbemScripting.SWbemLocator
if ($comerr) { echo comopen failed | halt }
echo com: $com(Locator, ConnectServer, 3, dispatch* Services)
echo result: $com(Locator).result
echo com(0): $com(0)
if ($com(Services)) {
echo com: $com(Services, Get, 3, string, Win32_Processor.DeviceID='CPU0', dispatch* More)
echo result: $com(Services).result
echo com(0): $com(0)
if ($com(More)) {
echo com: $com(More, Name, 3)
echo result: $com(More).result
echo com: $com(More, Caption, 3)
echo result: $com(More).result
echo com: $com(More, Manufacturer, 3)
echo result: $com(More).result
comclose More
}
comclose Services
}
comclose Locator
}
Example Script #3
The following script retrieves information about your hard drives. It does so by retrieving all drive instances in an enumerated collection and then accessing member values for each instance using the $comval() identifer.
drives {
comopen Locator WbemScripting.SWbemLocator
if ($comerr) { echo comopen failed | halt }
echo Com: $com(Locator,ConnectServer,3, dispatch* Services)
echo Result: $com(Locator).result
comclose Locator
if $com(Services) {
echo com: $com(Services, InstancesOf,3,string,Win32_LogicalDisk,dispatch* Instances)
echo result: $com(Services).result
comclose Services
}
if $com(Instances) {
echo com: $com(Instances,Count,3)
var %n = $com(Instances).result
echo result: %n
var %m = 1
while (%m <= %n) {
echo 4 disk: %m
echo 3 Com: $comval(Instances, %m, Name)
echo 3 Com: $comval(Instances, %m, FileSystem)
echo 3 Com: $comval(Instances, %m, FreeSpace)
echo 3 Com: $comval(Instances, %m, Description)
inc %m