s = "Hello, how are you doing this morning? You look great!"
// Start by splitting into sentences so we can get the capitalisation right
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
// Now build new array of sentences
l = NewStringList()
foreach (t, ary) {
// for each sentence, trim whitespave and make it lower case
// (so proper names will not be handled properly)
t = Trim(LCase(t))
// now change to the accent
t = Replace(t, " h", " '")
t = Replace(t, "th", "z")
// capital at start
t = CapFirst(t)
list add (l, CapFirst(t))
}
// join sentences together and out put
msg(Join(l, " "))
Neonayon wrote:What about you having a word like...
"And" and you want to add, "like" before each "And"
"And like", for example.
or "Like totally"
t = Replace(t, " h", " '")
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
Also for that Language String how would you get that to pertain to one specific character? Take that!
game.stringtoprocess = s
msg(eval(character.accent + "(game.stringtoprocess)"))
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
l = NewStringList()
foreach (t, ary) {
t = Trim(LCase(t))
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you totally like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
t = CapFirst(t)
list add (l, CapFirst(t))
}
msg (Join(l, " "))
if (player.speciality = "fashionable") {
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
l = NewStringList()
foreach (t, ary) {
t = Trim(LCase(t))
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you totally like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
t = CapFirst(t)
list add (l, CapFirst(t))
}
msg (Join(l, " "))
}
if (player.speciality = "fashionable") {
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
l = NewStringList()
foreach (t, ary) {
t = Trim(LCase(t))
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you totally like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
t = CapFirst(t)
list add (l, CapFirst(t))
}
msg (Join(l, " "))
}
What is not working? What is the error? How is it currently set up?
if (player.speciality = "bimbo") {
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
l = NewStringList()
foreach (t, ary) {
t = Trim(LCase(t))
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you totally like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
t = CapFirst(t)
list add (l, CapFirst(t))
}
return (Join(l, " "))
}
else if (player.speciality = "male model") {
s = Replace(s, ". ", ".|")
s = Replace(s, "! ", "!|")
s = Replace(s, "? ", "?|")
ary = Split(s, "|")
l = NewStringList()
foreach (t, ary) {
t = Trim(LCase(t))
if (RandomChance(50)) {
t = Replace(t, " and ", " and like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you like ")
}
else if (RandomChance(50)) {
t = Replace(t, " you ", " you totally like ")
}
else {
t = Replace(t, " and ", " and like totally ")
}
t = CapFirst(t)
list add (l, CapFirst(t))
}
return (Join(l, " "))
}
else {
return (s)
}