Ulysses Stuff > Releases

CenKik - Censoring and Kicking

<< < (3/11) > >>

Storm:
Is there a way I can change the code to sensor the whole sentence the offending word is in like Eccid's code did? I took his:

if string.find(string.lower(text), b, 1, true) then --Is a word being used?
      if KickWords.censor then text = ";)" end --What to print if censored.

and tried several ways to work it into your addon, but I continually failed.

Here is why I want to censor the whole sentence:
1) profanity rages often contain a lot of foul words in the one sentence. I can't anticipate and block ever word. Also, the offending plyr gets more of a punishment (without kicking) if his entire sentence is blocked and gives up quickly.
2) I use this to block http:, www., ,com, etc. I want the whole link blocked not just that part, which is what Eccid's script did. Otherwise, players will see ***pornhub****, etc

Cobalt:

--- Quote from: Storm on January 15, 2014, 05:39:42 AM ---Is there a way I can change the code to sensor the whole sentence the offending word is in like Eccid's code did? I took his:

if string.find(string.lower(text), b, 1, true) then --Is a word being used?
      if KickWords.censor then text = ";)" end --What to print if censored.

and tried several ways to work it into your addon, but I continually failed.

Here is why I want to censor the whole sentence:
1) profanity rages often contain a lot of foul words in the one sentence. I can't anticipate and block ever word. Also, the offending plyr gets more of a punishment (without kicking) if his entire sentence is blocked and gives up quickly.
2) I use this to block http:, www., ,com, etc. I want the whole link blocked not just that part, which is what Eccid's script did. Otherwise, players will see ***pornhub****, etc

--- End quote ---
That is much easier to do.
for k, v in pairs( badwords ) do
if string.find( text:lower(), v ) then
return string.rep ("*", text:len() )
end
end

Or something like that.

Neku:
Just above

--- Code: ---kikpls = true
--- End code ---

Replace that line with

--- Code: ---filter = "(=^-^=)"
--- End code ---

Storm:
This is just what I was looking for and works perfectly! AND i accidentally learned something! Thanks so much!

Neku:

--- Quote from: MrPresident on January 14, 2014, 09:47:29 PM ---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.

--- End quote ---

I meant, how would I call a certain value in a table?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version