Shoutbox

Whatever happened to... - 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: WLM Plus! Help (/forumdisplay.php?fid=12)
+----- Thread: Whatever happened to... (/showthread.php?tid=68331)

Whatever happened to... by DanZie Boy on 11-12-2006 at 08:02 AM

...the reversed text command? Why did that get taken out?


RE: Whatever happened to... by x2zen on 11-12-2006 at 08:30 AM

Do you mean the text replacement feature?


RE: Whatever happened to... by DanZie Boy on 11-12-2006 at 08:32 AM

No, I do mean the reversed text command. /xreverse doesn't seem to work anymore.


RE: Whatever happened to... by x2zen on 11-12-2006 at 08:36 AM

Never heard of it.
I would assume it is a script since the command is a "/x" one.

What version of Messenger and Plus! are you using?
What error do you get?


RE: Whatever happened to... by DanZie Boy on 11-12-2006 at 08:42 AM

Windows Live Messenger version 8.0.0812.00
Messenger Plus! Live version 4.01.0.240

Said error is The command you entered was not recognized. If the message was not meant to be a command, insert a double '//' at its beginning.


RE: Whatever happened to... by x2zen on 11-12-2006 at 08:51 AM

Try going to Plus! -> Preferences -> Scripts
Do you see the Reverse script there?

On a sidenote, why don't you upgrade to Plus! 4.10?


RE: Whatever happened to... by markee on 11-12-2006 at 09:26 AM

code:
function OnEvent_ChatWndSendMessage(ChatWnd,str){
    if (str.charAt(0) == '/'){
        if(str.charAt(1) == '/'){
            return str;
        }else{
            var firstSpace = str.search(' ');
            if(firstSpace == -1){
            var command = str.toLowerCase().substr(1);
            var params = '';
        }else{
            var command = str.toLowerCase().substr(1, firstSpace-1);
            var params = str.substr(firstSpace+1);
        }
        if(params != "") { Debug.Trace("The command \"" + command + "\" with the parameters \"" + params + "\" has been parsed."); }
        else { Debug.Trace("The command \"" + command + "\" has been parsed."); }
        WSH = new ActiveXObject("WScript.Shell")
        switch(command) {
            case 'xreverse':
                var reverse = ""
                var length = str.length+1;
                for(i=1;i<length+1;i++){
                      reverse += str.charAt(length-i);
                  }
                  str = reverse;
            break;
        default:
        }
      }
      return str;
}
function OnGetScriptCommands()
{
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>xreverse</Name>';
            commands+='<Description>'+"Reverse your message"+'</Description>';
            commands+='<Parameters>Message</Parameters>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

This script should work for just the purpose you want it to.  I was too lazy to package it sorry.
RE: RE: Whatever happened to... by CookieRevised on 11-12-2006 at 10:11 PM

quote:
Originally posted by markee
code:
function OnEvent_ChatWndSendMessage(ChatWnd,str){
    if (str.charAt(0) == '/'){
        if(str.charAt(1) == '/'){
            return str;
        }else{
            var firstSpace = str.search(' ');
            if(firstSpace == -1){
            var command = str.toLowerCase().substr(1);
            var params = '';
        }else{
            var command = str.toLowerCase().substr(1, firstSpace-1);
            var params = str.substr(firstSpace+1);
        }
        if(params != "") { Debug.Trace("The command \"" + command + "\" with the parameters \"" + params + "\" has been parsed."); }
        else { Debug.Trace("The command \"" + command + "\" has been parsed."); }
        WSH = new ActiveXObject("WScript.Shell")
        switch(command) {
            case 'xreverse':
                var reverse = ""
                var length = str.length+1;
                for(i=1;i<length+1;i++){
                      reverse += str.charAt(length-i);
                  }
                  str = reverse;
            break;
        default:
        }
      }
      return str;
}


wow, that's an extremely bloated way of doing this though... let me pwn you, whatch and learn (just teasing :p... though as you can see, there is much to optimize):






code:
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage) {
    if (new RegExp(/^\/xreverse\s*(.*)$/i).exec(sMessage) != null)
        return MsgPlus.RemoveFormatCodes(RegExp.$1).split('').reverse().join('');
}
that's all what's needed!!

;)