mob/verb/Say(msg as text)
if(!msg)
return
if(msg == "fuck")
msg = "****"
world <<"[usr]: [msg]"
else
world <<"[usr]: [msg]"
It works.So when i say fuck it works,BUT when i put another word in it besides fuc*k.It doesn't work.Thanks!
-Non-PC
ID:261449
Apr 2 2002, 2:29 pm
|
|
PLease help me fix this code:
mob/verb/Say(msg as text) It works.So when i say fuck it works,BUT when i put another word in it besides fuc*k.It doesn't work.Thanks! -Non-PC |
In response to Kappa the Imp
|
|
Worked fine when I tested it. I sincerely doubt that. =P |
In response to Kappa the Imp
|
|
Kappa the Imp wrote:
Non-PC wrote: > > mob/verb/Say(msg as text) It works.So when i say fuck it works,BUT when i put another word in it besides fuc*k.It doesn't work.Thanks! No,no,no try putting a word after it. -Non-PC |
In response to Non-PC
|
|
Non-PC wrote:
Kappa the Imp wrote: > > > mob/verb/Say(msg as text) It works.So when i say fuck it works,BUT when i put another word in it besides fuc*k.It doesn't work.Thanks! Oh,I see.Sorry,I don't know how to fix that. Good Luck Getting Help! -Kappa the Imp |
In response to Kappa the Imp
|
|
//Filter system 1.0
proc/SGS_Filter_txt(txt) var/stars var/s_amount var/mem var/find_t var/txtLen var/Words[] Words = new /list/ Words = list("fuck","shit","jerk","bitch")//you can add words here to filter if(Words.len) memo: for(mem = 1,mem < Words.len + 1,mem++) find_t = findtext(txt,Words[mem]) if(find_t) txtLen = length(Words[mem]) stars = null s_amount = null for(s_amount = 0,s_amount < txtLen,s_amount++) stars += "*" txt = copytext(txt,1,find_t) + stars + copytext(txt,find_t+txtLen,0) if(findtext(txt,Words[mem])) goto memo return txt |
In response to Justin Sun
|
|
Now where have I seen Justin Sun's code before..?? O yea Safe Guard Suite:P
|
In response to Justin Sun
|
|
Justin Sun wrote:
//Filter system 1.0 Nope.I don't want to use a proc in my say verb.I want MY code fixed because its the shortest way I think off to code it. -Non-PC |
In response to Kappa the Imp
|
|
You could add all the words into one list and check it against that
var/list/wordlist = list("Word1","Word2",Word3") |
I recommend you take a look at the code in my last Dream Tutor column for BYONDscape. Included in there is a very reasonable language filter that should fit your needs.
Lummox JR |
In response to Nadrew
|
|
Nadrew wrote:
You could add all the words into one list and check it against that > var/list/wordlist = list("Word1","Word2",Word3") Nope.If you type a text after it(a word)it doesn't work. -Non-PC |
In response to Non-PC
|
|
Then you'd do something like this in the if()
if(findtext(T,wordlist.Find(T))) |
In response to Nadrew
|
|
??????????Whats wrong with this code?:
var/list/wordlist = list("Word1","Word2","Word3") Now,everything I say comes out as stars. -Non-PC |
In response to Non-PC
|
|
Let me get some sleep and I'll get back to you. (For all of you that don't know I sleep during the day now)
|
In response to Non-PC
|
|
Non-PC wrote:
??????????Whats wrong with this code?: var/list/wordlist = list("Word1","Word2","Word3") Now,everything I say comes out as stars. That's because you're replacing the entire string, instead of just the offending part of it. But also, you're using wordlist.Find() wrong. You need to loop through every word in the list, like this: mob/verb/Say(T as text) This works now, but it's a very very poor swear filter. For one thing, it won't recognize whole words, so you could end up with problems like this: Goofball128: I don't mean to h@#$%&!le you, but could you p@#$%&! the salt? Crackpot: You have to say the p@#$%&!word first. Of course the F word is fine to recognize this way, because it doesn't occur naturally in other English words. My recent Dream Tutor column has more on this subject, including working code for a good language filter. Lummox JR |
In response to Lummox JR
|
|
Thanks for clearing that up for him. I promise never to help in my current state of mind again.
|
In response to Lummox JR
|
|
Thanks Lummox!
-Non-PC |
Worked fine when I tested it.
-Kappa the Imp