quote:
Originally posted by Joereynolds89
where abouts am i suppose to place that script in his? as using it on its own shows command not, and if putting it where i think it goes in his, i also get no command found sorry
If your editng the script with the code posted above, the code is wrong. You need to use this instead:
code:
//Initialize the color variables to make them globaly accessable
var color1;
var color2;
function OnconfigEvent_CtrlClicked(Wnd, ControlId)
{
try
{
//try catching the colors from the controls
color1 = Wnd.GetControlText('clr1');
color2 = Wnd.GetControlText('clr2');
}
catch(err)
{
//If it fails for some odd reason Display A Toast to tell the user about it
MsgPlus.DisplayToast("GRADIENTER", "Changing Color Failed");
}
//Close the Config Window
Wnd.Close(1);
}
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
if (sMessage == "/xconfig")
{
CreateConfigWnd();
return "";
}
else
{
return "[c=" + color1 + "]" + sMessage + "[/c=" + color2 + "]";
}
}
function OnEvent_Signin(Email)
{
try
{
//Try reading the colors from the registry
color1 = ReadRegistry("color1");
color2 = ReadRegistry("color2");
}
catch(err)
{
//If anything fails it will default to these colors
color1 = "1";
color2 = "4";
}
}
function OnEvent_Signout(Email)
{
try
{
//Try Writing the colors to the registry
WriteRegistry("color1", color1);
WriteRegistry("color2", color2);
}
catch(err)
{
MsgPlus.DisplayToast("GRADIENTER", "Error saving gradient information");
}
}
function CreateConfigWnd()
{
var configWnd = MsgPlus.CreateWnd("Interface.xml", "Config");
configWnd.SetControlText('clr1', color1);
configWnd.SetControlText('clr2', color2);
}
function WriteRegistry(key, value)
{
var Shell = new ActiveXObject("WScript.Shell");
return Shell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyEmail + "\\" + key, value);
}
function ReadRegistry(key)
{
var Shell = new ActiveXObject("WScript.Shell");
return Shell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyEmail + "\\" + key);
}
Replacing Gradient.js