What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Need help with ChatWnd::SendMessage

Pages: (2): « First [ 1 ] 2 » Last »
Need help with ChatWnd::SendMessage
Author: Message:
Jacen
New Member
*


Posts: 8
Joined: May 2007
O.P. Need help with ChatWnd::SendMessage
Okay, I admit to being new with MSGPLus Live scripts and Jscript itself.

I'm trying to get my script to send a message in the current chat session. I'm looking at the ChatWnd::SendMessage page in the help guide thing but every code piece I try doesn't work, returning errors in the debug window. Can someone give me an example on how to properly do this? Thanks.
05-01-2007 04:23 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Need help with ChatWnd::SendMessage
What code are you using? We cannot help without that.
05-01-2007 04:27 PM
Profile E-Mail PM Web Find Quote Report
Jacen
New Member
*


Posts: 8
Joined: May 2007
O.P. RE: Need help with ChatWnd::SendMessage
code:
function OnEvent_MenuClicked(sMenuId){
*snip*
    if(sMenuId=="mnuItem7"){
*snip*
    ChatWnd.SendMessage("Test");
    }
}

05-01-2007 04:29 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Need help with ChatWnd::SendMessage
Whats "*snip*"? Remove it! Also make sure ChatWnd is defined.
05-01-2007 04:33 PM
Profile E-Mail PM Web Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
RE: Need help with ChatWnd::SendMessage
You must specify what is the ChatWnd like that :

code:
the_wnd=null;

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
  the_wnd = ChatWnd;
}

function OnEvent_MenuClicked(sMenuId){
    if(sMenuId=="mnuItem7"){
the_wnd.SendMessage("Test");
    }
}

Yes and like Felu said, what's "*snips*" ?

This post was edited on 05-01-2007 at 04:37 PM by Huhu_Manix.
05-01-2007 04:35 PM
Profile E-Mail PM Web Find Quote Report
Paril
Junior Member
**

Avatar
Admin of Paril's Projects

Posts: 69
30 / Male / Flag
Joined: Jul 2006
RE: Need help with ChatWnd::SendMessage
He's trying to use ChatWnd when it's undefined from what I can see.

-Paril
05-01-2007 04:36 PM
Profile E-Mail PM Web Find Quote Report
Jacen
New Member
*


Posts: 8
Joined: May 2007
O.P. RE: Need help with ChatWnd::SendMessage
*snips* is where I removed code from the posting that was unrelated to my request.

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
  the_wnd = ChatWnd;
}
Since you defined the_wnd here, does this mean my script can't create a conversation? (It must have recieved one message from my contact?)
05-01-2007 04:44 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: Need help with ChatWnd::SendMessage
quote:
Originally posted by Jacen
code:
function OnEvent_MenuClicked(sMenuId){
*snip*
    if(sMenuId=="mnuItem7"){
*snip*
    ChatWnd.SendMessage("Test");
    }
}



You will have to add all parameters for OnEvent_MenuClicked, not just sMenuId. There is one called OriginWnd, which is the ChatWnd object.
Code:
code:
function OnEvent_MenuClicked(sMenuId, Location, OriginWnd){
*snip*
    if(sMenuId=="mnuItem7"){
*snip*
        if(Location == 2){ // we are in chat window, not in contact list
    OriginWnd.SendMessage("Test");
        }

    }
}

Changes are made in bold.

This post was edited on 05-01-2007 at 04:51 PM by vikke.
4 8 15 16 23 42
05-01-2007 04:48 PM
Profile E-Mail PM Find Quote Report
Paril
Junior Member
**

Avatar
Admin of Paril's Projects

Posts: 69
30 / Male / Flag
Joined: Jul 2006
RE: Need help with ChatWnd::SendMessage
Is the function being called after you set the_wnd? If you tried clicking the menu beforehand it would just crash the script. I forget the function to get a chat window...

-Paril
05-01-2007 04:49 PM
Profile E-Mail PM Web Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: Need help with ChatWnd::SendMessage
quote:
Originally posted by Paril
Is the function being called after you set the_wnd? If you tried clicking the menu beforehand it would just crash the script. I forget the function to get a chat window...

-Paril

Use my code instead, it's how it should be. :-)
4 8 15 16 23 42
05-01-2007 04:52 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On