quote:
Originally posted by TheTomb
I still get
'The command you entered was not recognised'
Hmm... The code i gave works perfectly fine. Can you please post the code you are using?
quote:
Originally posted by vikke
Try
code:
var commands = new String();
commands+='<ScriptCommands>';
commands+='<Command>';
commands+='<Name>interpretate</Name>';
commands+='<Description>Interpretate your contact by stealing their name!</Description>';
commands+='<Parameters>';
commands+='</Parameters>';
commands+='</Command>';
return commands;
That wont work
.
Edit
quote:
Originally posted by -!Felu!-
code:
function OnGetScriptCommands(){
var commands = '<ScriptCommands>';
commands+='';
commands+='interpretate';
commands+='Interpretate your contact by stealing their name!';
commands+='';
commands+='';
commands+='';
return commands;
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if(Message.substr(0,13) == "/interpretate")
{
var Contacts = ChatWnd.Contacts;
var e = new Enumerator(Contacts); for(; !e.atEnd(); e.moveNext())
var Blah = e.item()
Messenger.MyName = Blah.Name;
MsgPlus.DisplayToast("Success!", "You have the same name as your contact!");
return '';
}
}
Use that code
quote:
Originally posted by Eljay
code:
function OnGetScriptCommands(){
var commands = '<ScriptCommands>';
commands+='';
commands+='interpretate';
commands+='Interpretate your contact by stealing their name!';
commands+='';
commands+='';
commands+='';
return commands;
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if(Message.substr(0,13) == "/interpretate"){
for(e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()){
var Contact = e.item()
Messenger.MyName = Contact.Name;
MsgPlus.DisplayToast("Success!", "You have the same name as your contact!");
return '';
}
}
}
Whats the difference Eljay? Just Blah is Contact and ChatWnd.Contacts is defined as Contacts in my code and your code directly uses ChatWnd.Contacts
.