DevMSN+

酷酷的MSN插件,随心所欲MSN

Messenger Plus! Live - Scripting Documentation

Working with Scripts

From Plugins to Scripts

This document is intended to be read by developers familiar with the old plugin system of Messenger Plus! 3.

溴>



<div id="topbar2"> Messenger Plus! Live -脚本文件< /学>

<div id="header2">
<h2>快来工作与脚本< /氢气>
<h1>快来从插件脚本< / H1的>
< /学>

<p>此文件的用意是阅读由发展商熟悉的旧
插件系统的Messenger Plus! 3 。

这份文件的用意是阅读由发展商熟悉的旧
插件系统的Messenger Plus! 3 。

The old plugins system previously offered by Messenger Plus! has been deprecated and is no longer supported by Messenger Plus! Live. Developers of such plugins are faced with two options when upgrading their old plugins for Messenger Plus Live!:

旧的插件系统以前所提供的即时通讯加!已
推荐,并不再支持Messenger Plus! Live 。发展商
这种插件正面临着两种选择,升级时旧的外挂程式
Messenger Plus生活! :

  • Create a script proxy that will call their old plugin DLL.
  • Recreate their features from scratch in the new Messenger Plus! Live scripting system.

If you're in a hurry, solution 1 may sound appealing so you may want to know that this solution comes with a couple of limitations. First, the scripting API does not give direct access to the old Messenger COM object (from the days of Windows Messenger 4) which means that if your plugin was using the "iMessengerObj" or "oMessenger" parameter of Initialize, it will need to be modified to work in the new system. Also, if your plugin was created with the C/C++ interface (as opposed to the VB interface), you will need to use a DataBloc object to create the structure parameters for functions like ParseCommand.

如果您在匆忙,解决5月1日健全的吸引力,因此您可能想知道
这个解决方案附带的一对夫妇的局限性。首先,脚本API没有给予
直接进入旧Messenger的COM对象(从天的Windows
信使4 )这意味着如果您的插件是使用“ imessengerobj ”或“ omessenger ”
参数的<b>初始化< / b > ,将需要修改工作,在新的
制度。此外,如果您的插件是创造与C / C + +接口(如反对
VB的接口) ,您将需要使用databloc对象创造
结构参数的功能一样的<b> parsecommand < / b > 。

Recreating your features directly in the scripting system may take longer but will bring several new advantages. The main obvious one is the rich API offered by the scripting system compared to the one that was available for plugins. Your script will be able to do much more and with less code. You'll also be able to take advantage of the interface windows feature of Messenger Plus! Live and create windows for your script that will completely blend in Messenger. Nevertheless, if you want to directly load your old plugin DLL, here is how to do it:

重塑您的功能,直接在脚本系统可能需要较长时间,但
会带来一些新的优势。主要明显的,一个是提供丰富的空气污染指数
由脚本系统相比,一个是供插件。你的
脚本将能够做更多与较少的代码。您也可以到
利用的<a href="interface_windows.htm">界面Windows < /一>的特点和Messenger Plus! Live
创建Windows为您的脚本将完全融合在信使。不过,如果
您想要直接载入您的旧插件的DLL ,这里是怎样做:

//Load a C plugin DLL
function LoadPlugin_Dll(DllPath)
{
	if(Interop.Call(DllPath, "Initialize", 8, "", 0) == 1)
		Debug.Trace("The C plugin has been initialized");
}

//Load a VB ActiveX object
function LoadPlugin_VB(ProgId)
{
	var PluginObj = new ActiveXObject(ProgId);
	if(PluginObj)
	{
		if(PluginObj.Initialize(8, "", undefined) == true)
			Debug.Trace("The VB plugin has been initialized");
	}
}

Here is an upgrade listing that will help you make the switch from the old system to the new one.

C/C++ Developers:

