Shoutbox

beginner scripter - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: beginner scripter (/showthread.php?tid=90366)

beginner scripter by danlett on 04-26-2009 at 03:41 PM

Hello,

i want to write a script that open a chat window and send a message to the window.

function OnEvent_Initialize(MessengerStart)
{
Messenger.OpenChat('kassaidani@hotmail.com');
ChatWnd.SendMessage("message");
}
function OnEvent_Uninitialize(MessengerExit)
{
}

The debugger says that ChatWnd is not defined. What can I do?


RE: beginner scripter by Jesus on 04-26-2009 at 04:04 PM

You have to define the ChatWnd Object before you can send messages to it.
Luckily this object can be provided by the Messenger.OpenChat() function.

javascript code:
function OnEvent_Initialize(MessengerStart)
{
ChatWnd = Messenger.OpenChat('kassaidani@hotmail.com');
ChatWnd.SendMessage("message");
}
function OnEvent_Uninitialize(MessengerExit)
{
}
it's untested, but it should work.
RE: beginner scripter by danlett on 04-26-2009 at 05:51 PM

Oh thanks. :)