What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script Command

Pages: (2): « First [ 1 ] 2 » Last »
Script Command
Author: Message:
Bewwen
New Member
*


Posts: 3
Joined: Mar 2007
O.P. Script Command
Hello..

I tried to make my own command. Like this: /test
It doesnīt matter how I try.. I canīt get this to work..


-------------------------------------------------------------------------

var test1 = 'Hello World!';

function OnGetScriptCommands()
{
    var ScriptCommands = "<ScriptCommands>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>test</Name>";
    ScriptCommands    +=         "<Description>testing</Description>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    += "</ScriptCommands>";

    return ScriptCommands;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{

        <<Some kind of switch>>   (donīt know how)

    switch ("some thing") {
        case "/test": return function();
    }
}

function() {
    ChatWnd.SendMessage(test1);
}


-------------------------------------------------------------------------

can someone explane the switch and how to use it..
and the return when you have typed the "/test".. I am not sure if thatīs correkt either :D


//Bewwen
03-11-2007 08:35 PM
Profile E-Mail PM Find Quote Report
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
RE: Script Command
var test1 = 'Hello World!';

function OnGetScriptCommands()
{
var ScriptCommands = "<ScriptCommands>";
ScriptCommands    +=     "<Command>";
ScriptCommands    +=         "<Name>test</Name>";
ScriptCommands    +=         "<Description>testing</Description>";
ScriptCommands    +=     "</Command>";
ScriptCommands    += "</ScriptCommands>";

return ScriptCommands;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
        switch (Message) {
                case "/test":
                        function foo();
                break;
        }
}
function foo() {
ChatWnd.SendMessage(test1);
}

This post was edited on 03-11-2007 at 08:44 PM by effection.
03-11-2007 08:41 PM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Script Command
code:
var test1 = 'Hello World!';

function OnGetScriptCommands()
{
var ScriptCommands = "<ScriptCommands>";
ScriptCommands    +=     "<Command>";
ScriptCommands    +=         "<Name>test</Name>";
ScriptCommands    +=         "<Description>testing</Description>";
ScriptCommands    +=     "</Command>";
ScriptCommands    += "</ScriptCommands>";

return ScriptCommands;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
switch (Message) {
case "/test":
foo();
break;
}
}
function foo() {
ChatWnd.SendMessage(test1);
}

that should do it ;)

This post was edited on 03-11-2007 at 08:45 PM by NanaFreak.
03-11-2007 08:45 PM
Profile PM Find Quote Report
Bewwen
New Member
*


Posts: 3
Joined: Mar 2007
O.P. RE: Script Command
nope.. same error as before..

It just says that "test" is an unknowned command and that I should use 2 / instead :(

whatīs wrong then?
03-11-2007 09:07 PM
Profile E-Mail PM Find Quote Report
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
RE: Script Command
yes i am getting that error with my new script i have created :( it happens even if i place the commands inside the ScriptInfo.xml file... is it a bug?
03-11-2007 09:12 PM
Profile E-Mail PM Find Quote Report
Bewwen
New Member
*


Posts: 3
Joined: Mar 2007
O.P. RE: Script Command
I have no idea.. but it is not very funny :D
03-11-2007 09:14 PM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Script Command
quote:
Originally posted by effection
yes i am getting that error with my new script i have created :( it happens even if i place the commands inside the ScriptInfo.xml file... is it a bug?
no its not a bug....

also you might want to look here: http://mpwiki.net/Script_Commands
03-11-2007 09:14 PM
Profile PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Script Command
You have to return an empty string with commands, so it will be...
var test1 = 'Hello World!';

code:
function OnGetScriptCommands()
{
var ScriptCommands = "<ScriptCommands>";
ScriptCommands    +=     "<Command>";
ScriptCommands    +=         "<Name>test</Name>";
ScriptCommands    +=         "<Description>testing</Description>";
ScriptCommands    +=     "</Command>";
ScriptCommands    += "</ScriptCommands>";

return ScriptCommands;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
switch (Message) {
case "/test":
foo();
return "";
break;
}
}
function foo() {
ChatWnd.SendMessage(test1);
}
[Image: markee.png]
03-11-2007 10:06 PM
Profile PM Find Quote Report
effection
Full Member
***

Destroy The Runner

Posts: 135
Reputation: 4
– / Male / Flag
Joined: Sep 2006
RE: Script Command
plus has a wiki? haha ooh well i forgot about returning an null sting thanks
03-11-2007 10:24 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Script Command
quote:
Originally posted by effection
plus has a wiki?
Yes its PlusScriptWiki. Its unofficial and doesn't have much on it. I'd say reffering to the Official Scripting Documentation is better. Read the Windows Script 5.6 Documentation(it contains JScript) for any help with learning/understanding JScript :).

This post was edited on 03-12-2007 at 08:47 AM by Felu.
03-12-2007 08:42 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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