ScriptHeaven Start Exposing Your Nuke Site Today 
  Login or Register
•  Home  •  Downloads  •  Your Account  •  Forums  •
 Main Menu 
 Main :
 Scripts
 Bots
 Addons
 Official PnP Addons
 Clients
 Eggdrop
 MTS Themes
 Snippets
 IRCDs
 Screenshots
 Modules 
 Home(News) :
 Home
 News
 Submit News
 Stories Archive
 Search
 Topics
 Members :
 Members List
 Your Account
 Mailbox :
 Newsletter
 Private Messages
 News By Mail
 Community :
 Forums
 Gallery
 Guestbook
 Feedback
 Recommend Us
 Downloads List
 Links List
 News List
 Link To Us
 Web Links
 
 Downloads
 
 Stats :
 Statistics
 Top 10
 Surveys
 IrCQ Stats

Invisible Modules
(Active but invisible link)

· gallery
 Outstanding Sites 
 Affiliates 
smarticq.com

ircnetworkz.com

caddonlea.net

#scripted dalnet

beirutscripts

Aussie Chat Network

corpseweb.tk

deztr0jah.org

winzero.org

mirc.ma

soleil-irc.com

xtremfury

mircfx.net

Bluish mIRC

scribbytech.net

 Site Info 
Welcome, Visitor
Nickname
Password
(Register)
Membership:
Latest: Digital
New Today: 0
New Yesterday: 0
Overall: 5459

People Online:
Visitors: 45
Members: 0
Total: 45
 Last Seen 
abeat: 21 hours, 10 minutes ago
changzaa: 1 day, 22 hours, 5 minutes ago
Digital: 3 days ago
bliznak: 3 days ago
Mr_Michael_FL1: 3 days ago
krejzi: 4 days ago
tpuahsiew: 4 days ago
int3rv3n3: 6 days ago
myxin: 6 days ago
MasterVampire: 6 days ago
JAMJAM: 7 days ago
 Gogloom.com 
 

Search IRC with Gogloom.com

Search IRC
Powered by Gogloom.com

 Info-Block 

Info Block


ScriptHeaven

Recent updates in the downloads section can be viewed in the top right block in the main page.

 PHP-Nuke Resources:

NukeResources
PHP-Nuke
NukeScripts Network

In here we will display

Messages

links and all kind of other information.

pairc.com gone

In memory of pairc.com, the original home of Peace n Protection.
There are 411 Downloads and 46 Categories in our database

New version of AnswerBook out
For those using this multi-featured bot if you have any of the 2.x versions you can get the upgrade file here, new users can click on the title to get the full version.

mIRC DalNet Trick
Here's a nice lil trick posted at mIRC's homepage's forum for those having trouble connecting to dalnet, in your mIRC's status window type /server dalnet this will auto cycle through all available server until it finds one that works

New collection of IRC servers
Click on the title to download. Save the file to the mIRC directory on your harddisk (c:\mirc\ or similar), replacing the old file, and enjoy this refresh! The server list will immediately be available to you from within mIRC.

ScriptHeaven
 NukeResources 
·Block Forum Center phpBB3
·News Themes for PHP-Nuke with forum phpBB3
·3 New Themes Released From Clan Themes
·Xtrato.com Re-Designed
·Two updates
·Nuke Patched 3.5
·BBtoNuke 2.0.23 Full Package
·Free PHP-Nuke Webhosting Theme
·phpthemes.net Growing Collection
·Free Download: 5 Variations of the famous black 0ri0n-Theme!

read more...
 Donations 

PayPal Donate
If you would like to contribute to the further development of ScriptHeaven, use the link above.

 Forums 

 Gitarman Trivbot
 Snak user in desperate need of help
 Trivbot2001 - Does anyone know where to download this?
 irc script
 pnp XZP bot
 mIRC Bnc Socket Bot
 Best trivia bot/script?
 Extreme v9
 custom slaps?
 Channel to DCC Chat

ScriptHeaven Forums

MTS draft 8.2a &ndash Version 1.1

This is the MTS 1.1 draft. Very little has changed since 1.0, but make sure to check the changes section of this file so you can update your engines to be compatible with this version.

This is a fairly large document and is mostly geared toward scripters that will be implementing theme engines. A smaller file more geared toward themers is also available at the MTS home page. Check it out!

Contents

Terminology

  • MTS is mIRC Theme Standard- this document, and any script that uses the concepts within to handle themes.
  • script refers to a script that handles theme output &ndash in other words, the theme engine.
  • theme refers to an actual theme or theme file that has been loaded.
  • event is something that occurs on mIRC that can have it's output reformatted.
  • raw is a special type of IRC event referred to by a number from 001 to 999.
  • variables are used to store information relating to an event or raw, to later be formatted by the theme.

A MTS script will take IRC events and raws, store relevant data in variables, and use the information in a theme to format them for display.

Chapter 1 - The MTS Concept

Why a theme standard? How is this different from other "standards" people have tried to come up with in the mIRC community?

A theme standard is needed in the mIRC community. There are many themes out there for various scripts, and no way to simply use them in another script. If a themer creates a theme using a standard, then it can be loaded in all scripts supporting that standard- allowing all scripts and users to benefit from the talents of themers.

This standard was created from the input of many scripters and themers, many who have already planned to implement the standard.

Most scripters are aware that there are basically two different ways to implement a theme system in mIRC, although there are a few variations of each type.

The first type of theme is the "scripted" theme system, where basically a script file is /loaded by a theme alias, and this new script file contains all of the code to handle the text processing for the script. The script simply calls aliases in the theme file to handle each event.

Pros: This is very flexible, since everything is scripted.
Cons: It is more difficult for a themer to make a scripted theme because they must know at least a bit of mIRC scripting. It is very difficult to write scripts that modify these themes, such as theme editors. The method used for these aliases also differs wildly from script to script.

The second type of theme is the "keyword" theme system. This is implemented by having a text file or ini file that is read into the script in some manner. The theme system then replaces keywords in the theme lines with correct values whenever an event occurs, and displays that.

Pros: Simple and easy to edit for themers. Theme editors can be made easily for these types of themes.
Cons: You are limited in your flexibility, since there is no actual scripting in the theme files. You're also limited to what the script allows in a theme, and you cannot (usually) do multi-line displays or other fancy themes.

