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

SendMessage
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: SendMessage
quote:
Originally posted by foaly
something like this works:

   
code:
    function OnEvent_ChatWndSendMessage(ChatWnd, sMessage){
    if(sMessage == "^^CurrentMedia"){
    var Message = "/me is now playing "+ Messenger.CurrentMedia ;
    ChatWnd.SendMessage(Message);
    sMessage="";
    return sMessage;
    }
    }



Why do you use the SendMessage and return an empty string and not just return the new string?

Also the script doesn't return anything if the if statement is false

code:
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
  if (sMessage.match(/^\^currentmedia(\s+|$)/i) != null)
  {
    return "/me is now playing " + Messenger.CurrentMedia;
  }
  else
  {
    return sMessage;
  }
}


This post was edited on 07-06-2006 at 10:36 PM by Ezra.
[Image: 1-0.png]
             
07-06-2006 10:32 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
SendMessage - by logie on 07-06-2006 at 10:13 PM
RE: SendMessage - by Dhaya on 07-06-2006 at 10:24 PM
RE: SendMessage - by foaly on 07-06-2006 at 10:25 PM
RE: SendMessage - by Ezra on 07-06-2006 at 10:32 PM
RE: RE: SendMessage - by foaly on 07-06-2006 at 10:35 PM
RE: SendMessage - by Ezra on 07-06-2006 at 10:53 PM
RE: SendMessage - by logie on 07-07-2006 at 12:05 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