Mirage Source
http://web.miragesource.net/forums/

[Feature] Client Swear Filter
http://web.miragesource.net/forums/viewtopic.php?f=183&t=4385
Page 1 of 56

Author:  William [ Sat Sep 20, 2008 10:01 am ]
Post subject:  [Feature] Client Swear Filter

Originaly Created by Obsidian
Edited and refined by William

Difficulty: 1/5
Functionality: Works for all versions of MS.

Introduction
A standared simple client side swear filter that's added in 2-5minutes easily.

Client Side
Add this at the bottom of modGameLogic:
Code:
Public Function CheckMessage(byval Msg As String) As String
Dim kArray() As String
Dim Swears As String
Dim i As Integer
Dim SwearChar As String
   
    Swears = "ass,fuck,shit,bitch,damn,cunt,whore,piss,jesus,god"
    kArray = Split(Swears, ",")
   
    SwearChar = "*"
   
    For i = 0 To UBound(kArray)
        If InStr(LCase(Msg$), LCase(kArray(i))) Then
              Msg$ = Replace$(LCase(Msg$), LCase(kArray(i)), LCase(String(Len(kArray(i)), SwearChar)))
        End If
    Next i
   
    CheckMessage = Msg
End Function


Now search for all the different messages: adminmsg, saymsg, broadcastmsg, globalmsg, playermsg, mapmsg.

And do this on all of them:
Code:
Call GlobalMsg(ChatText)

Replace it with:
Code:
Call GlobalMsg(CheckMessage(ChatText))

And of course you shouldn't replace the saymsg call with a globalmsg call...

Good Luck And have Fun

Author:  William [ Sat Sep 20, 2008 4:10 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Yey, great! 25 points for me suckers :lol:

Author:  Mattyw [ Sun Sep 21, 2008 1:50 pm ]
Post subject:  Re: [Feature] Client Swear Filter

How can I modify it so that there is more than one SwearChar that are Random. Such as: *!?@£$

Tried a few ways, but obviously would've failed.

EDIT: Managed to get it so it does random out of the characters "*!?@$":

Code:
Public Function CheckMessage(ByVal Msg As String) As String
Dim kArray() As String
Dim SwearCensor As String
Dim Swears As String
Dim i As Integer
Dim SwearChars As String
Dim SwearRnd As String
Dim strname As String
   
    Swears = "ass,fuck,shit,bitch,biatch,cunt,whore,piss,bastard,crap,nigger,pussy,penis,vagina,wank,masterbate"
    kArray = Split(Swears, ",")
   
    SwearChars = "*@!?$"
    SwearCensor = Len(SwearChars)
    SwearRnd = Int((SwearCensor * Rnd) + 1)
   
    strname = strname & Mid(SwearChars, SwearRnd, 1)
   
    For i = 0 To UBound(kArray)
        If InStr(LCase(Msg$), LCase(kArray(i))) Then
              Msg$ = Replace$(LCase(Msg$), LCase(kArray(i)), LCase(String(Len(kArray(i)), strname)))
        End If
    Next i
   
    CheckMessage = Msg
End Function


Still need to make it actually do like "*!?@$" instead of "@@@@@".

Author:  mustorze [ Sun Sep 21, 2008 3:50 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Perfect

Author:  Tosuxo [ Tue Nov 04, 2008 3:03 pm ]
Post subject:  Re: [Feature] Client Swear Filter

wouldn't this cause all messages to go lower case?

Author:  Doomy [ Tue Nov 04, 2008 5:32 pm ]
Post subject:  Re: [Feature] Client Swear Filter

just wondering

what if they dont cuss
what if instead of saying

ass
they say i assisted that man the other day
will it do assisted

Author:  GIAKEN [ Tue Nov 04, 2008 5:41 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Yes it would.

Author:  Doomy [ Tue Nov 04, 2008 8:21 pm ]
Post subject:  Re: [Feature] Client Swear Filter

thats bad
i mean lots of cuss words are in normal words
Assisted
Class
Bass
mass

umm im out but you get the point

Author:  GIAKEN [ Tue Nov 04, 2008 8:24 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Just add a space around the word and fixed.

Author:  wanai [ Wed Dec 01, 2021 7:44 am ]
Post subject:  Re: [Feature] Client Swear Filter

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Mon Dec 27, 2021 11:20 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Econ

Author:  wanai [ Mon Dec 27, 2021 11:21 pm ]
Post subject:  Re: [Feature] Client Swear Filter

49.9

Author:  wanai [ Mon Dec 27, 2021 11:22 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Bett

Author:  wanai [ Mon Dec 27, 2021 11:23 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Bett

Author:  wanai [ Mon Dec 27, 2021 11:24 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Pros

Author:  wanai [ Mon Dec 27, 2021 11:26 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Quel

Author:  wanai [ Mon Dec 27, 2021 11:27 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Laru

Author:  wanai [ Mon Dec 27, 2021 11:28 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Stan

Author:  wanai [ Mon Dec 27, 2021 11:29 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Mary

Author:  wanai [ Mon Dec 27, 2021 11:30 pm ]
Post subject:  Re: [Feature] Client Swear Filter

ARIS

Author:  wanai [ Mon Dec 27, 2021 11:31 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Your

Author:  wanai [ Mon Dec 27, 2021 11:32 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Prov

Author:  wanai [ Mon Dec 27, 2021 11:33 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Comp

Author:  wanai [ Mon Dec 27, 2021 11:35 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Micr

Author:  wanai [ Mon Dec 27, 2021 11:36 pm ]
Post subject:  Re: [Feature] Client Swear Filter

Magi

Page 1 of 56 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/