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

Strange Error
Author: Message:
TheGuruSupremacy
Full Member
***

Avatar

Posts: 367
Reputation: 19
34 / Male / Flag
Joined: Nov 2006
RE: Strange Error
quote:
Originally posted by A06
Hi !
i've a problem with my script...
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
   if (Message.match(/^!massmsg$/))
   {
      MsgPlus.DisplayToast("Mass Message :: Usage","!massmsg <message>");
      return "";
   }
   else if (Message.match(/^!massmsg .+/))
   {
      var strMessage = Message.substr(9);
     Debug.trace(strMessage);
      var Contacts = Messenger.MyContacts;
      var e = new Enumerator(Contacts);
      var Contact = e.item();
      for(; !e.atEnd(); e.moveNext())
      {
         var Contact = e.item();
         if (Contact.Status != 1)
         {
            var ChatWnd2 = Messenger.OpenChat(Contact.Email);
           Debug.trace(strMessage);
            ChatWnd2.SendMessage(strMessage);
         }
      }
       return "";
   }
}

The Error : Erreur : 'null' a la valeur Null ou n'est pas un objet..

~= 'null' egal Null or is not an object.

The line where is signaled the error : ChatWnd2.SendMessage(strMessage);

The both Debug.trace(strMessage) are Ok



Maybe you have added your Address in your contacts list....(i mean that maybe you have added yourself contact...example:if your email is mmm@hotmail.com..you have added a contact with mmm@hotmail.com address...)if it's so...you must change your code like this because you can't send  yourself a message  :
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
   if (Message.match(/^!massmsg$/))
   {
      MsgPlus.DisplayToast("Mass Message :: Usage","!massmsg <message>");
      return "";
   }
   else if (Message.match(/^!massmsg .+/))
   {
      var strMessage = Message.substr(9);
Debug.trace(strMessage);
      var Contacts = Messenger.MyContacts;
      var e = new Enumerator(Contacts);
      var Contact = e.item();
      for(; !e.atEnd(); e.moveNext())
      {
         var Contact = e.item();{
         if (Contact.Email!=Messenger.MyEmail){
         if (Contact.Status != 1)
         {
            var ChatWnd2 = Messenger.OpenChat(Contact.Email);
       Debug.trace(strMessage);
            ChatWnd2.SendMessage(strMessage);
         }}}
      }
       return "";
   }
}



EDIT:MOREOVER PAY ATTENTION THAT A WLM SERVERS HAVE A LIMITATION YOU CAN'T SEND A MESSAGGE TOO YOUR CONTATCS IN A MINUTE.THE SERVER REFUSES IT

This post was edited on 02-22-2007 at 11:24 PM by TheGuruSupremacy.
02-22-2007 11:16 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Strange Error - by A06 on 02-22-2007 at 09:56 PM
RE: Strange Error - by RaceProUK on 02-22-2007 at 10:46 PM
RE: Strange Error - by TheGuruSupremacy on 02-22-2007 at 11:16 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