Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

New word filter?


Valon328
 Share

Recommended Posts

I think what Nugget made actually comes close.
First, search for the sub where you recieve the text (before sending back to the map).
Second, make a Function:
```
Public Function WordFilter(message-var As String) 'change this
    If message-var = Trim$("lol") Then
          WordFilter = "rofl"
    ElseIf message-var = Trim$("...") Then
          WordFilter = ""
    End If
End Sub 'not sure, never made a function by hand xD

```It's very basic and will only work if the entire message is lol or …, but it does work.
I don't know the command to check for every word, but you got your basic.
Link to comment
Share on other sites

  • 2 weeks later...
```
Public Function Replace(message-var As String, WhatShouldBeFiltered As String, WhatToReplace As String) 'change this
    If message-var = Trim$(WhatShouldBeFiltered) Then
          Replace = WhatToReplace
    End If
End Sub 'not sure, never made a function by hand xD

```
There you go.
Just call it like you did, and he actually replaces it (make sure to call it where he sends the message to the map, you've got to find it yourself).
Link to comment
Share on other sites

But for a long list, you'd need to create a loop of some sort, or do it all by hand. I remade the word filter from TE a while back. You might want to check it out. Note that the associated tutorial no longer works with the latest version, but if you know the source, it won't be a problem.

http://www.touchofdeathforums.com/smf/index.php/topic,16815.0.html
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...