Shoutbox

[Request] Font - 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: [Request] Font (/showthread.php?tid=65941)

[Request] Font by Vimto on 09-07-2006 at 05:37 PM

Is it possible to create a script so that when you write it will come out like this eg. ( Hi My NaMe Is JaYdE tUrNeR i LoVe ThIs FoRuM ) thanks


RE: [Request] Font by saralk on 09-07-2006 at 05:58 PM

I am working on it.


RE: [Request] Font by alexp2_ad on 09-07-2006 at 06:04 PM

EDIT:  Damn, sorry, didn't see that saralk. :(  I'll delete mine if you want. :/

It's probably been done in one of the scripts already but sure, here ya go:

code:
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
    if(sMessage.substr(0,8)=='/altcase'){
        sMessage = sMessage.substr(8);
        var newmessage = '';
        var uppercase = false;
        for(i=0;i<sMessage.length;i++){
            var charac = sMessage.charAt(i);
            if(uppercase){
                charac = charac.toUpperCase();
                uppercase = false;
            }
            else{
                charac = charac.toLowerCase();
                uppercase = true;
            }
            newmessage+=charac;
        }
        return newmessage;
    }
    else{
        return sMessage;
    }
}

function OnGetScriptCommands()
{
    var ScriptCommands = "<ScriptCommands>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>altcase</Name>";
    ScriptCommands    +=         "<Description>Alternates the case of the sent message</Description>";
    ScriptCommands    +=         "<Parameters>&lt;message&gt;</Parameters>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    += "</ScriptCommands>";

    return ScriptCommands;
}

There you go. :)

It uses /altcase command to send a message with annoying cases. :P
RE: [Request] Font by Vimto on 09-07-2006 at 06:14 PM

Thanks alot to both of you :D Sorry to be a pain but is there any chance it can work without entering the /altcase command?


RE: [Request] Font by alexp2_ad on 09-07-2006 at 06:23 PM

code:
var altcaseon = new Array();

function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
    if(sMessage == '/altcase'){
        altcaseon[pChatWnd.handle] = !altcaseon[pChatWnd.handle];
        return '';
    }
    else if(sMessage.substr(0,8)=='/altcase'){
        sMessage = sMessage.substr(8);
        var newmessage = '';
        var uppercase = false;
        for(i=0;i<sMessage.length;i++){
            var charac = sMessage.charAt(i);
            if(uppercase){
                charac = charac.toUpperCase();
                uppercase = false;
            }
            else{
                charac = charac.toLowerCase();
                uppercase = true;
            }
            newmessage+=charac;
        }
        return newmessage;
    }
    else if(altcaseon[pChatWnd.handle]){
        var newmessage = '';
        var uppercase = false;
        for(i=0;i<sMessage.length;i++){
            var charac = sMessage.charAt(i);
            if(uppercase){
                charac = charac.toUpperCase();
                uppercase = false;
            }
            else{
                charac = charac.toLowerCase();
                uppercase = true;
            }
            newmessage+=charac;
        }
        return newmessage;
    }
    else{
        return sMessage;
    }
}

function OnGetScriptCommands()
{
    var ScriptCommands = "<ScriptCommands>";
    ScriptCommands    +=     "<Command>";
    ScriptCommands    +=         "<Name>altcase</Name>";
    ScriptCommands    +=         "<Description>Alternates the case of the sent message</Description>";
    ScriptCommands    +=         "<Parameters>&lt;message&gt;</Parameters>";
    ScriptCommands    +=     "</Command>";
    ScriptCommands    += "</ScriptCommands>";

    return ScriptCommands;
}
That will work as before, except entering just /altcase on it's own will turn on or off altcase mode and do it for all messages (in that chat window).

If you REALLY want it for every message, then here you go:

code:
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
        var newmessage = '';
        var uppercase = false;
        for(i=0;i<sMessage.length;i++){
            var charac = sMessage.charAt(i);
            if(uppercase){
                charac = charac.toUpperCase();
                uppercase = false;
            }
            else{
                charac = charac.toLowerCase();
                uppercase = true;
            }
            newmessage+=charac;
        }
        return newmessage;
}


Choose whichever you like. ;)
RE: [Request] Font by Vimto on 09-07-2006 at 06:29 PM

Thanks alot :D:D:D Yey Love you both :)


RE: [Request] Font by saralk on 09-07-2006 at 06:49 PM

quote:
Originally posted by alexp2_ad
EDIT:  Damn, sorry, didn't see that saralk. :(  I'll delete mine if you want. :/

No worries, I started working on it, however, I accidently got into an infinate loop, and then MSN crashed so I went to have dinner, and when I came back, you had finished :P