What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » removing emotions?

removing emotions?
Author: Message:
xsylvain2
Junior Member
**

Avatar
MsgPlus! For Evermore

Posts: 17
50 / Male / –
Joined: Feb 2007
RE: removing emotions?
quote:
Originally posted by effection
well im having trouble removing emotions from messages sent to me.

I have code that detects all the default emoticons and custom ones as well, i then call
code:
Message = Message.replace(data, " ");
which replaces the  emoticon shortcut code in the incoming message fine when printed to the Debug output but in the actual chat window the emoticon is still there. Any ideas why this isn't working or why it maybe cant be done?

thanks.


To remove emoticon :

code:
function RemoveEmoticons(Text) {
    // very dodgy routine, this needs to be made better (and custom emoticons need to be included too ;))
    var DefIcons = new Array(
    '8o\\|', '8\\-\\)', ':[\\-]?D', ':[\\-]?O', ':[\\-]?P', ':[\\-]?S', ':[\\-]?\\$', ':[\\-]?\\(', ':[\\-]?\\)',
    ':[\\-]?\\@', ':[\\-]?\\[', ':[\\-]?\\|', ':\\-\\#', ':\\-\\*', ':\\^\\)', ':[\\-]?\\>', ':[\\-]?\\<',
    '\\(AP\\)', '\\(AU\\)', '\\(A\\)', '\\(BAH\\)', '\\(BRB\\)', '\\(B\\)', '\\(CI\\)', '\\(CO\\)', '\\(C\\)',
    '\\(D\\)', '\\(E\\)', '\\(F\\)', '\\(G\\)', '\\(H5\\)', '\\(H\\)', '\\(IP\\)', '\\(I\\)', '\\(K\\)',
    '\\(LI\\)', '\\(L\\)', '\\(MO\\)', '\\(MP\\)', '\\(M\\)', '\\(N\\)', '\\(NAH\\)', '\\(O\\)', '\\(PI\\)',
    '\\(PL\\)', '\\(P\\)', '\\(R\\)', '\\(SN\\)', '\\(SO\\)', '\\(ST\\)', '\\(S\\)', '\\(TU\\)', '\\(T\\)',
    '\\(UM\\)', '\\(U\\)', '\\(W\\)', '\\(XX\\)', '\\(X\\)', '\\(YN\\)', '\\(Y\\)', '\\(Z\\)', '\\(\\&\\)',
    '\\(\\*\\)', '\\(\\@\\)', '\\(\\^\\)', '\\(\\{\\)', '\\(\\}\\)', '\\(\\~\\)', '\\+o\\(', '\\^o\\)', '\\|\\-\\)');
        for (var i in DefIcons) {
        //Debug.Trace('Going through... ' + i + ' => ' + DefIcons[i]);
        Text = Text.replace(eval('/' + DefIcons[i] + '/ig'), "");
    }
    return Text.replace(/\s{2}/ig, " ").replace(/^[\s|\n|\r\n|\t]+|[\s|\n|\r\n|\t]+$/g, "");
}

Like this:

Merlin.Speak(RemoveEmoticons(MsgPlus.RemoveFormatCodes(Contact.Name+Message+TimeD()))+"!")

This exemple was made whit Merlin, but it work. Change Merlin.Speak by other things

This post was edited on 03-14-2007 at 10:16 PM by xsylvain2.
03-14-2007 09:54 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
removing emotions? - by effection on 03-14-2007 at 09:01 PM
RE: removing emotions? - by xsylvain2 on 03-14-2007 at 09:54 PM
RE: removing emotions? - by effection on 03-14-2007 at 10:10 PM
RE: removing emotions? - by Spunky on 03-15-2007 at 03:50 PM
RE: removing emotions? - by effection on 03-15-2007 at 04:01 PM
RE: removing emotions? - by Matti on 03-15-2007 at 07:17 PM
RE: removing emotions? - by vikke on 03-15-2007 at 08:59 PM
RE: removing emotions? - by effection on 03-15-2007 at 09:15 PM
RE: removing emotions? - by vikke on 03-16-2007 at 09:26 AM
RE: removing emotions? - by effection on 03-16-2007 at 04:01 PM
RE: removing emotions? - by Matti on 03-16-2007 at 07:55 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