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

OnEvent_ChatWndSendMessage help
Author: Message:
Rmstn1580
New Member
*

Avatar
title=rand()%alphabet

Posts: 3
34 / Male / –
Joined: Aug 2006
O.P. OnEvent_ChatWndSendMessage help
I'm trying to make a command what you type "!say hello" in the chat window and it will say "hello" or whatever you put after "!say" in a toast window. It isn't working :(. I've tried everything I can think of. Please help.

code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
    var e = Message;
    if(e.substring(0,4) == '!say')
    {
        var x = Message.splice(5);
        MsgPlus.DisplayToast("",x);
    }
       
}

HELP!!!!!!!!!!!!!! :'(:'(:'(:'(:'(
08-05-2006 08:31 AM
Profile E-Mail PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: OnEvent_ChatWndSendMessage help
Your error
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
    {
    var e = Message;
    if(e.substring(0,4) == '!say')
    {
    var x = Message.splice(5);
    MsgPlus.DisplayToast("",x);
    }

    }



Solution
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
var e = Message;
if(e.substring(0,4) == '!say');
{
var x = Message.substring(5);
MsgPlus.DisplayToast("",x);
}
}



My way of doing it
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Message.substr(0,4) == '!say');
    {
        var m = Message.substr(5);
    MsgPlus.DisplayToast('Test', m);
    }
}

This post was edited on 08-05-2006 at 08:49 AM by Felu.
08-05-2006 08:38 AM
Profile E-Mail PM Web Find Quote Report
Rmstn1580
New Member
*

Avatar
title=rand()%alphabet

Posts: 3
34 / Male / –
Joined: Aug 2006
O.P. RE: OnEvent_ChatWndSendMessage help
That got me on the right path. One problem. It's mocking everything I say regardless whether I typed "!say" :| I'm tryin to fix it but I just started WLM Scripting today and before that I wasn't that good with JavaScript :$

Edit: Ahh, I fixed it. You had a semicolon after the if statement. Thanks for the code :)

This post was edited on 08-05-2006 at 08:43 AM by Rmstn1580.
08-05-2006 08:41 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