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.
//İİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