ID:150029
 
I need to know how to pick out words in a sentence, and also be able to check text and exclude the ?s etc.

Right now I'm forcing my say verb into a proc that checks for what is typed.

I'm forcing everything to lowercase right now so I don't have to worry about case sensitive. But for instance, if someone says, "Hi LJR how are you doing!?"
It would only check for "Hi", "LJR" and then reply with the name of the person who said that, like "Hi YOURNAMEHERE!"

LJR
Wow where is everyone??? Normally someone would of replied to this with some sort of an answer by now. Or is this really just a hard question???

LJR
LordJR wrote:
I need to know how to pick out words in a sentence, and also be able to check text and exclude the ?s etc.

You could use the TextHandling library's dd_text2list() function for this, by passing in a space as the separator:

var/list/words = dd_text2list(message, " ")

You would get back a list of everything that had spaces around it.

byond://Deadron.TextHandling
Picking words out in a sentance is easy... look up the findtext() proc. Here is an example, using findtext():

AIparser/proc/parse(var/string as text)
if(findtext(string,"hello ljr") != 0)
usr << "You told LJR hello, [usr]! I'm sure if he were here, he would say hi back to you."

Of couse, that is fairly simple, but I hope I helped a little bit!