What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Debug Please

Debug Please
Author: Message:
::Quick::
New Member
*


Posts: 5
Joined: Dec 2007
O.P. Debug Please
Hi,

I was wondering if someone could please debug a function.

Simply when a message is received, it's supposed to say Test and close the chat window, except it just keeps on sending the same test message every second and it does not close the window.

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
ChatWnd.SendMessage("Test");
PlusWnd.Close(0);
}
12-28-2007 12:28 PM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Debug Please
You need to send the message only when the Origin is not you.

The easiest way to close a chat window is to send "/close" message; alternatively you can call PostMessageW to post WM_CLOSE. Anyway, why did you use PlusWnd? :S

This post was edited on 12-28-2007 at 12:49 PM by Mnjul.
12-28-2007 12:48 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Debug Please
As Mnjul said, you made 2 mistakes:
  • OnEvent_ChatWndReceiveMessage is also called for messages you sent and are "received" in the chat window. Therefore, you should check the Origin: only if the Origin is not your own name, you should send the message "Test".
  • The Close() function is a child of the PlusWnd object. PlusWnds have absolutely nothing to do with ChatWnds. Therefore, the Close() method won't work for a ChatWnd object. The easiest way to close the window then is to send "/close", after checking if you can actually send something by checking if ChatWnd.EditChangeAllowed is true, but in fact you should do that before you send your "Test" message.
Hopefully these hints allow you to fix your problem. :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-28-2007 12:59 PM
Profile E-Mail PM Web Find Quote Report
« 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