ID:140936
 
Code:
var/list/profane = list(file2text('profanity.txt'))//contains Hello&World for now
var/list/realprofane = list()
proc
scantext(checklist,nonacceptable)
if(findtext(checklist,nonacceptable))
//this needs to make it start a new word because as the code is right now
//it reads the text file as one big word so if the text file contains
//hello world then i need hello and world to become 2 different words
//by checking to see if there is a space in the text file i should be able to
//find the starting point for the new word, but i'm not sure how to do that
//EXAMPLE CODE THAT WILL NOT WORK OR PROBABLY EVEN COMPILE:
var/newword
newword = copytext(nonacceptable,nonacceptable)
//^^^ actually needs to make it copy all of the text from the nonacceptable
//were on to the next nonacceptable in the list
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.

params2list()
In response to Garthor
you can either use params2list()

or Deadron has some nice procs to use if you cant do that

http://www.byond.com/developer/Deadron/TextHandling

use the proc dd_text2list(Your Text,"&") and it will turn it into a list for you :)
In response to BrotherBear
Ah thank you two very very much :D