MTS is a combination of both types, for maximum flexibility. It is what you might expect if you started with a text theme system, and then added support for scripted aliases on top.

Chapter 2 - How MTS Works

A basic run down of what happens during an event that an MTS script wants to format or "theme":

  1. The script catches the event in mIRC, using a script event or raw
  2. The script checks the theme file to see what the theme wishes to do for this event
    If the theme has a simple line of text for this event:
    1. The script replaces special codes (variables) in the line of text, such as nickname, channel, colors, etc.
    2. The script then displays the line of text to the screen

    If the theme instead refers to an alias name:

    1. The script sets a number of mIRC %::variables to values such as nickname, channel, colors, etc.
    2. The script sets %:echo to the command it wishes to use for theme output, such as "/echo -t $chan"
    3. The script calls the theme alias, which formats and displays output using these variables

Chapter 3 - Basic Format for an MTS Theme File

All MTS theme files should have an extension of .mts. MTS files are simple text files, where each line contains one event, raw, setting, or other piece of theme-related information.

You may have blank lines, and any line beginning with a semicolon (;) will be treated as a comment and ignored.

Before any settings, the first line in your MTS file must be "[mts]". This is related to scheme usage (chapter 9). Even though scheme support is optional and not part of every theme, all themes must have the [mts] line to mark the main MTS data section of the file.

Themes may refer to external files such as images or a .mrc file. These files must be in the same directory as the theme .mts file. For example, ultra.mts refers to ultra.mrc and BK.png. These files would be in the same directory as the ultra.mts file.

It is highly recommended that .mts files be put in their own subdirectory so that supplemental theme files do not conflict with other themes.

A script may load a theme and process in any way it desires, as long as it achieves the effects detailed in this document. Some behaviors or events may not apply to a given script and can be ignored. A script may also voluntarily ignore certain features, such as images, if desired, but this may diminish the value of some themes.

Chapter 4 - Format of Events and Raws in MTS Theme Files

Each event or raw has one line in an .MTS file. The line starts with a code that signifies the event or raw. The remainder of the line is the text displayed for that event, but will contain special variable <codes> that will get replaced when the actual event occurs. For example:

TextChan [<nick>] <text>

This is a basic theme line for text in a channel window. When it is displayed, the script will replace <nick> with the nickname of the user, and <text> with what they said.

Some (or all) events may instead refer to aliases or lines of code. For example:

TextChan !Script theme.chantext

