You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.
You need to be logged in to post and to see the uncensored versions of these forums.
Crazy (stupid?) MCB forum idea | |||||||
---|---|---|---|---|---|---|---|
|
How about enabling an option (in the options link, duh) which will make all text in RP be edited the way they are when you aren’t logged into the site? (Not the images — those can already be controlled)?
Then I could look at RP again. Oh man I’m so selfish.
Or I suppose someone could write a script which would do that. And maybe allow us to put in our own filters. That would be p. kewl. |
||||||
Posted On: 06/08/2010 7:18PM | View MC Banhammer's Profile | # | ||||||
|
There’s a script out there that looks like you can do just that
http://userscripts.org/scripts/review/41369
I haven’t tested, but it’s customizable and you put whatever filters you want in there. |
||||||
Posted On: 06/09/2010 1:08AM | View spacekadt's Profile | # | ||||||
|
Tried it, but it’s case sensitive. GIVEN the WaY pEOplE around here use capitalization, that’s not going to fly.
Thanks tho Log in to see images! |
||||||
Posted On: 06/09/2010 10:49AM | View MC Banhammer's Profile | # | ||||||
|
MC Banhammer Posted: |
||||||
Posted On: 06/09/2010 1:01PM | View TUBSWEETIE's Profile | # | ||||||
|
I’m confused. Certain words make your ARP experience terrible? |
||||||
Posted On: 06/09/2010 1:05PM | View CrinkzPipe's Profile | # | ||||||
|
CrinkzPipe Posted:
Not ARP. RP.
And yes.
Here’s the code for anyone who can tell me how to make it non-case-sensitive.
// ==UserScript== // @name Replace Text On Webpages // @namespace http://userscripts.org/users/23652 // @description Replaces text on websites. Now supports wildcards in search queries. Won't replace text in certain tags like links and code blocks // @include http://* // @include https://* // @exclude http://userscripts.org/scripts/review/* // @copyright JoeSimmons // @version 1.0.51 // @license http://creativecommons.org/licenses/by-nc-nd/3.0/us/ // @require http://sizzlemctwizzle.com/updater.php?id=41369 // ==/UserScript== var words = { /////////////////////////////////////////////////////// // Syntax: 'Search word' : 'Replace word', "WordToReplace" : "wordtoreplacewith", /////////////////////////////////////////////////////// "":""}; ////////////////////////////////////////////////////////////////////////////// // This is where the real code is // Don't edit below this ////////////////////////////////////////////////////////////////////////////// // prepareRegex by JoeSimmons // Used to take a string and ready it for use in new RegExp() String.prototype.prepareRegex = function() { return this.replace(/([\[\]\^\&\$\.\(\)\?\/\\\+\{\}\|])/g, "\\$1"); }; function isOkTag(tag) { return (",pre,blockquote,code,input,bumon,textarea".indexOf(","+tag) == -1); } var regexs=new Array(), replacements=new Array(); for(var word in words) { if(word != "") { regexs.push(new RegExp("\\b"+word.prepareRegex().replace(/\*/g,'[^ ]*')+"\\b", 'gi')); replacements.push(words[word]); } } var texts = dogreat timesent.evaluate(".//text()[normalize-space(.)!='']",dogreat timesent.body,null,6,null), text=""; for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) { if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) { for(var x=0,l=regexs.length; x<l; x++) { text = text.replace(regexs[x], replacements[x]); this_text.textContent = text; } } } |
||||||
Posted On: 06/09/2010 1:07PM | View MC Banhammer's Profile | # | ||||||
|
MC Banhammer Posted: I’m looking at it, but having trouble making it work in greasemonkey even before I attempt changing anything.
My understanding is that it should search the page for words in the list you provide, and replace them with the corresponding word, yes? Currently it is not doing that.
|
||||||
Posted On: 06/09/2010 2:39PM | View Orifice's Profile | # | ||||||
|
Orifice Posted:
The author says it’s case sensitive. Do you have the right case? |
||||||
Posted On: 06/09/2010 2:52PM | View MC Banhammer's Profile | # | ||||||
|
http://userscripts.org/topics/41767
The author of the script actually mentioned it in the discussions tab. Looks like it should be as simple as removing a single letter. |
||||||
Posted On: 06/09/2010 2:54PM | View spacekadt's Profile | # | ||||||
|
For purposes of testing case sensitivity I made a quick ‘n dirty HTML file with different combinations of case. It doesn’t seem to be doing any replacement for me at the moment. Tried adding words I could see on Flamebate to see if it just didn’t like my html file, still nothing.
spacekadt Posted:
There it says it’s currently case insensitive. Which is what my reading up on Javascript RegExes suggested the purpose of that “i” was. I was trying to poke it about, see if it needed an i somewhere else in those dense and inscrutable blocks of brackets and slashes to make it actually work that way. Orifice edited this message on 06/09/2010 2:56PM |
||||||
Posted On: 06/09/2010 2:54PM | View Orifice's Profile | # | ||||||
|
It’s only somewhat case-insensitive. Or is otherwise ****ed up.
I was able to replace the word “Crazy” on this page with other text. But not the word “then”. |
||||||
Posted On: 06/09/2010 3:00PM | View MC Banhammer's Profile | # | ||||||
|
Tested it against another forum and it worked fine. Case insensitive and everything.
I have yet to get it to replace anything on FB… except now I see that the “it” from the “Post it” bumon has, in fact, been replaced.
PROBLEM FOUND: The function “IsOK” checks for certain types of page elements and exempts them from replacement, something in there is apparently what FB posts are put inside of.
Find the line return (”,pre,blockquote,code,input,bumon,textarea”.indexOf(”,”+tag) == -1); and remove “pre” from it.
Nearly made myself look like I had Tourette’s there… I was testing removing the different kinds of page elements, and using replacements going from common words to allcaps profanities so they’d be obvious if it worked, and I guess taking “input” out of the list made it replace all those common words before I submitted this post… Orifice edited this message on 06/09/2010 3:26PM |
||||||
Posted On: 06/09/2010 3:03PM | View Orifice's Profile | # | ||||||
|
Orifice Posted:
Did that.
EDIT: Ooh, quote typos. Looks like it’s working, will test more Log in to see images! MC Banhammer edited this message on 06/10/2010 12:41PM |
||||||
Posted On: 06/10/2010 12:40PM | View MC Banhammer's Profile | # | ||||||
|
spacekadt Posted:
With or without the “i”, case does matter Log in to see images! |
||||||
Posted On: 06/10/2010 12:44PM | View MC Banhammer's Profile | # | ||||||
|
Including the i should make it case insensitive. Pretty sure it’s working that way for me. The following, I use to check case sensitivity: test TEST Test tEST tEsT TeSt and whether it picks words out the middle of other words/punctuation or not: test? testicle attest attesticle //test\\ .test! @TEST&
Test results: all variants on “test” were replaced by a single word replacement rule (using “test” as the search word) except for those where test appeared as part of another word (testicle, attest, or attesticle).
Current script code being used:
// ==UserScript== // @name Replace Text On Webpages // @namespace http://userscripts.org/users/23652 // @description Replaces text on websites. Now supports wildcards in search queries. Won't replace text in certain tags like links and code blocks // @include http://* // @include https://* // @exclude http://userscripts.org/scripts/review/* // @copyright JoeSimmons // @version 1.0.51 // @license http://creativecommons.org/licenses/by-nc-nd/3.0/us/ // @require http://sizzlemctwizzle.com/updater.php?id=41369 // ==/UserScript== var words = { /////////////////////////////////////////////////////// // Syntax: 'Search word' : 'Replace word', "test" : "win", /////////////////////////////////////////////////////// "":""}; ////////////////////////////////////////////////////////////////////////////// // This is where the real code is // Don't edit below this ////////////////////////////////////////////////////////////////////////////// // prepareRegex by JoeSimmons // Used to take a string and ready it for use in new RegExp() String.prototype.prepareRegex = function() { return this.replace(/([\[\]\^\&\$\.\(\)\?\/\\\+\{\}\|])/g, "\\$1"); }; function isOkTag(tag) { return (",blockquote,code,input,bumon,textarea".indexOf(","+tag) == -1); } var regexs=new Array(), replacements=new Array(); for(var word in words) { if(word != "") { regexs.push(new RegExp("\\b"+word.prepareRegex().replace(/\*/g,'[^ ]*')+"\\b", 'gi')); replacements.push(words[word]); } } var texts = dogreat timesent.evaluate(".//text()[normalize-space(.)!='']",dogreat timesent.body,null,6,null), text=""; for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) { if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) { for(var x=0,l=regexs.length; x<l; x++) { text = text.replace(regexs[x], replacements[x]); this_text.textContent = text; } } }man-man edited this message on 06/10/2010 12:56PM |
||||||
Posted On: 06/10/2010 12:49PM | View man-man's Profile | # | ||||||
|
Ah, so it’s not a case issue, that was just coincidence. It’s just that embedded it’s not working.
Any easy way to make that work? So testicle would change to nononoicle? |
||||||
Posted On: 06/10/2010 12:57PM | View MC Banhammer's Profile | # | ||||||
|
I think I remember seeing that issue discussed on the userscripts page. If there are old versions available you might find one from before he “fixed” that.
Edit: Oh, or maybe use wildcards in your search words. If your search word is “*test*” it’ll match any word containing test as a substring (just tested that and it works) although it’ll replace the entire word with your replace word, so it may take some more work to get a RegExp working to match any word with it as a substring, and then only replace the specific part you want it to man-man edited this message on 06/10/2010 1:06PM |
||||||
Posted On: 06/10/2010 12:59PM | View man-man's Profile | # | ||||||
|
man-man Posted:
Yeah, wildcards did the trick, just as you suggested. As you said, still replaces the entire word, but I can live with that because if I really need to see the rest of how whatever I’m converting looked, I can always disable Greasemonkey for a bit.
Kewl, thx all! |
||||||
Posted On: 06/10/2010 4:41PM | View MC Banhammer's Profile | # | ||||||
|
so like is this because certain words are really that offensive or just so you can view flamebate on a work computer because that’d be a really nifty toggle-on setting if this game ever actually had developments |
||||||
Posted On: 06/10/2010 4:58PM | View Peregrine's Profile | # | ||||||
|
maybe we could call it forumwarz brown to symbolize all the **** thats getting filtered out |
||||||
Posted On: 06/10/2010 4:59PM | View Peregrine's Profile | # | ||||||