Hello There, Guest! (LoginRegister)

Skinning Documentation

Introduction to Scripting
Getting Started
What's a Messenger Plus! Script?
Scripting Environment
Your First Script
Working with Scripts
From Plugins to Scripts
Packaging your Script
Windows for your Script
Testing your Windows
Objects Reference
Debug Object
Description
Functions
Trace
ClearDebuggingWindow
Properties
DebuggingWindowVisible
Messenger Object
Description
Functions
AutoSignin
Signout
OpenChat
Properties
Version
VersionBuild
ContactListWndHandle
CurrentChats
ReceiveFileDir
MyContacts
MyEmail
MyUserId
MyStatus
MyName
MyPersonalMessage
MyCurrentMedia
MyDisplayPicture
CustomEmoticons
MsgPlus Object
Description
Functions
DisplayToast
DisplayToastContact
CreateWnd
CreateChildWnd
AddTimer
CancelTimer
PlaySound
LockMessenger
LogEvent
RemoveFormatCodes
DownloadFile
UploadFileFTP
LoadScriptFile
ExtractFromZIP
Properties
Version
VersionBuild
ScriptRegPath
ScriptFilesPath
MessengerIsLocked
UILangCode
ChatWnds Object
Description
Functions
Iterator
Properties
Count
ChatWnd Object
Description
Functions
SendMessage
SendFile
AddContact
DisplayInfoMessage
ResetInfoMessage
EditText_GetCurSelStart
EditText_GetCurSelEnd
EditText_SetCurSel
EditText_ReplaceSel
HistoryText_GetCurSelStart
HistoryText_GetCurSelEnd
HistoryText_GetTextRange
Properties
Handle
Contacts
EditText
EditChangeAllowed
ChatLogEnabled
OverrideFmtEnabled
IsMobileChat
Contacts Object
Description
Functions
Iterator
GetContact
Properties
Count
Contact Object
Description
Properties
Email
Network
Status
Name
PersonalMessage
CurrentMedia
Blocked
DisplayPicture
IsFloating
Emoticons Object
Description
Functions
Iterator
GetEmoticon
Properties
Count
Emoticon Object
Description
Properties
Shortcut
Name
PictureFile
PlusWnd Object
Description
Functions
Close
RegisterMessageNotification
GetControlHandle
SendControlMessage
GetControlText
SetControlText
GetElementPos
Button and Checkmark Controls
Button_IsChecked
Button_SetCheckState
Button_SetElementText
ComboBox Controls
Combo_AddItem
Combo_RemoveItem
Combo_GetCurSel
Combo_SetCurSel
Combo_GetItemData
Combo_GetCount
ListBox Controls
LstBox_AddItem
LstBox_GetItemText
LstBox_RemoveItem
LstBox_GetCurSel
LstBox_SetCurSel
LstBox_GetItemData
LstBox_GetCount
ListView Controls
LstView_AddItem
LstView_SetItemText
LstView_GetItemText
LstView_RemoveItem
LstView_GetItemData
LstView_GetCount
LstView_GetSelectedState
LstView_SetSelectedState
LstView_GetCheckedState
LstView_SetCheckedState
LstView_SetItemIcon
Edit and RichEdit Controls
EditBox_SetCurSel
EditBox_ReplaceSel
EditBox_GetCurSelStart
EditBox_GetCurSelEnd
RichEdit_GetTextRange
RichEdit_SetCharFormat
Browser Controls
Browser_GetInterface
Image Elements
ImageElmt_SetImageFile
Properties
Handle
Visible
WindowId
Interop Object
Description
Functions
Call
Call2
FreeDll
GetLastError
Allocate
GetCallbackPtr
DataBloc Object
Description
Functions
GetAt
SetAt
ReadString
WriteString
ReadBSTR
WriteBSTR
ReadWORD
WriteWORD
ReadDWORD
WriteDWORD
ReadInterfacePtr
WriteInterfacePtr
Properties
Size
DataPtr
Events Reference
Messenger Events
OnEvent_Signin
OnEvent_SigninReady
OnEvent_Signout
OnEvent_MyStatusChange
OnEvent_MyNameChange
OnEvent_MyPsmChange
OnEvent_MyMediaChange
OnEvent_ContactSignin
OnEvent_ContactSignout
OnEvent_ContactStatusChange
OnEvent_ContactNameChange
OnEvent_ContactPsmChange
OnEvent_ContactMediaChange
OnEvent_ContactBlocked
OnEvent_ContactUnblocked
OnEvent_ContactListWndCreated
OnEvent_ContactListWndDestroyed
OnEvent_ChatWndCreated
OnEvent_ChatWndDestroyed
OnEvent_ChatWndContactAdded
OnEvent_ChatWndContactRemoved
OnEvent_ChatWndReceiveMessage
OnEvent_ChatWndSendMessage
OnEvent_ChatWndEditKeydown
Messenger Plus! Events
OnEvent_Initialize
OnEvent_Uninitialize
OnEvent_MessengerLocked
OnEvent_MessengerUnlocked
OnEvent_Timer
OnEvent_MenuClicked
OnEvent_EnterPersonalizedStatus
OnEvent_LeavePersonalizedStatus
OnEvent_DownloadFileComplete
OnEvent_UploadFileComplete
OnGetScriptMenu
OnGetScriptCommands
Events Templates
ScriptsCommandTemplate
ToastCallbackTemplate
Interface Windows Events
OnWindowidEvent_Cancel
OnWindowidEvent_Destroyed
OnWindowidEvent_MessageNotification
OnWindowidEvent_CtrlClicked
OnWindowidEvent_ComboSelChanged
OnWindowidEvent_EditTextChanged
OnWindowidEvent_LstBoxSelChanged
OnWindowidEvent_LstBoxDblClicked
OnWindowidEvent_LstViewClicked
OnWindowidEvent_LstViewRClicked
OnWindowidEvent_LstViewDblClicked
OnWindowidEvent_LstViewSelStateChanged
XML Schemas Reference
ScriptInfo File
Information
Examples
Schema Documentation
Interface Windows
Information
Examples
Schema Documentation

