Sending different sentence
in
Programming Questions
•
2 years ago
hi,
I've combined two different scripts. One is used for communicating with facebook, the other is a Eliza script. I'm trying to send different sentences after each other.
The problem is that after the third sentence is said, it should switch to a premade sentence, but it doesn't. What am i doing wrong? So after the rowCounter is larger than 1 it should send newChat.sendMessage(mega[counter])
Thanks in advance!
I've combined two different scripts. One is used for communicating with facebook, the other is a Eliza script. I'm trying to send different sentences after each other.
The problem is that after the third sentence is said, it should switch to a premade sentence, but it doesn't. What am i doing wrong? So after the rowCounter is larger than 1 it should send newChat.sendMessage(mega[counter])
Thanks in advance!
- import codeanticode.eliza.*;
int redColor = 255;
String FromGoogleTalk = "";
String [] mega = new String[0];
String [] megaAnsfer = new String[0];
String[] vraag0 = append(mega, "What kind of job do you have?");
String[] antwoord0 = append(megaAnsfer, "Oh nice, I'm owner of a company, but that doesn't matter right now.");
String[] vraag1 = append(mega, "What does your mother do?");
String[] antwoord1 = append(megaAnsfer, "Okay, my mother is a famous writer.");
String[] vraag2 = append(mega, "Do you want to go to an exclusive party with me tomorrow? Free drinks and models!");
String[] antwoord2 = append(megaAnsfer, "Okay, i will call you tomorrow about that. I don't know which time yet.");
String[] vraag3 = append(mega, " Do you have money problems?");
String[] antwoord3 = append(megaAnsfer, " If you do have money problems, feel free to ask, i always have enough.");
int ansfer = 0;
int counter = 0;
int talk = 0;
int rowCounter= 0;
- public void processMessage(Chat chat, Message message) {
// Here you do what you do with the message
FromGoogleTalk = message.getBody();
// Process commands
println(FromGoogleTalk);
elizaResponse = eliza.processInput(FromGoogleTalk);
try {
if (talk == 1) {
println("praat 1");
delay(2000);
newChat.sendMessage(megaAnsfer[counter]);
ansfer = 0;
counter++;
talk = 0;
}
if( rowCounter > 1)
{
println("praat 2 " + mega[counter]);
delay(100);
newChat.sendMessage(mega[counter]);
ansfer = 1;
}
if (ansfer == 0 ) {
delay(2000);
print(rowCounter);
newChat.sendMessage(elizaResponse);
rowCounter++;
}
// println(frameCount);
}
catch (XMPPException e) {
System.out.println("Error Delivering block");
}
}
1
