![]() |
Chat Swear Filter - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Chat Swear Filter (/showthread.php?tid=42) |
Chat Swear Filter - Tutorial Bot - 01-06-2006 Author: Obsidian Difficulty: 1/5 This is a very basic swear filter. :: SERVER SIDE :: First, we need to setup the checks for the swears. Open modHandleData and find: Code: If LCase(Parse(0)) = "saymsg" Then Code: ' Prevent hacking Code: Call CheckMessage(Index, Msg) All you have to do is add that in the same exact spot for every type of chat that you want censored. (Admin, Global, Broadcast, Emote, etc.) Now, at the bottom of modDatabase (or wherever, I just use Database) add this function: Code: Public Function CheckMessage(Index As Long, Msg As String) Note: The forum censors certain words, so be sure to replace whatever has been caught by the filter. That's all! - Belier13 - 13-06-2006 Well, I changed it a bit, and I thought I could share Code: Public Function CheckMessage(Msg As String) What I did is removing the Useless Byval Index as long and exept of remplacing whole insult by ***, you can change to whatever you want - Obsidian - 13-06-2006 that's not a bad little addition ![]() i originally wrote this code for an engine, so it wouldn't make much sense having two different (or even and extra set of info) for a txt or ini file. The engine just allows you to add different swears, and select the swear character, which by default is * - Bradyok - 14-06-2006 Thanks for sharing it and damn.. I was looking for the command to split a bunch of stuff divided by ,'s so this also helped me with that. - Tosuxo - 15-06-2006 pretty nice tutorial that, thanks p.s. Tosuxo is back at Mirage Source!! WOOO!!! - Robin - 23-06-2006 Im not really sure, but wouldn't that change the entire thing into lowercase? - Belier13 - 23-06-2006 ^ Just checked, it does.. whata crap - Tosuxo - 23-06-2006 yeh, but there are few cases when upper-case is needed... i can't think of any right now... but all the same, it would be good if someone could fix this problem... if that's possible... :S - Robin - 23-06-2006 I think this might work: Msg = Replace(Msg, kArray(i), String(Len(kArray(i))), SwearChar) (might need to change the syntax, the '(' etc. i don't have visual basic with me. |