Shoutbox

Help ME - 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: Help ME (/showthread.php?tid=94510)

Help ME by traxrex on 05-03-2010 at 12:01 PM

is This Possible If Yes Can You Tell Me The Code?

I want a command " /setuser ". Usage: /Setuser Name Here
and Add it to user.  Like When u Put "(" user ")" it Comes As (name).
And u can change the name By Doing /setuser With an Other Name.
and The Name Gets Saved For That Email Id


RE: Help ME by matty on 05-03-2010 at 04:01 PM

This makes no sense... are you trying to change your contact's name? If so you cannot do this. Are you trying to change their nickname on your contact list? Not possible. If you are trying to change your own name then you can use /nick.


RE: Help ME by traxrex on 05-04-2010 at 01:42 AM

example : /setuser john (it will not change name Or nickname Just Save The Name John Into Character User)

so i can use /do
Example /do Hello

Output: Hello ((john))


RE: Help ME by matty on 05-04-2010 at 02:04 AM

js code:
var objChatWnd = {};

function OnEvent_ChatWndSendMessage (pChatWnd, sMessage) {
    var m;
    if ((m = /^\/([^\s\/]+)\s*([\s\S]*)$/.exec(sMessage))) {
        switch (m[1].toLowerCase()) {
            case 'setuser' :
                objChatWnd[pChatWnd.Handle] = m[2];
                return '';
            case 'do' :
                return m[2]+' [['+objChatWnd[pChatWnd.Handle]+']]';
        }
    }
    return sMessage;
}

function OnEvent_ChatWndDestroyed (pChatWnd) {
    delete objChatWnd[pChatWnd.Handle];
}

function OnGetScriptCommands () {
    return '<ScriptCommands>'+
        '<Command><Name>setuser</Name><Description>Set\'s the users name for the chat window</Description>'+
        '<Command><Name>do</Name><Description>Appends the name to the message</Description>'+
        '</ScriptCommands>';
}

RE: Help ME by traxrex on 05-04-2010 at 05:50 AM

i m getting an error
Error: Expected '}' (code: -2146827279)
       File: Pr-Rp Script.js. Line: 10.

Help


RE: Help ME by matty on 05-04-2010 at 12:50 PM

Oops. Try again


RE: Help ME by CookieRevised on 05-04-2010 at 06:49 PM

Matty, still a small booboo:

code:
case 'do' :
        return m[2]+' 'objChatWnd[pChatWnd.Handle];
=>
code:
case 'do' :
        return m[2]+' '+objChatWnd[pChatWnd.Handle];

;)



Not exactly sure what he wants either though....

--

I first thought he wanted to append the text "(John)" to John's nickname in a chat window (which is indeed not possible with Plus! scripting)

--

Then I thought he meant he wanted to save a textual shortcut to the chatwindow, so he can write, from another chat window, to this now named chat window. Something like:

Input in a chat with John:
  /setname MyChatWithJohn

Input in a chat with Tom:
  /do hello

Output in chat with John:
  Me says:
  hello (MyChatWithJohn)

--

But now I see you believe he asks for yet something else...
so... :undecided:

RE: Help ME by traxrex on 05-05-2010 at 03:12 AM

thanks but can u make it put [[ before the name set with /setuser and ]] after it


RE: Help ME by CookieRevised on 05-05-2010 at 08:04 AM

code:
case 'do' :
        return m[2] + ' [[' + objChatWnd[pChatWnd.Handle] + ']]';

RE: Help ME by traxrex on 05-06-2010 at 04:04 AM

Thank You Very Much :D