What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script Request- Developers please view

Pages: (2): « First [ 1 ] 2 » Last »
Script Request- Developers please view
Author: Message:
CH33z
New Member
*


Posts: 5
Joined: Aug 2006
O.P. Undecided  Script Request- Developers please view
Attention script developers---

     Would somebody please create a script for a word filter? I'd really appreciate it if someone could make and post one in the script section. Sometimes it is really annoying when every second word should be packed with tons of ***'s but it isn't. 8o|

     Someone please try, and if you succeed, post a reply on this thread. Thanx. :D
08-23-2006 08:54 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Script Request- Developers please view
Do you mean, filtering the words you send or the ones you recieve? ^o)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-23-2006 09:21 AM
Profile E-Mail PM Web Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
37 / Male / Flag
Joined: Jul 2005
RE: Script Request- Developers please view
received I guess...
how else can he find it annoying ;)
08-23-2006 12:17 PM
Profile PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: Script Request- Developers please view
I've made this script which will filter all messages (both sent and received). To add words to the list, you will need to edit the array at the top. You can have as many or as little filtered words as you want.
code:
// Add words that you want censored to the wf_FilteredWords array.
// Enclose the words with quotation marks (") and separate each word with a comma (,).

var wf_FilteredWords = new Array("FilteredWord0", "FilteredWord1", "FilteredWord2");

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    var wf_FilteredMessage = Message;
    Debug.Trace("Filtered message defined.")
   
    for(i = 0; i < wf_FilteredWords.length; i++) {
        while(wf_FilteredMessage.toLowerCase().search(wf_FilteredWords[i].toLowerCase()) != -1) {
            Debug.Trace("Filtered word found.")
            var wf_IndexArray = new Array(wf_FilteredMessage.toLowerCase().search(wf_FilteredWords[i].toLowerCase()), wf_FilteredMessage.toLowerCase().search(wf_FilteredWords[i].toLowerCase()) + wf_FilteredWords[i].length);
            var wf_ReplacedStars = "";
           
            for(j = 0; j < wf_FilteredWords[i].length; j++) {
                wf_ReplacedStars += "*";
            }
            Debug.Trace("Star replacement created.")
           
            var wf_Temp = wf_FilteredMessage.substring(0, wf_IndexArray[0]) + wf_ReplacedStars + wf_FilteredMessage.substr(wf_IndexArray[1]);
            wf_FilteredMessage = wf_Temp;
            Debug.Trace("Filtered word censored.")
        }
    }
   
    Debug.Trace("All filtered words censored.")
   
    return wf_FilteredMessage;
    Debug.Trace("Filtered message sent.")
}
08-23-2006 12:28 PM
Profile PM Find Quote Report
saralk
Veteran Member
*****

Avatar

Posts: 2598
Reputation: 38
35 / Male / Flag
Joined: Feb 2003
RE: Script Request- Developers please view
quote:
Originally posted by -!Felu!-
quote:
Originally posted by Mattike
Do you mean, filtering the words you send or the ones you recieve? ^o)
Whatever he means, there's a way out.

For Outgoing you can just use Quick Texts.

And for Incoming(except emoticons) use something like this(Make sure Edit is not longer than Message) -
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if (Origin != Messenger.MyName){
if (Message == "Message 1"){
return "Edit 1";
}
if (Message == "Message 2"){
return "Edit 2";
}
if (Message == "Message 3"){
return "Edit 3";
}
}
}


That wouldn't work, if someone wrote "hey fool, go Message 3 yourself" it wouldn't replace that.
The Artist Formerly Known As saralk
London · New York · Paris
Est. 1989
08-23-2006 12:33 PM
Profile PM Find Quote Report
CH33z
New Member
*


Posts: 5
Joined: Aug 2006
O.P. Happy  RE: Script Request- Developers please view
Thanx guyz- I'm gonna try them out now. :D

   And yes, I meant recieving not outgoing messages.

Thanks 4 all your help. :)
08-23-2006 10:35 PM
Profile E-Mail PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
34 / Male / Flag
Joined: Aug 2006
RE: Script Request- Developers please view
Hi everybody ;)

Just a suggestion to phalanxii, your scripts works fine, but there are some ameliorations to do... I say that for helping... Because your script  seems very hard to do ! xD

code:
var wf_FilteredWords = new Array("Word1", "Word2", "Word3");

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) {
    for(i = 0; i < wf_FilteredWords.length; i++) {
        var FilterWord=wf_FilteredWords[i];
        var Repl = new RegExp("("+FilterWord+")","gi")
        Message=Message.replace(Repl,GetStars(FilterWord.length));
    }
    return Message;
}

function GetStars(Length) {
    var ReturnVal=""
    for(k = 0; k < Length; k++) {
        ReturnVal+="*"
    }
    return ReturnVal;
}

That should work too ;)

This post was edited on 08-23-2006 at 11:01 PM by KnRd_WC.
08-23-2006 10:59 PM
Profile PM Web Find Quote Report
CH33z
New Member
*


Posts: 5
Joined: Aug 2006
O.P. Huh?  RE: Script Request- Developers please view
BTW: Is there a way to get it to work with personal messages as well? If yes I'd appreciate the help.

Also, if only part of the word is a filtered one, will it replace the filtered part? :huh:
08-23-2006 11:08 PM
Profile E-Mail PM Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Script Request- Developers please view
No, you can't change others PSMs

Yes it will...

If you don't want that,
This will fix it:
code:
var wf_FilteredWords = new Array("Word1", "Word2", "Word3");

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind) {
    for(i = 0; i < wf_FilteredWords.length; i++) {
        var FilterWord=wf_FilteredWords[i];
        var Repl = new RegExp("(?:^|\\b)"+FilterWord+"(?:\\b|$)","gi")
        Message=Message.replace(Repl,GetStars(FilterWord.length));
    }
    return Message;
}

function GetStars(Length) {
    var ReturnVal=""
    for(k = 0; k < Length; k++) {
        ReturnVal+="*"
    }
    return ReturnVal;
}

This post was edited on 08-24-2006 at 12:13 AM by Shondoit.
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-24-2006 12:12 AM
Profile PM Find Quote Report
CH33z
New Member
*


Posts: 5
Joined: Aug 2006
O.P. Wink  RE: Script Request- Developers please view
Hey guyz- a good idea would be to post that script on the database but give credit to the others.

BTW: I couldn't get your script to work saralk. Maybe I'm doing something wrong or it just doesn't work. :(

Thanks again for all that help. :)
08-24-2006 07:24 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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