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>< Write here !></Parameters>";
ScriptCommands += "</Command>";
ScriptCommands += "<Command>";
ScriptCommands += "<Name>Colorize_SetThisName</Name>";
ScriptCommands += "<Description>Colorize your name!</Description>";
ScriptCommands += "<Parameters>< Write here !></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><first_colour_number second_colour_number></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.