balliztik1 Posted July 31, 2007 Author Share Posted July 31, 2007 I didn't like how Eclipse's word filter just changed the word to asterisks, so I changed it a bit to allow replacement words, like on the forums.(All edits are server-side.)Find _modTypes_. Paste this in there somewhere.```Type Wordfilterblah Word As String replacement As StringEnd TypePublic Wordfilter() As Wordfilterblah```Now find this:```Public Spritesize As Byte```And paste this under it:```Public MAX_WORDS As Integer```In _ModGeneral_ find these lines:``` MAX_SCRIPTSPELLS = GetVar(App.Path & "\Data.ini", "MAX", "MAX_SCRIPTSPELLS") Paperdoll = GetVar(App.Path & "\Data.ini", "CONFIG", "PaperDoll") Spritesize = GetVar(App.Path & "\Data.ini", "CONFIG", "SpriteSize")```Under them, paste this:``` MAX_WORDS = GetVar(App.Path & "\wordfilter.ini", "wordfilter", "maxwords")```Slightly below that, find this:``` On Error GoTo 0```Under it, add this:``` ReDim Wordfilter(1 To MAX_WORDS) As Wordfilterblah```Now, in _modGameLogic_ change _Public Sub LoadWordFilter_ and _Public Function SwearCheck_ to these:```'ASGARDPublic Sub LoadWordFilter() Dim I If FileExist("wordfilter.ini") Then WordList = Val(GetVar(App.Path & "\wordfilter.ini", "WORDFILTER", "maxwords")) If WordList >= 1 Then For I = 1 To WordList Wordfilter(I).Word = LCase(GetVar(App.Path & "\wordfilter.ini", CStr(I), "word")) Wordfilter(I).replacement = GetVar(App.Path & "\wordfilter.ini", CStr(I), "replacement") Next I End If Else Call MsgBox("Wordfilter.INI could not be found. Please make sure it exists.") WordList = 0 End If On Error GoTo 0 Exit SubEnd SubPublic Function SwearCheck(TextToSay As String) As String Dim I As Integer SwearCheck = TextToSay If WordList <= 0 Then Exit Function For I = 1 To WordList SwearCheck = Replace$(SwearCheck, Wordfilter(I).Word, Wordfilter(I).replacement, 1, -1, vbTextCompare) Next IEnd Function```That should be everything. Now, you just have to set up the new wordfilter.ini. Here's an example:```[WORDFILTER]maxwords = 5[1]word = Gray-foxreplacement = The Foxxxy[2]word = screwreplacement = hammer[3]word = coughreplacement = hacks up a hairball and throws it at the nearest person[4]word = aimreplacement = monkey in a cardboard box[5]word = unnownreplacement = unnownzorzorzorzorzorzor```This would create something like the forum filters. Just change _maxwords_, and add more numbers until you have all you need. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now