Shoutbox

Please help. (making a bot ask a question) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Please help. (making a bot ask a question) (/showthread.php?tid=62931)

Please help. (making a bot ask a question) by Gran_PC on 07-09-2006 at 09:21 PM

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


RE: Please help. by J-Thread on 07-09-2006 at 09:26 PM

You should check the Origin value, read the documentation about the OnEvent_ChatWndReceiveMessage message for more details.


RE: RE: Please help. by Gran_PC on 07-09-2006 at 09:26 PM

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
RE: Please help. by matty on 07-09-2006 at 09:29 PM

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.


RE: Please help. by Gran_PC on 07-09-2006 at 09:30 PM

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

RE: Please help. by matty on 07-09-2006 at 09:39 PM

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.
RE: Please help. by ddunk on 07-09-2006 at 09:40 PM

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.
RE: RE: Please help. by Gran_PC on 07-09-2006 at 09:41 PM

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?

RE: Please help. by matty on 07-09-2006 at 09:50 PM

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.
RE: Please help. (making a bot ask a question) by Gran_PC on 07-10-2006 at 08:30 AM

Ok, a friend is fixing my code! But thanks to everybody! :)


RE: Please help. (making a bot ask a question) by Paril on 07-10-2006 at 08:33 AM

Alright, I saw the code, and most of it are syntax errors; various ) and \'s in weird places. I'll fix it up, and see what I can come up with