What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Question] Messenger Plus! Commands

[Question] Messenger Plus! Commands
Author: Message:
Plan-1130
Full Member
***

I keep askin' myself: why?

Posts: 142
73 / Male / –
Joined: Feb 2005
RE: [Question] Messenger Plus! Commands
It's because you didn't return anything, the code below should fix it...
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
     if (Message.charAt(0) == "/") {
          if (Message.charAt(1) == "/") {
               return Message;
          }else{
               if (Message.charAt(6) == " ") {
                   if (Message.charAt(7) != "") {
                         Shell.ShellExecute(Message.substr(7));
                         return "";
                   }
               }
          }
     }
}

Remember there might be malicuous contacts in your list who can abuse it and therby doing harmful things to you or your computer (if not, contactlists like urs are very rare, try posting a flooder here)
Also, your script seems to check for a lot of things, but it gets executed if you type "/blahh notepad" too.
A shorter, and better code would be:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
     if (Message.substr(0,6) == "/shell ") {
          if (Message.substr(7) != "") {
               Shell.ShellExecute(Message.substr(7));
               return "";
          }
     }
}

And, I prefer to put a return before every bracket instead of putting it right behind the functionname or loop, it's up to you to decide what you think works easier, compare the previous one to thisone:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
     if (Message.substr(0,6) == "/shell ")
     {
          if (Message.substr(7) != "")
          {
               Shell.ShellExecute(Message.substr(7));
               return "";
          }
     }
}


This post was edited on 10-28-2006 at 12:33 AM by Plan-1130.
My Scripts: UltimatFlooder, Advanced PSM Chat, PlusPrivacy, PlusRemote

[Image: Plan-1130.png]
10-28-2006 12:02 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Question] Messenger Plus! Commands - by Sana on 10-27-2006 at 11:03 PM
RE: [Question] Messenger Plus! Commands - by pollolibredegrasa on 10-27-2006 at 11:16 PM
RE: [Question] Messenger Plus! Commands - by Spunky on 10-27-2006 at 11:20 PM
RE: [Question] Messenger Plus! Commands - by Baggins on 10-28-2006 at 12:00 AM
RE: [Question] Messenger Plus! Commands - by Plan-1130 on 10-28-2006 at 12:02 AM
RE: RE: [Question] Messenger Plus! Commands - by Baggins on 10-28-2006 at 12:18 AM
RE: [Question] Messenger Plus! Commands - by Sana on 10-28-2006 at 12:35 AM
RE: [Question] Messenger Plus! Commands - by Spunky on 10-28-2006 at 07:42 AM
RE: [Question] Messenger Plus! Commands - by Plan-1130 on 10-29-2006 at 02:08 AM


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