What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Sander112's ContactSay Script

Sander112's ContactSay Script
Author: Message:
CycloneNimrod
New Member
*

Sexy n' Proud

Posts: 4
33 / Male / –
Joined: Nov 2006
O.P. Sander112's ContactSay Script
I wanted to use Sander112's script ContactSay on some of my friends, however, I find that it becomes incredibly annoying and doesnt reset your name back to what it used to be.

I've posted his script here to see if you can find errors (i'm ok at JScript, but not at this level really).

quote:
//İİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ
//SCRIPT MADE BY SANDER (MSN: MSN@GEH-X.NL) (PLEASE DO NOT REMOVE)
//FEEL FREE TO EDIT THIS SCRIPT.
//PLEASE DO NOT REMOVE THIS MESSAGE. HAVE FUN
//İİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ










//--GLOBAL VARS
var orginalname;
var params;
var window;

//--Check for / command
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {
    if(sMessage.charAt(0) == "/"){
        return parseCommands(sMessage,ChatWnd);
    }
    else{
        return sMessage;
    }
}



// Add the /command in command list
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>contactsay</Name>';
            commands+='<Description>Say a message under your contacts name!</Description>';
            commands+='<Parameters/>';
        commands+='</Command>';
    commands+='</ScriptCommands>';
    return commands;
}



// Parse commands
function parseCommands(sMessage,iOriginWnd)
{
    window = iOriginWnd;
    if (sMessage.charAt(0) == '/'){
        if(sMessage.charAt(1) == '/'){
            return sMessage;
        } else {
            var firstSpace = sMessage.search(' ');
            if(firstSpace == -1){
                var command = sMessage.toLowerCase().substr(1);
            } else {
                var command = sMessage.toLowerCase().substr(1, firstSpace-1);
                params = sMessage.substr(firstSpace+1);
            }
            if(params != "") { Debug.Trace("The command \"" + command + "\" with the parameters \"" + params + "\" has been parsed."); }
            else { Debug.Trace("The command \"" + command + "\" has been parsed."); }
            switch(command) {
                case 'contactsay':
        var WndContacts =  iOriginWnd.Contacts;
        if(WndContacts.Count == 1) {
            var e = new Enumerator(WndContacts);
            var Cnt = e.item();
            var CntNm = Cnt.Name;
            var timenc = '1000';
            var timemsg = '600';
            orginalname = Messenger.MyName;
            Messenger.MyName = CntNm;
            MsgPlus.AddTimer('sendmsg', timemsg);
            MsgPlus.AddTimer('namechange', timenc);
            }
                sMessage = '';
                break;
            default:
        }
    return sMessage;
    }
}
}

//Timers
function OnEvent_Timer(sTimerId){
    if(sTimerId == 'namechange'){
    Messenger.MyName = orginalname;
    MsgPlus.CancelTimer('namechange');
    }
    if(sTimerId == 'sendmsg'){
    window.SendMessage(params);
    MsgPlus.CancelTimer('sendmsg');
    }
}

//İİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ
//SCRIPT MADE BY SANDER (MSN: MSN@GEH-X.NL) (PLEASE DO NOT REMOVE)
//FEEL FREE TO EDIT THIS SCRIPT.
//PLEASE DO NOT REMOVE THIS MESSAGE.
//İİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ
11-30-2006 06:11 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Sander112's ContactSay Script - by CycloneNimrod on 11-30-2006 at 06:11 PM
RE: Sander112's ContactSay Script - by Jimbo on 11-30-2006 at 06:15 PM
RE: Sander112's ContactSay Script - by CycloneNimrod on 11-30-2006 at 06:16 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