What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin

[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
O.P. [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin

Please  refer to CookieRevised's reply to [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin as this give proper code.



The rest of this post has been kept for understanding the flow of the thread, the code in it has some flaws and is recommended not to be used, sorry.


A note to script developers:

Because of the StuffPlug Chat Only names feature you will have to use a different method when checking the origin of a received message.

Instead of using:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){//When a message is recieved in a chat window
     if(Origin !== Messenger.MyName){//If the sender's name is not my name
          //Do stuff here
     }
     //Do more here if you like
}

You should use the following code:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind){//When a message is recieved in a chat window
     var WSH = new ActiveXObject("WScript.Shell");
     try{
          var enabled = WSH.RegRead("HKLM\\SOFTWARE\\iAvatars.com\\StuffPlug\\"+Messenger.MyUserId+"\\ChatName");//check id a StuffPlug Registry for Chat Only names exists
          if(enabled === 1){//Check if Chat Only names are enabled
               try{
                    var nick = WSH.RegRead("HKLM\\SOFTWARE\\iAvatars.com\\StuffPlug\\"+Messenger.MyUserId+"\\szChatName");//Test for what the Chat Only name currently is
               }catch(e){//if there is no registry for the Chat Only name
                    var nick = Messenger.MyName;
               }
          }else{//if Chat Only names are _NOT_ enabled
               var nick = Messenger.MyName;
          }
     }catch(e){//if there is no registry for if Chat Only names (ie. StuffPlug is not installed)
          var nick = Messenger.MyName;
     }
     if(Origin !== nick){//If the sender's name is not my name
          //Do stuff here
     }
     //Do more here if you like
}

I do realise this is a little more complex to do, but it will fix this problem that may be effecting your scripts.

Thanks Cookie and deAd for informing me about my mistakes

This post was edited on 01-22-2007 at 06:09 AM by markee.
[Image: markee.png]
01-22-2007 03:05 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:05 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:26 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 03:36 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 03:42 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 03:45 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:11 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:14 AM
RE: RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by deAd on 01-22-2007 at 04:17 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 04:22 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 01-22-2007 at 04:48 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 01-22-2007 at 05:00 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-14-2007 at 10:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-14-2007 at 11:52 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-15-2007 at 12:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-15-2007 at 05:16 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by Deco on 12-16-2007 at 11:30 AM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by CookieRevised on 12-16-2007 at 01:18 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by markee on 12-16-2007 at 01:49 PM
RE: [Fix] Problem with OnEvent_ChatWndRecieveMessage's Origin - by bigbob85 on 12-16-2007 at 10:28 PM


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