Ulysses Stuff > Releases

CenKik - Censoring and Kicking

<< < (2/11) > >>

Neku:

--- Quote from: JamminR on January 14, 2014, 07:32:47 PM ---AND_THEN_EVERYONE_STARTS_BEING_IDIOTS_AND_TALKS_LIKE_THISorTalksLikeThisToAvoidAutoCensor
Of course, at that point, you'd hope that an admin was on who could ban the person for script/rule avoidance.

--- End quote ---

This filters out words regardless of it's case. Of course the drawback is having the entire thing in lower case.

"I lIkE LoLiPoPs!" -> "i like ******s!"

Neku:

--- Quote from: MrPresident on January 14, 2014, 06:24:06 PM ---to fix your bug, you could do this:

string.explode
to separate the sentence by space. Check each entry (you would need to use a for loop as the entries would be in a table at this point).

Once you are done use
string.implode
place them all back together into a sentence and pass that to the chat hook.

--- End quote ---

Er, I still don't fully understand tables in Lua.
Could you show me how please?

Like, how would I indicate which part of the table to filter out?

JamminR:
I was replying to MrPres' idea of using spaces as a separator. :)
No spaces, wouldn't censor as expected. But now that I say that, my mind spins and considers a way to even check for multiple words in one 'no space sentence'.
But that then starts even more for loops. CPU hog.

MrPresident:
Not really Jam. It would work exactly how she is doing it now, except if they tried to do all one string the whole string would be censored.

MrPresident:
You would just need to use something like..


--- Code: ---if string.find( string, badword) then
    -censor this word
end

--- End code ---

It would find the word even if it were nested inside of another word. You just have to be careful at this point.

Let's say that boom is your bad word, it would think that kaboom was a bad word as well.


Chat censors are never 100% flawless.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version