code:
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nMessageKind){
if (sOrigin != Messenger.MyName){ //Check if the person who sent the message is the bot or not
if (sMessage.toLowerCase() == 'yes'){ //Check if the contact said yes
pChatWnd.SendMessage('this is a message sent'); // Send a message or the question again
}
}
}
No offence but what I told you is pseudo code your supposed to be able to take what I say and turn it into code. Its not hard to do.
PM
quote:
On Today at 05:54 PM, Gran_PC wrote:
Now any message is the message of the question... Please help...
I suggest using a BOOL variable setting it to true if a question is asked then your code would look like this :
code:
var blnIsQuestionAsked = false;
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nMessageKind){
if (sOrigin != Messenger.MyName){ //Check if the person who sent the message is the bot or not
if (sMessage.toLowerCase() == 'yes'){ //Check if the contact said yes
if (blnIsQuestionAsked == true){ //Check if the contact said yes
pChatWnd.SendMessage('this is a message sent'); // Send a message or the question again
}
}
}
}
Again this is basic programming we can't keep giving you the answers this should be knowledge you should know already.