What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help - I'm new to scripting!

Help - I'm new to scripting!
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Help - I'm new to scripting!
Do you want the ability to prevent nudging if the script is "disabled" is that the affect you are trying to achieve?

Also I know you are new but you can cut down on some code for example:

jscript code:
// Create an object to store our sent messages
var mySentMessages = {};
var bEnabled = true;

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if (mySendMessages[ChatWnd.Handle] != Message) {
        Debug.Trace("Message received");
        if (Message != '/nudge') {
            if (ChatWnd.Contacts.Count == 1 && bEnabled == true) {
                for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
                    // store the new chat window in a variable
                    var pChat = Messenger.OpenChat(e.item().Email)
                    // check if the chat window's typing area is enabled and the user isn't blocked
                    if (pChat.EditChangeAllowed == true && e.item().Blocked == false) {
                        pChat.SendMessage('/nudge');
                    }
                }
            }
        }
    }
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    mySentMessages[ChatWnd.Handle] = Message; // store the last sent message in an object
}

function OnEvent_ChatWndDestroyed(ChatWnd) {
    delete mySentMessages[ChatWnd.Handle]; // delete the message from the object as it isn't needed anymore
}

/*

Use bEnabled to control whether or not you want the nudge to be sent.
When the user clicks the menu item to disable the script set bEnabled = false; and vice versa when they are enabling it.

*/
11-27-2008 02:29 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help - I'm new to scripting! - by whiz on 11-15-2008 at 03:12 PM
RE: Help - I'm new to scripting! - by matty on 11-25-2008 at 04:31 PM
RE: Help - I'm new to scripting! - by whiz on 11-26-2008 at 08:16 PM
RE: Help - I'm new to scripting! - by matty on 11-26-2008 at 08:23 PM
RE: Help - I'm new to scripting! - by whiz on 11-26-2008 at 09:01 PM
RE: Help - I'm new to scripting! - by matty on 11-27-2008 at 02:29 PM
RE: Help - I'm new to scripting! - by whiz on 11-27-2008 at 07:37 PM
RE: Help - I'm new to scripting! - by matty on 11-27-2008 at 07:38 PM
RE: Help - I'm new to scripting! - by whiz on 12-07-2008 at 11:25 AM
RE: Help - I'm new to scripting! - by Matti on 12-07-2008 at 11:29 AM
RE: RE: Help - I'm new to scripting! - by NanoChromatic on 12-07-2008 at 11:36 AM
RE: Help - I'm new to scripting! - by Matti on 12-07-2008 at 12:26 PM
RE: RE: Help - I'm new to scripting! - by NanoChromatic on 12-07-2008 at 02:08 PM
RE: Help - I'm new to scripting! - by whiz on 12-07-2008 at 04:06 PM
RE: RE: Help - I'm new to scripting! - by Jesus on 12-08-2008 at 12:39 AM
RE: Help - I'm new to scripting! - by whiz on 12-08-2008 at 07:49 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