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:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: removing emotions?
Instead of guessing, try to check your codes!
@xsylvain2: eval() is evil, try to avoid using it.
@Spunky: The brackets will be recognized as a character set in a regular expression!

The correct way to use an array as replacement input, would look like:
code:
var data = new Array(":)", ":("); //This should contain your captured emoticons
for(i=0; i<data.length; i++) //Or shorter: for(i in data)
{
   Message = Message.replace(new RegExp(data[i], "gi"), " "); //WARNING: See further[/i]
}
A note here is that the captured emoticon codes should be escaped before you use them in the regular expression. If I have some time, I could write a function which escapes the right characters and eventually return a regular expression so you don't even need the new RegExp(), but simply can use something like EscapeRegExp(data[i]). Send me a PM if you want me to start work on it.

And, could you please give us the full code and show us what exactly is in the data array? So we can better understand the structure you use in the script?
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
03-15-2007 07:17 PM
Profile E-Mail PM Web 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