Plugins InterfaceScripting SystemAdditional Information
Initialize OnEvent_Initialize
OnEvent_Signin
You should send 8 for the nVersion parameter.
sUserEmail is an empty string when called from OnEvent_Initialize and Email when called from OnEvent_Signin.
iMessengerObj must be null (send 0).
Uninitialize OnEvent_Uninitialize
OnEvent_Signout
None.
Configure OnGetScriptMenu
OnEvent_MenuClicked
Scripts create their own menus with OnGetScriptMenu or the ScriptInfo file. You can create your own "Configure" menu from there.
PublishInfo OnGetScriptCommandsScripts return the list of commands they support in OnGetScriptCommands or specify them in the ScriptInfo file. This information is used for informational purposes only in windows such as the Command Helper. It is the responsibility of scripts to parse every message sent for eventual commands or tags to replace.
ParseCommand OnEvent_ChatWndSendMessageMessenger Plus! Live does not search for specific script commands in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your commands to start with "/x" and gives you much more flexibility for the output.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName should be an empty string.
ParseTag OnEvent_ChatWndSendMessageMessenger Plus! Live does not search for specific script tags in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your tags to start with "!X" and gives you much more flexibility for the output.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName should be an empty string.
ReceiveNotify OnEvent_ChatWndReceiveMessageMessenger Plus! Live does not search for specific markers in messages that are received. Instead, every message is sent to scripts so that they can do their own analysis of the message.
pParam->iConversationWnd must be null (send 0).
pParam->sContactName is set to the Origin parameter of the event.
DisplayToast MsgPlus.DisplayToast
MsgPlus.DisplayToastContact
None.
SetNewName Messenger.MyNameNone.
AddEventEntry MsgPlus.LogEventNone.

Additional note: when calling your old C/C++ plugin, make sure to convert your strings to ANSI if your plugin was not using the Unicode handlers. In JScript, every string is Unicode by default.

Visual Basic Developers:

Plugins InterfaceScripting SystemAdditional Information
Initialize OnEvent_Initialize
OnEvent_Signin
You should send 8 for the nVersion parameter.
sUserEmail is an empty string when called from OnEvent_Initialize and Email when called from OnEvent_Signin.
oMessenger must be undefined.
Uninitialize OnEvent_Uninitialize
OnEvent_Signout
None.
Configure OnGetScriptMenu
OnEvent_MenuClicked
Scripts create their own menus with OnGetScriptMenu or the ScriptInfo file. You can create your own "Configure" menu from there.
GetPublishInfo
GetPublishCommandInfo
OnGetScriptCommandsScripts return the list of commands they support in OnGetScriptCommands or specify them in the ScriptInfo file. This information is used for informational purposes only in windows such as the Command Helper. It is the responsibility of scripts to parse every message sent for eventual commands or tags to replace.
GetPublishTagInfoNoneScripts should create entries in their own menu.
ParseCommand OnEvent_ChatWndSendMessageMessenger Plus! Live does not search for specific script commands in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your commands to start with "/x" and gives you much more flexibility for the output.
oConversationWnd must be undefined.
ParseTag OnEvent_ChatWndSendMessageMessenger Plus! Live does not search for specific script tags in messages sent by the user. Instead, every message is sent to scripts so that they can do their own analysis of the message. This removes the need for all your tags to start with "!X" and gives you much more flexibility for the output.
oConversationWnd must be undefined.
ReceiveNotify OnEvent_ChatWndReceiveMessageMessenger Plus! Live does not search for specific markers in messages that are received. Instead, every message is sent to scripts so that they can do their own analysis of the message.
oConversationWnd must be undefined.
sContactName is set to the Origin parameter of the event.
DisplayToast MsgPlus.DisplayToast
MsgPlus.DisplayToastContact
None.
SetNewName Messenger.MyNameNone.
AddEventEntry MsgPlus.LogEventNone.

See Also

Interop Object, DataBloc Object, JScript's ActiveXObject.

的<a href="ref-interop.htm">的Interop对象< /一> ,
的<a href="ref-databloc.htm"> databloc对象< /一> ,
的<a target="_blank" href="http://msdn2.microsoft.com/en-us/library/7sw4ddf8.aspx">
JScript中的activexobject < /一> 。

  Sponsor

  Links

Scripts文档目录 脚本库 FAQ
copyright devmsn.com