What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Problem with my script.

Problem with my script.
Author: Message:
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Problem with my script.
The last 'return "" ' should be outside the brackets, so it works for both when OldName has, and hasn't got a value
You forgot the brackets { } again, this should work:

code:
var OldName = "";

function OnGetScriptCommands(){
   var commands = '<ScriptCommands>';
   commands+='<Command>';
   commands+='<Name>intstealname</Name>';
   commands+='<Description>Steal your contacts name!</Description>';
   commands+='<Parameters/>';
   commands+='</Command>';
   commands+='<Command>';
   commands+='<Name>intoldname</Name>';
   commands+='<Description>Change your name back to the previous name!</Description>';
   commands+='<Parameters/>';
   commands+='</Command>';
   commands+='</ScriptCommands>';
   return commands;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message){
   if(Message.substr(0,13) == "/intstealname"){
      OldName = Messenger.MyName;
      var Contacts = ChatWnd.Contacts;
      var e = new Enumerator(Contacts);
      for(; !e.atEnd(); e.moveNext()){
         var Contact = e.item()
         Messenger.MyName = Contact.Name;
         MsgPlus.DisplayToast("Interpreter 1.0", "You are now interpretating your contact!");
         return '';
      }
   }else if(Message.substr(0,9) == "/intoldname"){
      if(OldName = ""){
         MsgPlus.DisplayToast("Interpreter 1.0", "You dont have an old name!");
      }else{
         Messenger.MyName = OldName;
         MsgPlus.DisplayToast("Interpreter 1.0", "Your name is back to normal!");
      }
      return '';
   }
}

This post was edited on 08-12-2006 at 01:47 PM by Shondoit.
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-12-2006 01:44 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Problem with my script. - by TheTomb on 08-11-2006 at 07:10 PM
RE: Problem with my script. - by matty on 08-11-2006 at 07:12 PM
RE: Problem with my script. - by TheTomb on 08-11-2006 at 07:14 PM
RE: Problem with my script. - by Felu on 08-11-2006 at 07:26 PM
RE: Problem with my script. - by TheTomb on 08-12-2006 at 08:15 AM
RE: Problem with my script. - by vikke on 08-12-2006 at 08:17 AM
RE: Problem with my script. - by TheTomb on 08-12-2006 at 08:20 AM
RE: Problem with my script. - by vikke on 08-12-2006 at 08:23 AM
RE: Problem with my script. - by Eljay on 08-12-2006 at 08:26 AM
RE: Problem with my script. - by Felu on 08-12-2006 at 08:34 AM
RE: Problem with my script. - by vikke on 08-12-2006 at 08:38 AM
RE: Problem with my script. - by TheTomb on 08-12-2006 at 08:39 AM
RE: Problem with my script. - by Felu on 08-12-2006 at 08:42 AM
RE: Problem with my script. - by Eljay on 08-12-2006 at 08:50 AM
RE: Problem with my script. - by TheTomb on 08-12-2006 at 09:05 AM
RE: Problem with my script. - by Shondoit on 08-12-2006 at 01:44 PM
RE: Problem with my script. - by Felu on 08-12-2006 at 02:16 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