This tells the script that, when a text event happens for a channel, to call the /theme.chantext alias (in the theme's .mrc file, specified by the Script line - see chapter 6). When this alias is called, it will then handle the echoing of the text, using the %:echo variable (see chapter 5), as well as theme variables that have already been set by the calling script. For example, %::nick will be the nickname, and %::text will be what the text was from the event. Notice how these correspond with <nick> and <text> above &ndash this is true for all theme variables.

A special variable, %:echo, contains the command the alias should use to display it's text. A short example alias that could be part of a theme's script file:

alias theme.chantext {

  %:echo ( $+ $lower(%::nick) $+ ) %::text

}

These aliases are stored in a separate .mrc file (this file is mentioned on the SCRIPT line in the .mts file &ndash see chapter 6 for details). When the script sees the "!Script" prefix, it should take the remaining text and run it as if it were an alias name, but it should $eval() it first, so that it runs as an actual line of mIRC code (see chapter 9 for details). In other words, something such as "!Script %:echo %::text" should be allowed to work.

Note that "!Script" by itself should not be an error- it should simply "do nothing", essentially preventing any output.

This covers the basics of how a script should handle a theme: check the line, and either replace <variables> and display it, or set %::variables and call the listed alias. Note that when replacing <variables>, you should also replace <lt> and <gt> with < and > so a theme can use those characters (see chapter 9 for details).

Chapter 5 - Variables Used in Events and Raws

The variables listed here should be set by the script before calling a theme alias. Note that all variables, other than %:echo and %:comments, have a corresponding <variable> that should be replaced when processing normal theme lines. Some variables may not apply to a given event or raw, of course. Some variables are listed multiple times when they have different uses in different situations.

All-purpose variables

These must be set in all events and raws.

%:echo Command being used to display text. Use in place of /echo.
%::me Your nickname.
%::server The server you are currently connected to (if connected).
%::port The port you are currently connected to (if connected).
%::pre Set to the value of Prefix (see Prefix option).
%::c1 Base color 1 (see BaseColors option).
%::c2 Base color 2 (see BaseColors option).
%::c3 Base color 3 (see BaseColors option).
%::c4 Base color 4 (see BaseColors option).
%::timestamp The current timestamp, using the script's Timestamp line format. Used by <timestamp> in theme files.

Variables used in events

%:comments Used by all events. These comments are for a script to add any additional text to a line, and should therefore be appended to the end of any displayed line. A normal text line (one not using !Script) does not need to do anything with this &ndash the script should append it automatically when used. For this reason there is no corresponding <comments> code.
%::text The text or message from the event (if any).

For Ctcp, CtcpSelf, CtcpReply, CtcpReplySelf: Additional text for the CTCP, beyond the command.
For Notify, UNotify: Notify note, if any.
%::parentext For Kick, KickSelf, Quit, Part, Notify, UNotify: This is the same as %::text, but surrounded with parenthesis. If there was no message, this is blank &ndash not "()". The format for this can be changed by a script &ndash see ParenText, chapter 6.
%::nick Nickname of user triggering event. In cases such as you sending a private message, this is who you sent it to.
%::address Address in ident@host format of %::nick, if available.
%::chan Channel event occured in.
%::cmode Current mode of %::nick on %::chan, such as @ or +.
%::cnick Current color of %::nick on %::chan, as a number.
%::target Equivalent to $target, useful for op notices and certain other cases.
%::knick For Kick, KickSelf: Nickname of user who was kicked.
%::kaddress For Kick, KickSelf: Address in ident@host format of %::knick, if available.
%::newnick For Nick, NickSelf: New nickname for user.
%::modes For Mode, ModeUser: Channel modes or usermodes being set.
%::ctcp For Ctcp, CtcpSelf, CtcpReply, CtcpReplySelf: CTCP or CTCPREPLY command (single word). The remainder of the CTCP, if any, is in %::text.

Variables used in raws

Note that if a raw only uses ONE of %::value, %::nick, or %::chan, then the script is allowed to place the SAME VALUE in all three, for simplicity. A theme should not rely on this behavior.

%::text The full text from the event, either $2- or $3- &ndash if $2 is placed in %::nick or %::chan, %::text should be $3-.
%::numeric Number of the raw reply being triggered.
%::value A single value of interest from a raw, usually $2.
%::nick Nickname raw applies to (usually from $2).
%::chan Channel raw applies to (usually from $2).
%::fromserver The server that is sending the raw line to the user. This is determined using $nick in a mIRC raw event. This will not always match %::server.
%::users For RAW.251, RAW.255, RAW.265, RAW.266: User count.
%::modes For RAW.221, RAW.324: Channel/user modes currently set.
%::address For RAW.302, RAW.352: Address of nickname (USERHOST or WHO).

Variables for Whois, Whowas, and Who events and raws

Note that there is no Who event, just RAW.352, but it is listed as Who below for clarity. A script is only required to use these variables in Whois/Whowas/Who events and raws &ndash they do not need to work in other events and raws.

%::away Whois: Away message, if any.
Who: H for Here, G for Gone (away).
%::nick Whois, Whowas, Who: Nickname of user.
%::address Whois, Whowas, Who: Address of user in ident@host format.
%::chan Whois, Whowas: Channels user is on, if any.
Who: A single channel user is on.
%::cmode Who: Current mode of user on specified channel.
%::realname Whois, Whowas, Who: The "full name" field.
%::isoper Whois, Who: Is this user an IRCop? Set to "is" or "is not".
%::operline Whois: The text of the "is an ircop" line sent by the server, not including the nickname, as different users may have different levels of status described in this line.
%::isregd Whois: Is this nickname registered? Set to "is" or "is not".
%::wserver Whois, Whowas, Who: IRC server the user is on.
%::serverinfo Whois, Whowas: "Info" about the IRC server the user is on (usually just useless text).
%::idletime Whois: How long the user has been idle, in seconds.
%::signontime Whois: When the user signed on, in $asctime() format.
%::value Who: Number of hops user is away.
%::text Whois, Whowas: Any extra notes from a whois not covered elsewhere.
Who: Entire /who line.

Variables for DNS events

Other than %::nick, a script is only required to use these variables in DNS events &ndash they do not need to work in other events and raws.

%::nick Nickname of user being DNS'd, if appropriate.
%::address The address being looked up. This will be equal to either %::naddress or %::iaddress (not %::nick).
%::naddress Named address, if available.
%::iaddress IP address, if available.
%::raddress Resolved address, if available.

List of all variables without duplicates:

%:echo %:comments
%::away %::c1 %::c2 %::c3 %::c4 %::chan
%::cmode %::cnick %::ctcp %::iaddress %::idletime %::isoper
%::isregd %::kaddress %::knick %::me %::modes %::naddress
%::nick %::numeric %::operline %::port %::parentext %::pre
%::raddress %::realname %::server %::signontime %::target %::text
%::users %::value %::wserver

Chapter 6 - MTS File Format &ndash Settings And Information

.mts files contain more than just events and raws &ndash they contain other lines with information and settings. These settings are covered in this chapter.

Remember that all entries in an .mts file take up one line. Actual events and raws are in the next chapter. Also note that the setting names are not case sensitive.

Note that MTSVersion and Name are the only required fields. The [mts] line is also required. Everything else is optional, and a script should use default values or no values for missing items.

Informational items in an MTS file:

[mts] This must appear before any MTS data. It should appear on a line by itself (this is to ease MTS loading by allowing use of the mIRC /loadbuf -t switch).
Name This is the name of the theme, and is required.
Author The name or nickname of the theme's author.
Email E-mail address of the author.
Website Website for the theme or author.
Description A brief description of the theme.
Version The version of the theme. A new version of the same theme should have a value that is greater than (>) the previous version's value.
MTSVersion The version of MTS the theme is designed for. A theme will work on a later version of MTS but not an earlier one. This field is required and should be in the form "n.nn".

Color options in an MTS file

These items allow a theme to change mIRC and theme colors.

Colors These are the mIRC /color settings to use; the order is the same as in the mirc.ini file. The format is 26 numbers, separated by commas. If not present, use the default mIRC colors. See chapter 9 for the order of colors and defaults.
RGBColors These are the RGB values to use for all 16 colors. Each color is three numbers (R,G,B) separated by commas; there are 16 such sets, separated by spaces. In other words, R,G,B R,G,B R,G,B etc. (where R,G,B are numbers) If this line is not present, you should reset all colors to their default mIRC RGB values (can be done with /color -r in mIRC).
BaseColors This is four colors used in the theme itself. These will be used for %::c1 through %::c4 and <c1> through <c4>. The format is four numbers, separated by commas. It is recommended that these four colors be in a certain order (see below).

BaseColors help keep a theme "modular" &ndash if you use them throughout a theme, you can then change the colors of your entire theme just by changing one or two color lines (more details in chapter 9 - schemes).

Scripts may also choose to use the colors in BaseColors for their own specialized echos and displays. For that reason, the order of the four BaseColors is recommended to be as close to the following as possible:

Text color, Nickname color, Text highlight color, Bracket color

These are merely recommendations &ndash a theme can use these for anything it wishes. The reason for the recommendation is so a theme contains reasonable colors that a script can use for it's own purposes as well. All four colors should ideally produce readable text on the selected background color.

Nicklist options in an MTS file

The first set of items are single numbers representing the color to use for nicknames in the nicklist. Each line either corresponds to a channel mode (OP, etc.) or a special status, such as IRCOP. Not all scripts will use all colors (or even use nicklist colors at all) and remember that themes do not need to include all colors. A script should ideally not use any colors that are not present. In other words, if a user is both an OP and an IRCOP, but the theme does not define an IRCOP color, use the OP color.

CLineOwner Mode . on certain servers (channel owner).
CLineOP Mode @ (op).
CLineHOP Mode % on some servers (half-op or helper).
CLineVoice Mode + (voice).
CLineRegular No special mode.
CLineMe Your nickname.
CLineFriend A friend (notify list, userlist, protected, auto-op, etc).
CLineEnemy An enemy (banned, ignored, blacklisted, etc).
CLineIrcOP IRCops.

For scripts that can use /aline for custom windows (such as multiserver scripts), MTS provides for you to be able to change the mode character and color for each type of user. Keep in mind that CLineCharRegular probably wont use a character, but if the theme wants one, then you should accomodate for it. The syntax is the exact color and mode character to be prefixed before the above CLine colors. Note that, like the other CLine lines, you should not include the color control code itself (Ctrl+K).

Example:

CLineCharOwner    12.

CLineCharOP       11@

CLineCharHOP      10%

CLineCharVoice    09+

CLineCharRegular

Font options in an MTS file

These options define the fonts to use for windows. A script may ignore these but the theme may not look correct. Some fonts apply to multiple windows or types of windows. Each font line is a font name, followed by a comma and a font size. The size should be a positive or negative number. To make a font bold, put ,B after the font size.

FontDefault Font used for status window and any unspecified windows. This is basically a "default" font that can be used for any window (for example, script windows or notify/url/finger windows).
FontChan Font for channel windows.
FontQuery Font for query, chat, and dedicated message windows.

Image options in an MTS file

These options define image files to use for backgrounds and other areas of mIRC. A script is free to ignore some or all of these. The first word of each line defines the way to apply the background &ndash center, fill, normal, stretch, tile, or photo. This is followed by the filename of the image. The ImageButtons item does not have a style. The ImageToolbar and ImageSwitchbar should include a style (although mIRC currently only supports the fill style for these, this may change in the future).

ImageStatus Background for status window. You may use this for other windows if desired.
ImageChan Background for channel windows.
ImageQuery Background for query, chat, and dedicated message windows.
ImageMirc Background for main mIRC window.
ImageToolbar Image to use for toolbar.
ImageButtons Image to use for toolbar buttons.
ImageSwitchbar Image to use for switchbar.

Miscellaneous options in an MTS file

Prefix This value is simply used for %::pre and <pre>, so that a common prefix does not need to be rewritten on every event.
ParenText This special value is used to surround part, quit, and kick messages with parenthesis. If not present, a script should use "(<text>)" for this. Whenever a part, quit, or kick occurs, <text> will contain the normal text, and <parentext> will use this. However, <parentext> will be blank if there is no message. This usage prevents events from showing empty parenthesis if there is no message.
Timestamp Set to ON or OFF. Can be removed from a theme file so as to not affect the timestamp setting, or a script can ignore this setting in a theme.
TimestampFormat mIRC's /timestamp format is set to this. Note that a script should reset this on startup, because if it contains colors then mIRC will remove them on startup.

A themer can also use the special <timestamp> variable to put a timestamp anywhere in a line they want. The theme engine should always set the %::timestamp variable when $theme.text is called.
Script This item contains the filename of a mIRC script to load as part of the theme. This file should contain all aliases used in !Script lines. This file should be loaded using /load -rs, as it is a script file, not an alias file.
Scheme1
Scheme2
etc...
These lines contain names of color schemes that the theme contains. See chapter 9 for details on this optional feature.

Chapter 7 - MTS File Format - Events and Raws

All possible theme events, and all common raws, are listed below. A script is not required to use all events, but most should be used for full effect. Note that if an event or raw is missing, a script should use some sort of default display. A missing event or raw does NOT mean to hide that event or raw.

Whenever an event or raw refers to a variable in %::var format, remember that the same value will be in <var> format when processing normal theme lines. Note that only some %::vars are mentioned- others like %::nick are assumed.

Text IRC events

TextChan Standard text in a channel.
TextChanSelf Your text in a channel.
ActionChan Action performed in a channel.
ActionChanSelf You perform an action in a channel.
NoticeChan You receive a channel or op notice. Note that %::target will contain @#channel for an op notice.
Notice You receive a private notice.
NoticeSelf You send a private notice.
NoticeSelfChan You send a channel or op notice. The script should put either #channel or @#channel into %::target to clarify.
TextQuery Private message in a query or chat window.
TextQuerySelf You send a message in a query or chat window.
ActionQuery Action performed in a query or chat window.
ActionQuerySelf You perform an action in a query or chat window.
TextMsg You receive a private message, displayed in active or dedicated messages window.
TextMsgSelf You send a private message, displayed in active or dedicated messages window.

Basic IRC events

Mode Channel mode change. %::modes has full mode string.
ModeUser You change usermodes. %::modes has full mode string.
Join Another user joins a channel.
JoinSelf You join a channel.
Part Another user parts a channel. %::text has part message, if any. %::parentext will contain the message with parenthesis, if any (see ParenText, chapter 6).
Kick Another user is kicked. %::text has kick message.
KickSelf You are kicked. %::text has kick message. Both this and Kick should place the message, if any, into %::parentext with parenthesis (see ParenText, chapter 6).
Quit A user quits IRC. %::text has quit message, if any. This event will be called once for each place it appears (usually, once for each channel the user was in). %::parentext will contain the message with parenthesis, if any (see ParenText, chapter 6).
Topic Topic changed in a channel. %::text has new topic.
Nick Your or another user changes nickname. This event will be called once for each place it appears (usually, once for each channel the user was in).
NickSelf This appears in status when you change nickname. The Nick event will be used for each channel, also.
Invite You are invited to another channel.
ServerError The server reports an error. This is equivalent to the ERROR event in mIRC. %::text has full error string.
Rejoin You attempt to rejoin a channel.
Ctcp You receive a CTCP. %::ctcp contains the CTCP command (one word) and %::text contains any additional CTCP text.
CtcpChan You receive a CTCP on a channel. %::ctcp contains the CTCP command (one word) and %::text contains any additional CTCP text. %::chan will contain the channel it was received on.
CtcpSelf You send a CTCP. %::nick will contain whom it was sent to. %::ctcp and %::text work like CTCP.
CtcpChanSelf You send a CTCP to a chan. %::chan will contain where it was sent to. %::ctcp and %::text work like CTCP.
CtcpReply You receive a CTCP reply. %::ctcp contains the CTCP reply (one word) and %::text contains any additional reply text. %::chan will contain the channel it was received on, if any.
CtcpReplySelf You send a CTCP reply. Not all scripts use this when sending replies. %::chan or %::nick (but not both) will contain whom it was sent to. %::ctcp and %::text work like CTCPREPLY.
Notify A user on your notify list is on IRC. %::text contains any notify note.
UNotify A user on your notify list has left IRC. %::text contains any notify note.
Wallop A wallop, contained in %::text.
NoticeServer A server notice, contained in %::text. %::nick will contain the server that sent the notice, which may differ from %::server.

Non-IRC events

These events are not directly related to an IRC connection.

DNS Displayed when you start a /dns request. Either %::nick or %::address (but not both) will contain what you are /dns'ing, as appropriate.
DNSError A /dns request has failed. One of the following will be true:
  1. Only %::nick is filled. You tried to /dns a user that was not found.
  2. Only %::address is filled. You tried to /dns an address and failed.
  3. Both are filled. You tried to /dns a user and failed, but the user was online.

If %::address is filled, either %::iaddress or %::naddress will also be filled, but this isn't usually used.

DNSResolve A /dns request has been resolved. %::nick will contain a nickname if appropriate. %::address, %::naddress, %::iaddress, and %::raddress will all be filled.
Echo Used for anything a script wants to display. %::text contains the actual text to display.
EchoTarget Used for anything related to or displayed in a channel. %::chan contains the channel, %::text contains the actual text.
Error Used for any error messages a script displays. %::text contains the text to display.
Load Displayed (or run) when the theme is loaded (after any script is loaded and any settings changed).
Unload Displayed (or run) right before the theme is unloaded.

Whois and Whowas raws and events

/whois (and /whowas) replies are handled a little differently in MTS. Each raw is called normally as expected &ndash and if this is enough for a script (displaying the /whois line-by-line) then nothing more is needed. Some themes, however, like to wait until the entire whois reply is collected and then display it, for formatting purposes. In this case, leave the /whois raws blank, and add Whois and Whowas events. These will be called after the data for a full /whois or /whowas is collected. Since a /whois may reply on multiple nicknames, this event will either be called right before the end of whois raw (RAW.318) or right before the start of the next whois (RAW.311). Most themes will use either the line-by-line raw method, or the Whois method &ndash but a theme is allowed to use both if it needs to for any reason.

If a theme does not have a Whois or Whowas event, then a script should use default /whois or /whowas behavior if the raws are also not present. Otherwise, hide output even if a specific /whois or /whowas raw is not found.

Note that any unrecognized raws seen between RAW.311 and RAW.318 should be treated as part of a /whois, and stored in or appended to %::text. This isn't a requirement, but suggested for ideal /whois operation (if not done, %::text will be blank in the WHOIS or WHOWAS event).

RAW.311 Start of whois &ndash %::nick, %::address, %::realname.
RAW.314 Start of whowas &ndash %::nick, %::address, %::realname.
RAW.319 Channels &ndash %::chan. This raw may occasionally appear multiple times per nick. %::chan will contain -all- channels in the final WHOIS event.
RAW.312 Server &ndash %::wserver, %::serverinfo (in a whowas, %::serverinfo often contains signoff time).
RAW.301 Away &ndash %::text.
RAW.307 Registered nick &ndash %::isregd.
RAW.313 IRCop &ndash %::isoper, %::operline.
RAW.317 Idle/signon &ndash %::idletime, %::signontime.
RAW.318 End of whois &ndash %::nick will contain the nickname or nickname(s) that were /whois'ed.
RAW.369 End of whowas &ndash %::nick will contain the nickname or nickname(s) that were /whowas'ed.
Whois Display whois &ndash Called right before 318 (or 311 in a multi-user whois).
Whowas Display whowas &ndash Called right before 369 (or 314 in a multi-user whowas).

Other raws

This is not a comprehensive list of raws. ANY raw can be listed in a theme. Simply use RAW.nnn, where nnn is the three digit raw number. If a raw is not found, RAW.OTHER should be used, if present. If not, the script can display the raw however it pleases. If you wish to hide the output from a raw, you should just write "!Script" for the event, with nothing to run. This will essentially "do nothing".

Any raw not listed here should have $2 in %::nick and %::chan, $3 in %::value, and $3- in %::text if $2 is a nickname or channel, or $2 in %::value and $2- in %::text otherwise.

Note that if a raw only uses ONE of %::value, %::nick, or %::chan, then the script is allowed to place the SAME VALUE in all three, for simplicity. A theme should not rely on this behavior.

RAW.001 Welcome to IRC.
RAW.002 Server and version &ndash %::server (this is always set anyways) and %::value.
RAW.003 Server created on &ndash %::value.
RAW.005 Protocols supported by server &ndash %::text.
RAW.221 Current usermode &ndash %::nick, %::modes.
RAW.250 Total connections &ndash %::value.
RAW.251 Users, invisible, servers &ndash %::users, %::text, %::value.
RAW.252 Operators &ndash %::value.
RAW.253 Unknown connections &ndash %::value.
RAW.254 Number of channels &ndash %::value.
RAW.255 Local clients, servers &ndash %::users, %::value.
RAW.265 Local users, max &ndash %::users, %::value.
RAW.266 Global users, max &ndash %::users, %::value.
RAW.302 Userhost &ndash %::nick, %::address, %::value. Called once for each user in the userhost (value contains + for here, - for away, and also contains a * for an ircop).
RAW.315 End of /who &ndash %::value contains exactly what was /who'd.
RAW.324 Channel modes &ndash %::chan, %::modes.
RAW.332 Channel topic &ndash %::chan, %::text.
RAW.333 Topic set by and when &ndash %::chan, %::nick, %::text.
RAW.341 User was invited &ndash %::nick, %::chan.
RAW.352 /who data &ndash %::nick, %::address, %::cmode, %::away, %::chan, %::wserver, %::realname, %::value, %::text, %::isoper
(nick, address, cmode, chan, wserver, realname, and isoper are exactly like a /whois. away is H for here and G for gone. value is number of hops. text is the entire line, so the script can parse it manually if desired).
RAW.353 Channel names list &ndash %::chan, %::text.
RAW.366 End of names list &ndash %::chan.
RAW.372 Message of the day &ndash %::text.
RAW.375 Begin message of the day.
RAW.376 End message of the day.
RAW.391 Time/date at server &ndash %::text.
RAW.401 No such nickname &ndash %::nick.
RAW.403 No such channel &ndash %::chan.
RAW.404 Unable to send message &ndash %::chan.
RAW.421 Invalid command &ndash %::value.
RAW.433 Nickname in use &ndash %::nick.
RAW.471 Channel full &ndash %::chan.
RAW.473 Channel invite only &ndash %::chan.
RAW.474 Banned from channel &ndash %::chan.
RAW.475 Channel key required &ndash %::chan.
RAW.482 Not opped &ndash %::chan.
RAW.Other Used for any raw not found in the theme.

Chapter 8 - MTS File Format - Sounds (Optional)

This chapter describes a method of adding sound events to a theme. Support for this in a script is entirely optional. Scripts are encouraged to have their own sound events not listed here.

Sounds can be defined for events by simply making another line in the theme in the form of:

SndEventName filename.wav

"EventName" should match a MTS event or a mIRC event or command, if possible. An event that matches an IRC event affecting you should include the "Self" suffix. Some more commonly used sound events:

SndNotice SndJoin SndJoinSelf SndPart SndPartSelf SndKickSelf
SndOpSelf SndDeopSelf SndBanSelf SndInvite SndNotify SndUNotify
SndError SndStart SndConnect SndDisconnect SndOpen SndDCC
SndDialog SndAway SndBack SndPager

Ideally, the theme engine should determine the type of file the theme is trying to play (whether mid, mp3, or wav), and use the appropriate command. MTS does not standarize on a sound format. The simplest way to implement sounds is to add a line in /theme.text that checks for SndEventName and if it exists, play the sound. This will not catch many of the more common events, however, such as SndOpen or SndConnect. This is up to scripter preference.

Chapter 9 - MTS File Format - Schemes (Optional)

This chapter describes a method of supporting multiple color sets in a theme, hereafter referred to as "schemes". Support for this in a script is entirely optional. Themes do not need to contain any schemes.

The concept of schemes is to allow a theme to have a few things that change for each scheme, and let the rest remain the same across all schemes. Usually, the items changing will be Colors, RGBColors, and similar items, but this is not required. For example, a theme could contain a "red" scheme, a "blue" scheme, and a "green" scheme, which would contain different Colors lines; however, everything else would remain the same.

Schemes prevent having to create entire new themes just to change minor things such as colors.

For each scheme included in a theme, you need to add a SchemeN line to the main theme section, containing a description or name for that scheme. Then, add a [schemeN] section to the theme containing all items that are changing in that scheme. Here is a short example:

[mts]

Name This is an example theme.

MTSVersion 0.97



; (normal theme lines would go here)



; We include a default colors line for scripts that

; don't support schemes.

Colors 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2



; These are our schemes

Scheme1 Red

Scheme2 Green



[scheme1]

; Colors for the 'Red' scheme

Colors 8,7,6,5,4,3,2,1,8,7,6,5,4,3,2,1,8,7,6,5,4,3,2,1,8,7



[scheme2]

; Colors for the 'Green' scheme

Colors 9,1,6,5,4,7,3,2,3,5,1,3,5,9,3,8,4,5,2,7,3,2,4,1,0,5



; We also change the prefix for this scheme

Prefix [*]



; (end of file)

When a script (that supported schemes) were to load this theme, it would first load everything in the [mts] section. Then, it would grab all of the scheme names from the SchemeN lines, and prompt the user for the scheme to load. Then, it would load the associated [schemeN] section, overriding anything in the original theme.

Note how the theme includes a Colors line in the main section. This is so that a script that doesn't support schemes will still load the theme properly.

Chapter 10 - A Sample Theme File


;------------ultra.mts-------------File start:-----

[mts]

Name Ultra

Author Variant

Email variant@variantrealities.com

Description Ultra is a lightweight, sleek, dark, blue theme.

Version 1.0

MTSVersion 1.0



Load <pre> Ultra theme loaded.

Unload <pre> Unloading Ultra theme...



Prefix 2ù12x2ù

Timestamp OFF

TimestampFormat [HH:nn]

ParenText (<c3><text><c1>)



Mode <pre> <c1>Mode(<c2><chan><c1>) [<c3><modes><c1>] by: <nick>

ModeUser <pre> <c1>Mode(<c2><nick><c1>) [<c3><modes><c1>]

Join <pre> <c1>Join(<c2><chan><c1>) <nick>[<c3><address><c1>]

JoinSelf <pre> <c1>Joined <c2><chan>

Part <pre> <c1>Part(<c2><chan><c1>) <nick>[<c3><address><c1>] <parentext>

Kick <pre> <c1>Kick(<c2><chan><c1>) <knick>[<c3><kaddress><c1>] by: <nick> <parentext>

KickSelf <pre> <c1>You were kicked by: <nick>[<c3><address><c1>] on <c2><chan><c1> <parentext>

Quit <pre> <c1>Quit <nick>[<c3><address><c1>] <parentext>

Topic <pre> <c1>Topic(<c2><chan><c1>) [<c3><text><c1>] by: <nick>

Nick <pre> <c1>Nick <nick>[<c3><addres>s<c1>] is now known as <newnick>

NickSelf <pre> <c1>You're now known as <newnick>

Invite <pre> <c1>Invite(<c2><chan><c1>) by: <nick>

ServerError <pre> <c1>Error: <c2><text>

Notice <c2>-<nick>-<c1> <text>

NoticeSelf <c1>ù<gt> <c2>-<nick>-<c1> <text>

Rejoin <pre> <c1>Rejoining <c2><chan><c1>...

TextChan <c4>[<c1><cmode><c3><nick><c4><gt> <text>

TextChanSelf 12[<c2><cmode><c2><me>12<gt> <text>

ActionChan * 03<cmode><nick> <text>

ActionChanSelf * 03<cmode><me> <text>



DNS <pre> <c1>Looking up <c3><nick><address><c1>...

DNSError <pre> <c1>Unable to resolve <c3>(<address>)<c1>.

DNSResolve <pre> <c1>Resolved <c3><address> <c1>to <c3><raddress>



TextQuery <c4>[<c3><nick><c4><gt> <text>

TextQuerySelf 12[<c2><me>12<gt> <text>

ActionQuery * <nick> <text>

ActionQuerySelf * <me> <text>

TextMsg <c4>*<c3><nick><c4>* <text>

TextMsgSelf 12-<gt> <c4>*<c3><nick><c4>* <text>



Ctcp <pre> <c2>[<nick>] <c1><ctcp> <c3><text>

CtcpSelf <c1>ù<gt> <c2><nick> 12<ctcp> <c3><text>

CtcpChan <pre> <c2>[<nick>/<chan>] <c1><ctcp> <c3><text>

CtcpChanSelf <c1>ù<gt> <c2><chan> 12<ctcp> <c3><text>

CtcpReply <pre> <c2>[<nick><chan>] <c1><ctcp> reply <c3><text>

CtcpReplySelf <c1>ù<gt> <c2><nick> 12<ctcp> [REPLY] <c3><text>



Whois <pre> <c1>Whois: <nick>[<c3><address><c1>] <realname>

Whowas <pre> <c1>Whowas: <nick>[<c3><address><c1>] <realname>



Echo <pre> <text>

EchoTarget <pre> [<target>] <text>

Error <pre> <text>



RAW.001 <pre> <c1><text>

RAW.002 <pre> <c1>Host: <c2><server> <c1>running version <c2><value>

RAW.003 <pre> <c1>Server created on: <c2><value>

RAW.005 <pre> <c1>Protocols supported by this server: <c2><text>

RAW.250 <pre> <c1>Total connection(s): <c2><value>

RAW.251 <pre> <c1>Users: <c2><users> <c1>Invisible: <c2><text> <c1>Servers: <c2><value>

RAW.252 <pre> <c1>Operator(s) online: <c2><value>

RAW.253 <pre> <c1>Unknown connection(s): <c2><value>

RAW.254 <pre> <c1>Number of channels formed: <c2><value>

RAW.255 <pre> <c1>Local clients: <c2><users> <c1>on <c2><value> <c1>server(s)

RAW.265 <pre> <c1>Local users: <c2><users> <c1>Max: <c2><value>

RAW.266 <pre> <c1>Global users: <c2><users> <c1>Max: <c2><value>

RAW.302 <pre> <c1>Userhost: <c2><nick><c1>[<c3><address><c1>]

RAW.315 <pre> <c1>End of /WHO list for <c2><chan>

RAW.324 <pre> <c1>Modes(<c2><chan><c1>) [<c3><modes><c1>]

RAW.332 <pre> <c1>Topic<c3>(<c2><chan><c1>) is <c3>'<text><c3>'

RAW.333 <pre> <c1>Set by: <c2><nick> <c1>on <c2><text><c1>.

RAW.341 <pre> <c2><nick> <c1>has been invited to <c2><chan>

RAW.352 <pre> <c1><cmode><c2><nick>[<c3><address><c1>] <c1><realname>

RAW.353 <pre> <c2><chan>: <c3><text>

RAW.366 <pre> <c1>End of /NAMES list for <c2><chan>

RAW.375 <pre> <c1>Message of the day:

RAW.372 <c3><text>

RAW.376 <pre> <c1>End of /MOTD command.

RAW.391 <pre> <c1>Date: <c2><value>

RAW.401 <pre> <c1>No such nickname <c2><nick>

RAW.403 <pre> <c1>No such channel <c2><chan>

RAW.404 <pre> <c1>Unable to send message to <c2><chan>

RAW.421 <pre> <c1>Invalid command:<c2> <value>

RAW.433 <pre> <c1>Nickname<c1>(<c2><nick><c1>) is already in use.

RAW.471 <pre> <c1>Can't join <c2><chan> <c3>(its full +l)

RAW.473 <pre> <c1>Can't join <c2><chan> <c3>(its invite only +i)

RAW.474 <pre> <c1>Can't join <c2><chan> <c3>(you're banned +b)

RAW.475 <pre> <c1>Can't join <c2><chan> <c3>(requires key +k)

RAW.482 <pre> <c1>You're not opped on <c2><chan>



RAW.Other <pre> <text>



Colors 1,3,9,5,0,10,3,10,10,12,10,15,5,2,6,0,3,2,12,5,15,1,15,1,15

RGBColors 255,255,255 28,29,89 0,0,168 0,147,0 255,0,0 127,0,0 156,0,156 252,127,0 255,255,0 0,252,0 4,107,191 61,165,250 52,55,170 255,0,255 127,127,127 210,210,210



; Regular text, nickname or channel, highlighted text, and brackets

BaseColors 10,11,14,2



CLineOwner 16

CLineOP 16

CLineHOP 15

CLineVoice 15

CLineRegular 46

CLineMe 16



ClineCharOwner 12.

ClineCharOP 12@

ClineCharHOP 18%

ClineCharVoice 34+



;You can use Font name,size (can be negative to correspond with mIRC

;font size dialog), B (for bold)



FontDefault IBMPC,13

FontChan IBMPC,13

FontQuery IBMPC,13



;Note that this theme does not use images, sounds, or schemes.



;------------ultra.mts-------------File end-----

Chapter 11 - Scripting Notes

Some important notes that apply to the script processing the theme files:

  1. If using $replace to replace text, always replace <text> last, as it might contain other <codes>. <chan>, <ctcp>, <away>, and <realname> should also be replaced as late as possible, as they could also contain <codes>. Note that there are ways to process theme lines that do not have this limitation, but $replace is the simplest to code.
  2. To allow the use of < and > in a theme line, a script must replace <lt> with < and <gt> with >. If using $replace, you should do this last- after everything else. It's possible for text already replaced to contain these values, but this is an unavoidable side effect- worse side effects could occur if replaced earlier.
  3. When setting %::variables, you should probably use /set -u so the variables unset automatically. Be careful with /whois variables, as you will need to have them properly set for the final WHOIS event as well. (you may wish to store them in a more permanent location until that event)
  4. When setting %::value, %::nick, and %::chan in a raw event, you can set all three to the same value if you're not sure which one applies for a given raw, as the important value is usually in $2. You SHOULD NOT do this for any raw that uses more than one of these variables. A theme should not rely on a script doing this.
  5. <variables> are written with those characters to better support future expansion and avoid conflicts that could be caused by other methods of writing variables.
  6. A script is free to define it's own <variables>, events, settings, etc. Other scripts should ignore lines in a theme file that it does not recognize. If possible, a script should also remove <variables> it doesn't recognize, but this is not required behavior.
  7. Remember to reset /timestamp when mIRC starts, as otherwise any control codes will be removed.
  8. When reading a !Script line, be sure to $eval() it, not just run the command as-is. This allows for single-line scripting without having to create separate aliases. For example, the following line should work, and will work properly if you simply use $eval() on the line when running it:
    TextChan !Script %:echo ( $+ $lower(%::nick) $+ ) %::text
  9. When loading a theme, remember to use /loadbuf or some other method that only gets the [mts] section. Even if you don't actually support schemes, this will make sure you don't accidentally load settings from one.
  10. If your script supports schemes, make sure to load the scheme lines (overriding any parts of the theme) before handing SCRIPT and LOAD lines, just in case they are changed by the scheme.
  11. If your script uses %:comments, you should simply add them to the end of a normal text line. There is no <comments> code to replace. !Script should handle %:comments on it's own.
  12. Regular expressions are very powerful. pai has come up with some really great example code on www.mircscripts.org/mts.php for speeding up your engines, so make sure to check it out.
  13. If the channel or nickname returned from the server in an event is *, then the respective %::chan or %::nick should be set to $null.
  14. In an event that sends text to multiple windows (such as Nick and Quit events), remember that the theme ENGINE is what does the looping, not the theme. The theme is only for formatting the text.

Order of items in a Colors line:

Background, Action text, CTCP text, Highlight text, Info text, Info2 text, Invite text, Join text, Kick text, Mode text, Nick text, Normal text, Notice text, Notify text, Other text, Own text, Part text, Quit text, Topic text, Wallops text, Whois text, Editbox, Editbox text, Listbox, Listbox text, Grayed text.

Default mIRC colors for a Colors line:

0,6,4,5,2,3,3,3,3,3,3,1,5,7,6,1,3,2,3,5,1,0,1,0,1,15

Default mIRC RGB values for an RGBColors line:

255,255,255 0,0,0 0,0,128 0,144,0 255,0,0 128,0,0 160,0,160 255,128,0 255,255,0 0,255,0 0,144,144 0,255,255 0,0,255 255,0,255 128,128,128 208,208,208

Important notes for theme files:

  1. A theme alias should never use /halt. Use /return instead.
  2. A theme alias should never modify (or unset) %::variables.
  3. A theme file should not contain the mIRC ON LOAD and ON UNLOAD events. Use the MTS LOAD and UNLOAD events instead.
  4. A theme that contains schemes should still include all settings (that it uses) in the main [mts] section, in case a script that doesn't support schemes tries to load it.
  5. Remember to begin your theme with the [mts] line. This is required so that scripts can ease theme (and scheme) loading (even if your theme or script does not support schemes, all themes must still use this line for compatibility).
  6. Do not worry about %:comments for normal text lines, but when you !Script an event, you should display it. This doesn't apply to raws.
  7. Color codes should ALWAYS BE DOUBLE DIGIT. Although, most people still aren't used to doing this, so a theme engine should IDEALLY try and compensate for a theme that doesn't have double digit color codes and adjust accordingly.
  8. !Script can not be used on ParenText, Prefix, Timestamp, or TimestampFormat (doesn't make sense to do this).
  9. Themes should NOT USE /echo. They should only use %:echo.
  10. <variables> are not to be used on !Script lines - use the correct %::variable instead.
  11. An item in a theme file with no value, such as TextChan by itself, should do nothing. This especially applies to schemes - a scheme should have the capability to override (or remove) a setting in the main theme.

Chapter 12 - Standard MTS Alias Names

The following are required aliases for the theme engine. These are standardized so that addons can easily detect and use an MTS-enabled script.

/theme.text <event>
For calling the theme engine to do the theme text (variables already set)
$mtsversion
Returns the MTS version supported by the theme engine. Can be used by an addon to see if the script supports MTS.
$theme.setting(<setting>)
Returns a line from the theme without any processing.

The following are suggested aliases, that a script will probably want to have.

/theme.load
Loads a theme
/theme.scheme
Changes the scheme used in the theme
/theme.unload
Unloads a theme, returning to default display

Chapter 13 - Future Expansion

Some things that are not included that may be desired in future versions of MTS:

  1. Line separator support - still not sure how this could be implemented in a theme engine. Recommend outputting - as the text for an event. Would be much easier if mIRC supported /linesep -f.

Change Log

9-27-2001: Draft 8.2a changes (Kamek)
No changes to the standard, only minor changes.
  1. Changed format to HTML.
  2. Fixed numerous small errors and typos.
9-24-2001: Draft 8.2 changes (Variant)
  1. Fixed numerous typos, SELFNICK - NICKSELF, SELFKICK, etc. Also there were a couple instances of "send" left, they should have been "self."
  2. Added quite a few more notes to chapter 11, both for scripts, and for themes. Please read it to make sure you haven't made any of these common mistakes.
  3. Added <timestamp> and %::timestamp. Timestamp format is now on the appropriately named TimestampFormat line, and now Timestamp is simply ON or OFF.
  4. MTSVersion is now 1.1 due to the <timestamp> addition.
8-20-2001: Draft 8.1 changes (Variant)
  1. Typo <addres>s fixed in ultra.mts example theme.
  2. Standardized on "Self" instead of "Send" &ndash no point in having both... CtcpSelf instead of CtcpSend, etc.
8-17-2001: Draft 8 changes (Variant)
  1. Fixed typos, <b1> to <c1> etc...
  2. Few other small typos.
  3. Added some wording in some places.
  4. Changed FontStatus to FontDefault.
  5. MTSVersion is now 1.0.

This draft is largely unchanged from draft 7, but it needed a few small tweaks here and there to be called "final".

8-16-2001: Draft 7 changes (pai)
  1. Some reformatting changes, not as extreme as blue-elf but should be a bit more readable now.
  2. Changed "ChanText" to "TextChan". Similar changes for all Text and Action events. All of the events have similar naming schemes now.
  3. Changed %::comments to %:comments. Single-colon variables are those that do not have a corresponding <variable> code.
  4. Moved sound support to it's own chapter, clarified it as optional, added some recommended events.
  5. Readded scheme support as it's own chapter, clarified it as optional.
  6. Themes must contain an [mts] line to allow scheme support to function properly (even scripts/themes not using schemes should include this line).
  7. Clarified BaseColors so themes have a better idea of which colors can or should go there. Sample theme now uses BaseColors.
  8. Changed () addition to usage of ParenText and <parentext>. See %::parentext and chapter 6 for details.
  9. Some other minor corrections.
  10. MTSVersion is now 0.97. This draft will probably become the final draft except for grammatical fixes. MTSVersion 1.0 is still pending.
8-15-2001: Draft 6 changes (Variant)
Too many changes to mention all.
  1. Naming for all events has been updated to be more organized.
  2. .mts files are now recommended to be in the theme's direct