Shoutbox

Scripting Bug - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Scripting Bug (/showthread.php?tid=70182)

Scripting Bug by a0369 on 01-02-2007 at 05:09 AM

I think I found a bug while I was scripting in Messenger Plus. A part of my script is supposed to check my status and if my status is away any conversation message that is received after that is supposed to get an auto response, problem is that it won't send the message. I check the debugger and it says "ChatWnd" is undefined. Any ideas?


RE: Scripting Bug by NanaFreak on 01-02-2007 at 05:20 AM

would you be able to post your code so that we can have a look at where you might be going wrong?


RE: Scripting Bug by a0369 on 01-02-2007 at 05:24 AM

here's where the error occures

code:
function OnEvent_ChatWndReceiveMessage(chatwin,origin,txt_msg,kind)
{
        var msg_back="";
        switch (Messenger.MyStatus)
        {
            case '6': msg_back="Be aware that I haven't been on my computer for longer than 10 minutes and may not respond!";
            break;
            case '7': msg_back="I'm away and probably won't respond!";
            break;
            default : msg_back="";
            break;
        }
        if (response_text=="")
        {
            if (msg_back!="")
            {
                ChatWnd.SendMessage(msg_back);
            }
        }
        else
        {
            ChatWnd.SendMessage(response_text);
        }
}


RE: Scripting Bug by NanaFreak on 01-02-2007 at 05:26 AM

ok the bug is that ChatWnd.SendMessage.... the ChatWnd part has to be the same as the variable for the function ;)

so it would be chatwin.SendMessage("Message");


RE: Scripting Bug by a0369 on 01-02-2007 at 05:27 AM

ok, I made the change and it worked, I thought that was a global object


RE: Scripting Bug by Chestah on 01-02-2007 at 08:49 AM

quote:
Originally posted by a0369
ok, I made the change and it worked, I thought that was a global object

nope, because you could have many chat windows open at once. It would suck if you only manipulate the chat window that sent the message in each plus! function.
RE: Scripting Bug by roflmao456 on 01-02-2007 at 11:57 PM

maybe you can add in the message to send to all chat windows

"/all *message here*" :D