What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Can someone edit this script a little

Can someone edit this script a little
Author: Message:
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. Can someone edit this script a little
code:
/*
        Colorize
    Author Zanfo.Net
    Date August 2008
*/

function OnEvent_Initialize(boh)
{
//    Debug.DebuggingWindowVisible = true;
    Shell = new ActiveXObject("WScript.Shell");
    RegPrimoColore = MsgPlus.ScriptRegPath + "Color1";
    RegSecondoColore = MsgPlus.ScriptRegPath + "Color2";
    try
    {
        primoColore = Shell.RegRead(RegPrimoColore);
        secondoColore = Shell.RegRead(RegSecondoColore);
    }
    catch (Exception)
    {
        Shell.RegWrite(RegPrimoColore, primoColore);
        Shell.RegWrite(RegSecondoColore, secondoColore);
    }
}

var version = 0.6;
var primoColore = 13;
var secondoColore = 58;
var Shell;
var RegPrimoColore;
var RegSecondoColore;


function OnGetScriptCommands()
{
    var ScriptCommands = "<ScriptCommands>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize</Name>";
    ScriptCommands    +=         "<Description>Colorize all you write after</Description>";
    ScriptCommands    +=         "<Parameters>&lt; Write here !&gt;</Parameters>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize_SetThisName</Name>";
    ScriptCommands    +=         "<Description>Colorize your name!</Description>";
    ScriptCommands    +=         "<Parameters>&lt; Write here !&gt;</Parameters>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize_Config</Name>";
    ScriptCommands    +=         "<Description>Configure the numbers of the colours which will be used by Colorize. ONLY 'XX XX' FORMAT!! (use 'default' for default colours)</Description>";
    ScriptCommands    +=         "<Parameters>&lt;first_colour_number second_colour_number&gt;</Parameters>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize_Check</Name>";
    ScriptCommands    +=         "<Description>Displays what colour-numbers are being used</Description>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize_Demo</Name>";
    ScriptCommands    +=         "<Description>Displays what colour-numbers are possible to use</Description>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>Colorize_About</Name>";
    ScriptCommands    +=         "<Description>About !</Description>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    += "</ScriptCommands>";

    return ScriptCommands;
}

function OnEvent_ChatWndSendMessage(ChatWindow, Messaggio)
{
   
   
        var stringaColorata = Messaggio.substr(0);
        stringaColorata = "[c=" + primoColore + "]" + stringaColorata + "[/c=" + secondoColore + "]";
        return stringaColorata;
   
   
    if ((Messaggio.toUpperCase()).indexOf("/COLORIZE_SETTHISNAME ") == 0)
    {
        var stringaColorata = Messaggio.substr(22);
        stringaColorata = "[c=" + primoColore + "]" + stringaColorata + "[/c=" + secondoColore + "]";
        //return stringaColorata;
        Messenger.MyName = stringaColorata;
        return "";
    }

       
    if ((Messaggio.toUpperCase()).indexOf("/COLORIZE_CONFIG ") == 0)
    {
        if (Messaggio.substr(17,7).toUpperCase() == "DEFAULT")
        {
            primoColore = 13;
            secondoColore = 58;
            Shell.RegWrite(RegPrimoColore, primoColore);
            Shell.RegWrite(RegSecondoColore, secondoColore);
            return "";
        }
       
        var temp1 = Messaggio.substr(17, 2);
        var temp2;
       
        if (temp1.indexOf(" ") == -1)
            temp2 = Messaggio.substr(20,2);
        else temp2 = Messaggio.substr(19,2);
       
        if (!isNaN(temp1))
        {
            if (!isNaN(temp2))
            {
                primoColore = parseInt(temp1);
                if (primoColore<0)
                    primoColore = 0;
                if (primoColore>67)
                    primoColore = 67;
                //Debug.Trace(primoColore);   
               
                secondoColore = parseInt(temp2);
                if (secondoColore<0)
                    secondoColore = 0;
                if (secondoColore>67)
                    secondoColore = 67;
                //Debug.Trace(secondoColore);
                   
                Shell.RegWrite(RegPrimoColore, primoColore);
                Shell.RegWrite(RegSecondoColore, secondoColore);

                return "";
            }   
        }
        MsgPlus.PlaySound("Error.wav");
        return "";
    }

    if ((Messaggio.toUpperCase()).indexOf("/COLORIZE_DEMO") == 0)
    {
        var stringa = "";
        for (var i = 0; i<=67;i++)
        {
            stringa += "[c=" + i + "]" + i + " [/c]" ;
        }
        return stringa;
    }

   
    if ((Messaggio.toUpperCase()).indexOf("/COLORIZE_CHECK") == 0)
    {
        return "First Color Number = [c=" + primoColore + "]" + primoColore + "[/c], Second Color Number= [c=" + secondoColore + "]" + secondoColore + "[/c]";
    }
   
    if ((Messaggio.toUpperCase()).indexOf("/COLORIZE_ABOUT") == 0)
    {
        return "Colorize " + version + "  Script made by Zanfo.Net, Enjoy!!";
    }

    return Messaggio;
}

Currently this script colorizes every messege the owner sends in the conversation. Can someone edit it so that it will colorize for both owner and the guy that owner is taling to. Or atleast that it will colorize only for the guy that the owner talks too.

This post was edited on 02-20-2010 at 03:05 PM by Barathrum.
02-20-2010 03:04 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Can someone edit this script a little - by Barathrum on 02-20-2010 at 03:04 PM
RE: Can someone edit this script a little - by billyy on 02-20-2010 at 03:18 PM
RE: Can someone edit this script a little - by matty on 02-20-2010 at 03:41 PM
RE: Can someone edit this script a little - by billyy on 02-20-2010 at 03:58 PM
RE: Can someone edit this script a little - by whiz on 02-20-2010 at 08:49 PM
RE: Can someone edit this script a little - by matty on 02-20-2010 at 09:09 PM
RE: Can someone edit this script a little - by Barathrum on 02-20-2010 at 10:01 PM
RE: Can someone edit this script a little - by djdannyp on 02-20-2010 at 10:05 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