What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Help » Whatever happened to...

Whatever happened to...
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Whatever happened to...
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!!

;)

This post was edited on 11-13-2006 at 05:25 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-12-2006 10:11 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Whatever happened to... - by DanZie Boy on 11-12-2006 at 08:02 AM
RE: Whatever happened to... - by x2zen on 11-12-2006 at 08:30 AM
RE: Whatever happened to... - by DanZie Boy on 11-12-2006 at 08:32 AM
RE: Whatever happened to... - by x2zen on 11-12-2006 at 08:36 AM
RE: Whatever happened to... - by DanZie Boy on 11-12-2006 at 08:42 AM
RE: Whatever happened to... - by x2zen on 11-12-2006 at 08:51 AM
RE: Whatever happened to... - by markee on 11-12-2006 at 09:26 AM
RE: RE: Whatever happened to... - by CookieRevised on 11-12-2006 at 10:11 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