Packaging your Script

Having the best script in the world is pretty much useless if you can't share it with other people. Because scripts were designed to be rapidly developed, they were also designed to be rapidly shared. For that reason, Messenger Plus! Live comes with its own script installation mechanism called Script Pack.

A Script Pack is a single file, with a ".plsc" extension, containing all the files and sub directories of your script. Creating such a file is ridiculously easy for simple reason: Script Packs are just and only plain zip files with a different extension. This means that you only need to zip all the files in your script directory (with your favorite zip tool, like Winzip) and replace the ".zip" extension with ".plsc". Only one thing is required to make your zip file a valid Script Pack: a ScriptInfo.xml file.

ScriptInfo.xml is a file placed in the script's directory (along with ".js" files). It is read when the script is loaded or imported and contains several information related to the script such as its name, its description, the menus it displays in Messenger, etc... the file does not need to be created for scripts to run locally, however, its presence is mandatory if the script has to be exported into a Script Pack. A full description of the content of the file can be found in the ScriptInfo Schema Reference, here is however an example of a simple ScriptInfo file that you can use for your script:

<ScriptInfo>      
        <Information>
                <Name>My First Script</Name>
                <Description>This is my first script.</Description>
                <AboutUrl>http://www.msgpluslive.net</AboutUrl>
                <Version>1.00</Version>
        </Information>
</ScriptInfo>

Just copy paste what's above in a new text file, save it in your script's directory and rename it to "ScriptInfo.xml". The xml file can be saved in Unicode (UTF-16) if your language requires it. Now, select all the files in your script's directory, zip them and rename the zip file with a ".plsc" extension (example: rename "My First Script.zip" to "My First Script.plsc"). Your Script Pack is ready to go! to test it, just sign in Messenger and double click on the plsc file you've just created, if you followed the steps above correctly, you will get the "Import Script" window of Messenger Plus! Live. Once the script is imported, it is automatically activated. If a script with the same name already exists in the user's directory, its files are transparently replaced with the new ones (useful for upgrades).

In the XML code specified above, only <Name> is a required element. <Description>, <AboutUrl>, and <Version> can be removed if not needed. To ensure forward compatibility, specify the version of the script in the <Version> element (Messenger Plus! Live 4.20 and later) and not in the <Name> element. This will prevent duplicated copies of the same script from being installed on a user's system (as the name of the script is used to create the corresponding script's directory). It is also highly recommended to specify an <UpdateId> and a <BuildNumber> so that Messenger Plus! can properly notify the users of your script when you release a new version in the public database.

 If you look at the first picture in ScriptInfo Schema Documentation, you'll see that several other elements are also available aside from <Information>. Two of them can be used during import: <OleFiles> and <DotNetFiles>. These are to be used if your script replies on external COM/ActiveX or .NET objects created by yourself or not supposed to come in standard with Windows. Files listed in those two elements will be registered properly in the system when the script is imported. For example, if you created an ActiveX object in VisualBasic for your script called "ExtraFunctionsVB.dll" (loaded with JScript's ActiveXObject object), your ScriptInfo file would have to look like this:

<ScriptInfo>     
        <Information>
                <Name>My First Script</Name>
        </Information>

        <OleFiles>      
          <FileName>ExtraFunctionsVB.dll</FileName>
        </OleFiles>
</ScriptInfo>

If you still have doubts about how to do something in particular in your ScriptInfo.xml file, you can download existing Script Pack files, change their extension to ".zip" and take a look at how the developer of the script created his own ScriptInfo file. Also, remember to always use a good XML editor to create your XML files as a real XML editor can validate your syntax and insure that your elements conform to the specified schema file. This will save you long hours of searching for errors caused by a missing or invalid tag in your XML file.

See Also

Introduction to Scripting, ScriptInfo Schema Reference.