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

Detect receiving sound on ChatWndReceiveMessage
Author: Message:
Alfredao
New Member
*


Posts: 3
33 / Male / Flag
Joined: Jun 2011
O.P. Detect receiving sound on ChatWndReceiveMessage
Hello, I never did a script for MsgPlus.

I have a friend who always send-me a "Wooooow!" sound (/swoow), and when he sends I answer with an "af", but doens't matter.

What I'm trying to do is, when i receive a Wooow, automatically asnwer with an "af" or whatever.


This is the script I did.

js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    if(Origin != Messenger.MyName)
    {
        if(Message.search(/Wooooow/) != -1)
        {
            ChatWnd.SendMessage("af");
        }
    }
}

If I receive a message with "Wooooow" I will answer with af automatically but it isn't working when i receive a /swoow.

Someone can help-me?

Thanks and sorry for bad english.

This post was edited on 06-26-2011 at 10:46 AM by Alfredao.
06-26-2011 07:09 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Detect receiving sound on ChatWndReceiveMessage
Not to sure but is the Wooooow in a certain colour?

try:

js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
     if(Origin != Messenger.MyName)
     {
         if(MsgPlus.RemoveFormatCodes(Message.toLower().search(/wooooow/)) != -1)
         {
             ChatWnd.SendMessage("af");
         }
     }
}

That will remove the colour codes before doing the search. It'll also make it all lower case just incase the capitalization is different

This post was edited on 06-26-2011 at 09:29 AM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
06-26-2011 09:29 AM
Profile PM Find Quote Report
Alfredao
New Member
*


Posts: 3
33 / Male / Flag
Joined: Jun 2011
O.P. RE: Detect receiving sound on ChatWndReceiveMessage
Not working.

I tried this.

js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    ChatWnd.SendMessage(MsgPlus.RemoveFormatCodes(Message));
}

Nothing happens when I send /swoow or another sound.
I think its because the sounds.

This post was edited on 06-26-2011 at 10:47 AM by Alfredao.
06-26-2011 10:46 AM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Detect receiving sound on ChatWndReceiveMessage
quote:
Originally posted by Alfredao
I tried this.
js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
    ChatWnd.SendMessage(MsgPlus.RemoveFormatCodes(Message));
}

Do not use such code. It will trigger an infinate loop if it wasn't for the build-in flood checker!

If you want to output the message to check it, you should use the debug window:
js code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) {
    Debug.Trace(Message);
}

However, the sounds (both the build-in ones and custom sounds) will not trigger the ChatWndReceiveMessage event. In other words, you can not do want you want.

This post was edited on 06-26-2011 at 01:37 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-26-2011 01:34 PM
Profile PM Find Quote Report
Alfredao
New Member
*


Posts: 3
33 / Male / Flag
Joined: Jun 2011
O.P. RE: Detect receiving sound on ChatWndReceiveMessage
Alright, thanks.
06-27-2011 02:46 AM
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