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

Disable automatic reply
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: RE: Disable automatic reply
NanaFreak, please beware that this won't work. You first set the SentAlready[ChatWnd.Handle] to 0 every time a message is received, even after you have set it to 1.

The correct way would be to do something like this:
code:
var SentAlready = new Array();

function OnEvent_ChatWndCreated(ChatWnd){
    SentAlready[ChatWnd.Handle] = 0; //Set an element when a ChatWnd is opened
}

function OnEvent_ChatWndDestroyed(ChatWnd){
    SentAlready.splice(ChatWnd.Handle, 1); //Delete the element when the ChatWnd is destroyed
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
    if(Message.match("Hey") && SentAlready[ChatWnd.Handle] == 0){
        ChatWnd.SendMessage('Hi ' + Origin + '! Time to chat again :)');
        SentAlready[ChatWnd.Handle] = 1;
    }else{
        ChatWnd.SendMessage(':yay:');
    }
}
See? When a ChatWnd is created, an element in the array is set to 0. When "Hey" is received, that element is set to 1. When the ChatWnd is destroyed, the element is removed. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-06-2007 12:05 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Disable automatic reply - by Jonte135 on 10-06-2007 at 11:16 AM
RE: Disable automatic reply - by NanaFreak on 10-06-2007 at 11:33 AM
RE: RE: Disable automatic reply - by Matti on 10-06-2007 at 12:05 PM
RE: Disable automatic reply - by Jonte135 on 10-06-2007 at 01:12 PM
RE: Disable automatic reply - by Matti on 10-06-2007 at 02:05 PM
RE: Disable automatic reply - by Jonte135 on 10-06-2007 at 06:14 PM
RE: Disable automatic reply - by Matti on 10-06-2007 at 06:38 PM
RE: Disable automatic reply - by Jonte135 on 10-06-2007 at 06:41 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