Please help. (making a bot ask a question) |
Author: |
Message: |
Gran_PC
New Member
Posts: 14
Joined: Jul 2006
|
O.P. Please help. (making a bot ask a question)
Hi, I have the same problem, I'm making a bot but the bot needs to make a question. The user say "Yes". And a error appears: The question of the bot repeats.
The user say "Yes". And a error appears: The question of the bot repeats.
This in loop. Can you help me?
Gran PC
This post was edited on 07-10-2006 at 06:48 AM by WDZ.
|
|
07-09-2006 09:21 PM |
|
|
J-Thread
Full Member
Posts: 467 Reputation: 8
– / / –
Joined: Jul 2004
|
RE: Please help.
You should check the Origin value, read the documentation about the OnEvent_ChatWndReceiveMessage message for more details.
|
|
07-09-2006 09:26 PM |
|
|
Gran_PC
New Member
Posts: 14
Joined: Jul 2006
|
O.P. RE: RE: Please help.
quote: Originally posted by J-Thread
You should check the Origin value, read the documentation about the OnEvent_ChatWndReceiveMessage message for more details.
No origin, if sMessage
|
|
07-09-2006 09:26 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Please help.
He means check what sOrigin is to see what user sent the message. and if it was the incorrect response from the user send the question again.
|
|
07-09-2006 09:29 PM |
|
|
Gran_PC
New Member
Posts: 14
Joined: Jul 2006
|
O.P. RE: Please help.
quote: Originally posted by Matty
He means check what sOrigin is to see what user sent the message. and if it was the incorrect response from the user send the question again.
But the user will be dynamic
|
|
07-09-2006 09:30 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Please help.
quote: Originally posted by Gran_PC
quote: Originally posted by Matty
He means check what sOrigin is to see what user sent the message. and if it was the incorrect response from the user send the question again.
But the user will be dynamic
Ya check if the message is not from the bot, if its not check to see if the response is yes, if it is resend the question. Its straight logic.
|
|
07-09-2006 09:39 PM |
|
|
ddunk
Veteran Member
Posts: 1228 Reputation: 51
35 / /
Joined: Mar 2004
|
RE: Please help.
quote: Originally posted by Gran_PC
quote: Originally posted by Matty
He means check what sOrigin is to see what user sent the message. and if it was the incorrect response from the user send the question again.
But the user will be dynamic
Then do the opposite. The user may be dynamic, but the bot isn't. Check the origin, and if the origin is the bot, have it ignore it.
See here.
EDIT: Fixed URL.
This post was edited on 07-09-2006 at 09:42 PM by ddunk.
|
|
07-09-2006 09:40 PM |
|
|
Gran_PC
New Member
Posts: 14
Joined: Jul 2006
|
O.P. RE: RE: Please help.
quote: Originally posted by Matty
quote: Originally posted by Gran_PC
quote: Originally posted by Matty
He means check what sOrigin is to see what user sent the message. and if it was the incorrect response from the user send the question again.
But the user will be dynamic
Ya check if the message is not from the bot, if its not check to see if the response is yes, if it is resend the question. Its straight logic.
I don't understand... Send you the code by PM?
|
|
07-09-2006 09:41 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Please help.
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.
This post was edited on 07-10-2006 at 08:34 AM by surfichris.
|
|
07-09-2006 09:50 PM |
|
|
Gran_PC
New Member
Posts: 14
Joined: Jul 2006
|
O.P. RE: Please help. (making a bot ask a question)
Ok, a friend is fixing my code! But thanks to everybody!
|
|
07-10-2006 08:30 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|