Shoutbox

Need help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Need help (/showthread.php?tid=65150)

Need help by Kroko on 08-20-2006 at 10:44 AM

Hello.

I need help to my script.
The script should take the name from the person i chat with.

my code:

code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){

if(Message=="/tagnavn"){

var CntNm = Cnt.Name;

Messenger.MyName = CntNm;
return '';
}


But its only says that the commando not exsist when i press /tagnavn.

Pls help.
RE: Need help by SnuZZer on 08-20-2006 at 10:49 AM

Hi.
That's because Messenger Plus! can't find the commando "/tagnavn" in the commando menu.

code:
function OnGetScriptCommands()
{
    var kommandoer = "<ScriptCommands>";
    kommandoer += "<Command>";
    kommandoer += "<Name>tagnavn</Name>";
    kommandoer += "<Description>Stjæler kontakts navn.</Description>";
    kommandoer += "</Command>";
    kommandoer += "</ScriptCommands>";
    return kommandoer;
}

RE: Need help by ShawnZ on 08-20-2006 at 10:52 AM

quote:
Originally posted by Kroko
But its only says that the commando not exsist when i press /tagnavn.

"{" isn't there for fun...
RE: Need help by mickael9 on 08-20-2006 at 10:53 AM

quote:
Originally posted by Kroko
Hello.

I need help to my script.
The script should take the name from the person i chat with.

my code:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){

if(Message=="/tagnavn"){

var CntNm = Cnt.Name;

Messenger.MyName = CntNm;
return '';
}



But its only says that the commando not exsist when i press /tagnavn.

Pls help.

Hi,
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
    if(Message=="/tagnavn")
    {
        var e     = new Enumerator(ChatWnd.Contacts);
        var Cnt   = e.item(); // Take the first contact
       
        var CntNm = Cnt.Name;
       
        Messenger.MyName = CntNm;
        return '';
    }
} // Missing bracket


function OnGetScriptCommands()
{
    var cmds    = "<ScriptCommands>";
    cmds            += "<Command>";
    cmds                += "<Name>tagnavn</Name>";
    cmds                += "<Description>Steal contact name</Description>";
    cmds            += "</Command>";
    cmds       += "</ScriptCommands>";
    return cmds;
}

:D