User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Word Censorship

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2006
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Word Censorship

    After going through Jeff's awesome first two tutorials I have been expanding the quality of my chat room. Today I attempted to write the code for censoring out commmon curses and offensive language. I tried the "Compare two general values", the "Find a string within a string" global string and several other similar attempts.

    Does anyone have any ideas for what code I should try instead?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Word Censorship

    I'm glad you liked the tutorials. For censorship I'd probbably use the String Parser 2 and its replace substring facility.

    1. Set the source string of SP2 to the message (e.g. "Hello Jeff. How are Yves and Francois doing today?")
    2. Set the source string of SP2 to replace$( "String Parser", "Jeff", "Sir Jeff")
    3. Set the source string of SP2 to replace$( "String Parser", "Francois", "Lord Francois")
    4. Set the source string of SP2 to replace$( "String Parser", "Yves", "Lord Yves")
    5. Send the source string of SP2 (e.g. "Hello Sir Jeff. How are Lord Yves and Lord Francois doing today?")

    If you have many words to censor then you may want to replace steps 2, 3 and 4 with a loop which runs once for every item in a listbox.
    .:::.Joshtek.:::.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2006
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Word Censorship

    That helps me a lot! However what condition should I use to set it off? And what string should I set the first source string as? I thought this one might work but it didn't:

    +Button "Send" Clicked
    +Len"Editbox Message">0
    -Set Source String as "GetText$"Editbox Message"
    -Set Source String as "replace$("String Parser", "heck", "****")
    -Rich Edit Display> SetText$(NewLine$+P_getname(mooclick)+":""+ string "String Parser"
    -Channel> Send string (string"String Parser")

    Could you tell me what I might have done wrong and what I might do instead? All that happens right now is I send blank messages. When I ran the application twice with the old version and the new one with the censor all i can do is recieve with the new one. Not send.

    PS: Thank you for replying so quickly

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Word Censorship

    Button "Send" Clicked is fine.

    Check the event list editor to make sure you aren't doing things in the wrong order. For example, if you set your edit box to "" then set your string parser to the edit box then it ain't gonna work. If that isn't the problem then post your file and I'll try and fix it.
    .:::.Joshtek.:::.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2006
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Word Censorship

    Thank you very much Joshtek! Apparently I was setting the string after the clear edit box command. It is all fixed up now!

    Thanks again, Gerblegod

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2006
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Word Censorship

    Quote Originally Posted by Joshtek
    If you have many words to censor then you may want to replace steps 2, 3 and 4 with a loop which runs once for every item in a listbox.
    I am such an idiot! I can't even figure out how to do this!
    Does anyone know what action I should use to make it check for every line in the list?
    Maybe I'm just not good enough to be doing this kind of project...

  7. #7
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Word Censorship

    [size:14pt]How to automatically censor every word in a list, by Joshtek[/size]

    1. Create a new list called List wordlist and uncheck the option "1-based".
    2. Every line of List wordlist's list should have the word to find followed by an equals character followed by the word to replace it with. Example list:
    Code:
    drat=****
    water=wine
    light=dark
    war=peace
    3. Create two new string parsers, one called String Parser word and the other String Parser message.
    4. New action for start of frame: String Parser word->List Tokenizing->Delimiters->Add Delimiter with the parameter "="
    5. Create a new action: Special->On loop. Call the loop "censor word".
    6. Action: Set the source string of String Parser word to List Line Text$( "List wordlist", LoopIndex("censor word"))
    7. Set the source string of String Parser message to replace$( "String Parser message", listFirst$( "String Parser word" ), listLast$( "String Parser word" ))
    8. Whenever you want to use this feature then just set String Parser message to the input (e.g. the contents of an edit box), use the special->run loop action to run the loop "censor word" List Nb Lines( "List wordlist" ) times. Finally, use String Parser message as the output (e.g. what to send/display).
    9. Final Note: You may want to filter the input too - just in case other people are using a different chat client.

    Try it out, and "I like light blue water" should become "I like dark red wine".
    .:::.Joshtek.:::.

  8. #8
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2006
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Word Censorship

    Hooray! I am finally finished! Thanks a million Joshtek! Your name definetly going into the "special thanks to" section of the application.

    Thanks again,
    Gerblegod

  9. #9
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Word Censorship

    After reading what Joshtek described did I put up episode 4 of the simple chat video tutorial that adds a censor function

    Thanks Joshtek!

  10. #10
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Word Censorship

    sweet, Jeff! these videos are the best!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Individual word by word string comparison?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 5th May 2013, 05:52 PM
  2. Highlight text word by word - grammar exercises
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 5th September 2011, 05:36 PM
  3. Any word
    By Tuna in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 29th August 2011, 02:20 PM
  4. How do i put Username And p-word?
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 10th August 2007, 03:39 PM
  5. ?Set up a word dictionary instead of a word censor
    By Neonotso in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th January 2007, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •