Quote:
Originally posted by --Chris--
I don't think it could be done with things such as "u" cause if someone were to say a word with the letter "u" in it, it would translate the individual letter into the word "you."
Example: Mush = Myoush
Unless of course they do something like (I suck at scripting but you get the idea)
string = 1 character
if input = "u"
print "you"
or a much longer versian if that's not possible like
if input = "u" then
print "you"
else
input = "mush"
print "mush"
*Repeat with every word that has the letter "u" in it*
|
tokenize works
By the way, GScript isn't BASIC or whatever variant you are using
NPC Code:
if (timeout) {
if (playerchats) {
tokenize #c;
this.wordcount = tokenscount;
for (this.i=0; this.i<tokenscount; this.i++) {
setstring chat#v(this.i),#t(this.i);
if (strequals(#s(chat#v(this.i)),u)) {
setstring chat#v(this.i),you;
}
}
setplayerprop #c,#s(chat0) #s(chat1) #s(chat2) ...; //this is the best way I can think of reconstructing the original text.
}
timeout = 0.1;
}
That should replace the 'u' with you. Although my method to reconstruct the original chat text could be better. I'm just not sure how to.