What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Developers] Script Packager

[Developers] Script Packager
Author: Message:
Marelo
New Member
*


Posts: 3
Joined: Jul 2006
RE: [Developers] Script Packager
No... My script is pretty simple...
No COM's, DLL's, and so on... Just a short .js file...

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    // Função criada por Luiz Gonzaga dos Santos Filho
    // Contato: lfilho@gmail.com
    // TODO: Capitalar as letras após pontuação.
    // Dicas, sugestões - entre em contato!
   
    var substituir= new Array();
    var vetorPalavras = sMessage.split(' ');
       
    substituir['vc'] = 'você';
    substituir['nao'] = 'não';
    substituir['ja'] = 'já';
    substituir['ta'] = 'tá';
    substituir['pq'] = 'porque';
    substituir['qq'] = 'qualquer';
    substituir['q'] = 'que';
    substituir['eh'] = 'é';
    substituir['bao'] = 'bão';
    substituir['sao'] = 'são';
    substituir['tao'] = 'tão';
    substituir['tambem'] = 'também';
    substituir['blz'] = 'beleza';
    substituir['hj'] = 'hoje';
    substituir['mto'] = 'muito';
    substituir['mta'] = 'muita';
    substituir['soh'] = 'só';

    for (i=0; i<vetorPalavras.length; i++) {
        if (substituir[vetorPalavras[i]])
            vetorPalavras[i] = substituir[vetorPalavras[i]];
        if (i == 0 && vetorPalavras[i].charAt(0) != '/' && vetorPalavras[i].substr(0, 4) != 'www.' && vetorPalavras[i].substr(0, 7) != 'http://')
            vetorPalavras[i] = vetorPalavras[i].charAt(0).toUpperCase() + vetorPalavras[i].substr(1);
         else if (inArray(vetorPalavras[i-1].charAt(vetorPalavras[i-1].length - 1), ".?!"))
              vetorPalavras[i] = vetorPalavras[i].charAt(0).toUpperCase() + vetorPalavras[i].substr(1);
    }
   
    return vetorPalavras.join(' ');
}

function inArray(needle, haystack) {
    for (var i = 0; i < haystack.length; i++)
        if (haystack.charAt(i) == needle)
            return true;
    return false;
}


The contents of the generated ScriptInfo.xml is:

code:
<?xml version="1.0"?>
    <ScriptInfo xmlns="urn:msgplus:scripts" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="1.0">
    <Information>
        <Name>TextReplacer+Capititalizer v1.0</Name>
        <Description>Este script torna maiúscula o primeiro caracter de cada frase e substitui palavras como "vc", "tb", "q" por "você", "também" e "que", respectivamente.

Para adicionar novas palavras edite o script em "Opções" -> Aba "Geral" -> Item de menu "Scripts"

Desenvolvido por Luiz Gonzaga dos Santos Filho
Comentários, sugestões, etc: lfilho@gmail.com</Description>
        <AboutUrl>www.luizgonzaga.eti.br</AboutUrl>
    </Information>
</ScriptInfo>


Is there any restrictions on file naming, for example?
As you may noticed my script is is portuguese... So, must I save the file in a diferent format because of the "~^ç" letters?

Thanks!

This post was edited on 07-05-2006 at 01:45 PM by Marelo.
07-05-2006 01:44 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Developers] Script Packager - by Dempsey on 06-28-2006 at 10:24 PM
RE: [Developers] Script Packager - by Three6Mafia on 06-28-2006 at 10:35 PM
RE: [Developers] Script Packager - by XM4ST3RX on 06-28-2006 at 10:39 PM
RE: [Developers] Script Packager - by alexp2_ad on 06-28-2006 at 10:40 PM
RE: [Developers] Script Packager - by upsfeup on 06-28-2006 at 10:44 PM
RE: [Developers] Script Packager - by Lou on 06-28-2006 at 10:53 PM
RE: [Developers] Script Packager - by Three6Mafia on 06-28-2006 at 10:54 PM
RE: [Developers] Script Packager - by Lou on 06-28-2006 at 10:56 PM
RE: [Developers] Script Packager - by Dempsey on 06-29-2006 at 07:21 AM
RE: [Developers] Script Packager - by Felu on 06-29-2006 at 07:42 AM
RE: [Developers] Script Packager - by Dempsey on 06-29-2006 at 07:57 AM
RE: [Developers] Script Packager - by Menthix on 06-29-2006 at 09:03 AM
RE: [Developers] Script Packager - by Mike on 06-29-2006 at 09:15 AM
RE: [Developers] Script Packager - by Dempsey on 06-29-2006 at 09:37 AM
RE: [Developers] Script Packager - by CookieRevised on 06-29-2006 at 09:43 AM
RE: [Developers] Script Packager - by Dempsey on 06-29-2006 at 10:04 AM
RE: RE: [Developers] Script Packager - by CookieRevised on 06-29-2006 at 10:34 AM
RE: [Developers] Script Packager - by Dempsey on 06-29-2006 at 03:06 PM
RE: [Developers] Script Packager - by dramado on 06-30-2006 at 04:53 PM
RE: [Developers] Script Packager - by Mike on 06-30-2006 at 07:08 PM
RE: [Developers] Script Packager - by pollolibredegrasa on 06-30-2006 at 07:17 PM
RE: [Developers] Script Packager - by Dempsey on 07-01-2006 at 09:11 AM
RE: RE: [Developers] Script Packager - by CookieRevised on 07-02-2006 at 01:28 AM
RE: [Developers] Script Packager - by -dt- on 07-01-2006 at 09:29 AM
RE: [Developers] Script Packager - by Marelo on 07-05-2006 at 03:27 AM
RE: [Developers] Script Packager - by Dempsey on 07-05-2006 at 06:32 AM
RE: [Developers] Script Packager - by Marelo on 07-05-2006 at 01:44 PM
RE: RE: [Developers] Script Packager - by CookieRevised on 07-06-2006 at 08:13 AM
RE: [Developers] Script Packager - by Marelo on 07-06-2006 at 01:13 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