Text file profanity list. in Developer Help
|
|
Code:
var/list/profane = list(file2text('profanity.txt')) var/list/realprofane = list() proc scantext(checklist,nonacceptable) if(findtext(checklist,nonacceptable)) var/newword newword = copytext(nonacceptable,nonacceptable) var/Z Z = "[newword]" realprofane.Add(Z) mob verb Say(msg as text) if(checktext(msg)) punish(usr) return world<<"<b>[usr]:</b> [msg]" Scan() for(var/Y in profane) scantext("[Y]","&") Check() for(var/Z in realprofane) world<<"[Z]" proc checktext(msg as text) if(findtext(realprofane,msg)) return 1 else return 0 punish(M) M<<"Don't use profanity"
|
Problem description:
First of all I'm going to bed right after I post this. Secondly, what I need this code to do: The text file contains Hello&World, I need the code to make Hello&World become two seperate words because after the profane list reads the text file it makes it all one word. Third, just tell me anything you think I should do.
|