Hotlinks
When you move your mouse in a window over text that is a website or email address, or a nickname of a certain type, the mouse pointer changes to a finger indicating that you can click, double-click, or right-click on that text to perform certain functions.
If you double-click on on a website address, mIRC will open up your web browser to visit that website.
You can also hold down the shift-key and double-click on email addresses to open your email program. The shift-key is required because of the huge number of addresses on IRC which look like emails but aren't.
If you're in a channel window and you move the mouse over text that is a nickname on that channel, you can double-click on it for the usual double-click behaviour, or right-click on it to open the nickname list popup menu. If you single-click on the nickname, the cursor in the listbox is scrolled to that nickname.
You can also double-click on text that is a channel name in any window to join that channel.
If you move the mouse over text that is a nickname in your Notify list, you can also click your right mouse button to pop up the notify popup menu.
Note: This behaviour depends on the Hotlink setting in the Other dialog.
Sunday, March 23, 2008
Hotlinks
Posted by Admin at 1:24 AM 0 comments
Labels: Hotlinks
Voice Commands
Voice Commands
If you have Speech Recognition software installed, mIRC can be made to listen to voice commands through scripting.
/vcmd -lc
This turns voice command listening on or off, or you can temporarily turn off listening by specifying sleep.
The -c switch clears the commands list.
The -l switch lists the commands in your commands list.
Note: Your SR software may have very large speech files or dictionaries which could make it slow to load/unload and/or process your speech.
/vcadd
This adds voice commands to the commands list.
Commands should consist of at least two words and should be sufficiently distinct from other commands to make it easier for your SR software to match the words you speak to commands in your commands list.
Note: Adding or removing commands can be done on the fly, however if your SR software is slow at updating the commands list, it could cause short pauses in mIRC.
/vcrem
This removes commands from the commands list.
$vcmdver
Returns the version of your installed SR software, or $null if not installed.
$vcmdstat
Returns 0 if not available, 1 if currently off, 2 if ignoring commands, 3 if listening for a command.
$vcmd(N)
Returns the Nth item in your commands list.
The on VCMD event
If the SR software matches a word you've spoken to a word in your commands list, it triggers the on VCMD event:
on 1:VCMD:
Example Script
alias vctest {
if ($vcmdver == $null) halt
vcmd -c on
vcadd connect Dalnet, connect Efnet, connect Undernet, connect IRCnet
vcadd Part Channel, Disconnect, List Commands, Moo Cow
}
on 1:vcmd:connect*:*:server $2
on 1:vcmd:part channel:*:if ($active ischan) part $active
on 1:vcmd:disconnect:*:quit
on 1:vcmd:list commands:*:vcmd -l
on 1:vcmd:moo cow:*:splay moo.wav
on 1:vcmd:*:*:echo You said: $1-
Posted by Admin at 1:23 AM 0 comments
Labels: Voice Commands
Agents
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>
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
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
This shows an agent in its most recent or default position, or at the specified x y position.
/ghide
This hides an agent.
/gmove
This moves an agent to the
/gsize
This resizes an agent to the specified width and height.
/gtalk -kwlu
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
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
This makes an agent point towards the specified
/gstop -c
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
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
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
\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.
Posted by Admin at 1:22 AM 0 comments
Labels: Agents
Variables
Variables
Variables are temporary storage areas to which you can assign values which you can use later in your scripts.
If a variable is referred to and it doesnt exist, it returns the value $null. The $null value can be used in comparisons in if-then-else statements to control branching etc.
The following commands allow you to create and set the values of variables.
/set [-snzuN] <%var> [value]
This sets the value of %var to the specified value.
If you specify the -uN switch, %var is unset after N seconds, assuming it is not set again by another script. If you specify a zero for N, the variable is unset when the script finishes.
The -z switch decreases %var until it reaches zero and then unsets it.
The -n switch makes it treat value as plain text.
/unset [-s] <%var>
This unsets and removes the specified variables from the variables list. If you specify a variable with wildcard characters then all matching variables will be removed.
/unset %test*
This will remove all variables beginning with the word %test.
You can also set/unset dynamic variables using [] brackets:
vartest {
set %a [ $+ b ] 1
set %a [ $+ c ] 2
set %a [ $+ d ] 3
echo ab = %ab
echo ac = %ac
echo ad = %ad
unset %a [ $+ b ] %a [ $+ c ] %a [ $+ d ]
}
/unsetall
This unsets and removes all variables from the variables list.
/inc [-cszuN] <%var> [value]
This increases the value of %var by value.
If you specify the -uN switch, %var is increased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.
The -c switch increases %var once per second.
The -z switch decreases %var until it reaches zero and then unsets it.
/dec [-cszuN] <%var> [value]
This decreases the value of %var by value.
If you specify the -uN switch, %var is decreased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.
The -c switch decreases %var once per second.
The -z switch decreases %var until it reaches zero and then unsets it.
You can also use the equal sign to assign values to variables:
%i = 5
%xyzi = 3.14159
%count = $1
And you can perform the following operations on variables when using the equal sign:
%x = 5 + 1
%x = 5 - %y
%x = %x * 2
%x = %z / $2
%x = $1 % 3
%x = 2 ^ %w
You can only perform a single operation in an assignment at this time.
You can also use the $calc() identifier which allows you to perform complex calculations.
//echo 1 $calc(3.14159 * (2 ^ %x % 3) - ($ticks / (10000 + 1)))
For floating point numbers you can also use the $round(N,D) and $int(N) identifiers to handle precision of the decimal digits. The number of decimals is currently limited to 5 digits.
Local Variables
Local variables are variables that exist only for the duration of the script in which they are created and can only be accessed from within that script. They can be created with the /var command:
/var %x
This creates the local variable %x in the current routine and can only be referenced from inside this routine.
/var %x = hello
This creates a local variable %x and assigns it the value hello.
You can create multiple local variables by separating them with commas:
/var %x = hello, %y, %z = $me
loop {
var %x = 1
:next
echo item %x
inc %x
if (%x < 10) goto next
}
Note: You can use /var -s to make a variable show the result when a value is set.
Identifiers
$var(%var,N)
Returns the Nth matching variable name.
Properties: value, local
You can use a wildcard in the variable name.
If N = 0, returns total number of matching variable names.
Note: This searches both local and global variables.
Posted by Admin at 1:21 AM 0 comments
Labels: Variables
Popups
Popups
mIRC allows you to create custom popup menus for the status window, query/chat windows, channel windows, the channel nickname listbox, and main menubar. To create these you must know how to use IRC commands, how to create Aliases, and how to use Identifiers and Variables.
If you click the right mouse-button in a window, the popup menu for that window will appear and you can select menu-items which you have defined to perform certain tasks, such as opping a user or joining a channel.
Examples
Popup menu definitions use the format:
Posted by Admin at 1:19 AM 0 comments
Labels: Popups
Aliases2
Aliases
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
}
Posted by Admin at 1:18 AM 0 comments
Labels: Aliases 2
Aliases1
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.
Posted by Admin at 1:17 AM 0 comments
Labels: Aliases 1