I'm working on a spam/language protector for my game, but I don't know how to find the bad language, and how to change it to certain things. But I want to change words to other words... Like... (i'm not going to use bad words here, I'm just gonna use random words)
phone would be automatically changed to television
then
fish would be changed to candy.
Or, here's a little example..
In the input box, I type in.... "Hello everyone! How are you guys doing today?"
It would be automatically changed to.. "Hello everyone!How art thou guys doith today?" I know my mid-english words are horrible, but that's not why i'm posting.
Can anybody help me?
ID:174135
Sep 26 2003, 10:28 pm
|
|
Sep 26 2003, 10:32 pm
|
|
i dont know but i'm guessing that u are making a medievil game?
|
In response to ZDarkGoku
|
|
ZDarkGoku wrote:
i dont know but i'm guessing that u are making a medievil game? I wrote: I'm working on a spam/language protector for my game, but I don't know how to find the bad language, and how to change it to certain things. Nope, that was pure random to show what I was looking for. |
In response to Rocker121
|
|
For future reference, ignore anyone who uses "u" instead of "you". :oP
|
In response to Foomer
|
|
Isn't there something more simple I can use? The only thing I want is to replace certain words with other words of my choice :P. Something like findtext()?
|
In response to Rocker121
|
|
Find text would be:
if(findtext("[msg]", "chicken")) usr<<"No Fowl Laugauge!" //I don't know how to replace it, sry =( |
In response to Rocker121
|
|
Rocker121 wrote:
The only thing I want is to replace certain words with other words of my choice :P. That's exactly what it does. <code>proc/ReplaceText(message, replace_what, replace_with) while(findtext(message, replace_what)) var/position = findtext(message, replace_what) var/before = copytext(message, 1, position) var/after = copytext(message, position + lentext(replace_what), 0) message = "[before][replace_with][after]" return message</code> (I got this one from Spuzzum, by the way.) |
In response to Foomer
|
|
Also ignore anyone who can't spell "medieval."
|
In response to Foomer
|
|
I'm a bit confused on this, and I'm not sure how I'd set it up. This is what I have.
mob/verb/say(t as message)world << "[usr]: [ReplaceText(t)]" |
In response to Rocker121
|
|
Rocker121 wrote:
I'm a bit confused on this, and I'm not sure how I'd set it up. Just look at the arguments that go into the proc defenition: ReplaceText(message, replace_what, replace_with) So if you have a message, and you want to replace all the words "bleh" in that message with "arf", you do this: <code>mob/verb/TestReplaceText() var/message = "once upon a bleh there was a bleh" message = ReplaceText(message, "bleh", "arf")</code> The result: "once upon a arf there was a arf" If you want to have it replace all the words in a list with their counterparts, use an associative list. <code>var/wordlist = list("short"="curd", "fork"="spork", "fish"="pollywog")</code> Where the first word, "short" is replaced with "curd", etc... Then: <code>mob/verb/Say(message as message) for(var/word in wordlist) message = ReplaceText(message, word, wordlist[word]) world << "[src]: [message]"</code> |
In response to ZDarkGoku
|
|
ZDarkGoku wrote:
i dont know but i'm guessing that u* are making a medievil* game? *you *medieval and of course the person is, he stated so him self. |