What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Scripting - help with commands (Was: HELP!)

Scripting - help with commands (Was: HELP!)
Author: Message:
TheGuruSupremacy
Full Member
***

Avatar

Posts: 367
Reputation: 19
34 / Male / Flag
Joined: Nov 2006
RE: Scripting - help with commands (Was: HELP!)
quote:
Originally posted by Mattike
quote:
Originally posted by TheGuruSupremacy
quote:
Originally posted by Mattike

The advantage here is that it works for more than one word!

Also with split function works for more than one word
But not when you have "/command" in your actual message, read edited post.

I'm soo slow at editing...

It's improbably that "/command" is in message however
You are right split is not the best way to parse command...However
you can also do this:

code:
function OnGetScriptCommands(){
var commands = "<ScriptCommands>";
        commands += "  <Command>"
        commands += "    <Name>command</Name>"
        commands += "    <Description>TheGuruSupremacy</Description>"
        commands += "  </Command>"
        commands += "</ScriptCommands>"
return commands;}
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if (Message.substring(0,8)=="/command"){
var url="http://www.yoursite.com/index.php?variable=" + Message.substring(8,Message.lenght)
Interop.Call("shell32","ShellExecuteW",0,"open",url,null,null,1)
MsgPlus.DisplayToast("Example",Message.substring(8,Message.lenght))
return "";}}


quote:
Originally posted by Mattike

Therefore, it's more common to use regular expressions. They're harder to understand and learn, but they avoid a lot of problems you can have when using such split() calls.


Yes it's true but is not necessary using regular expressions to parse a command..

This post was edited on 04-01-2007 at 02:00 PM by TheGuruSupremacy.
04-01-2007 01:52 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Scripting - help with commands (Was: HELP!) - by Ashylay on 04-01-2007 at 12:47 PM
RE: HELP! - by TheGuruSupremacy on 04-01-2007 at 12:52 PM
RE: HELP! - by Ashylay on 04-01-2007 at 01:00 PM
RE: HELP! - by TheGuruSupremacy on 04-01-2007 at 01:07 PM
RE: HELP! - by Ashylay on 04-01-2007 at 01:13 PM
RE: HELP! - by TheGuruSupremacy on 04-01-2007 at 01:20 PM
RE: Scripting - help with commands (Was: HELP!) - by Ashylay on 04-01-2007 at 01:25 PM
RE: HELP! - by Matti on 04-01-2007 at 01:26 PM
RE: Scripting - help with commands (Was: HELP!) - by TheGuruSupremacy on 04-01-2007 at 01:28 PM
RE: Scripting - help with commands (Was: HELP!) - by Matti on 04-01-2007 at 01:33 PM
RE: Scripting - help with commands (Was: HELP!) - by Ashylay on 04-01-2007 at 01:35 PM
RE: Scripting - help with commands (Was: HELP!) - by TheGuruSupremacy on 04-01-2007 at 01:52 PM
RE: Scripting - help with commands (Was: HELP!) - by markee on 04-01-2007 at 03:47 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