mIRC Homepage
Posted By: RusselB wait for reponse before next question - 09/04/05 03:06 AM
What I'm looking for is a code that will run on my bot, and upon a specific command ask the person some questions in pm. The responses to the questions can be accepted from anywhere, but the bot should recognize who is responding to what question no matter where they put the response.

I also want the bot to ask the questions one at a time, waiting for the person to give a response before going to the next question.

The responses are to be stored in a hash table that I've already got called Profiles and need to be stored on a by nick (or better yet, address) basis

For example:
<bot> What is your description?
<RusselB> 5'8", 115 lbs, brown hair, hazel eyes
hadd -m Profile $+(Desc,$address) 5'8", 115 lbs, brown hair, hazel eyes
<bot> What is your location?
<RusselB> Ontario, Canada
hadd -m Profile $+(Loc,$address) Ontario, Canada

I hope that's clear.

P.S.: If possible, I'd also like to include a timer of some kind so that if the person doesn't want to answer the question, all they have to do is wait for (say a minute) and then the bot will go to the next question automatically, but I don't want the bot to go to the next question if (for some reason) it takes more than a minute for the person to enter their response
Posted By: DaveC Re: wait for reponse before next question - 09/04/05 11:50 AM
Quote:
P.S.: If possible, I'd also like to include a timer of some kind so that if the person doesn't want to answer the question, all they have to do is wait for (say a minute) and then the bot will go to the next question automatically, but I don't want the bot to go to the next question if (for some reason) it takes more than a minute for the person to enter their response


And just by what means is this bot ment to know if the person has chosen not to answr or is currently writting something? Were not using AIM you know!

PS: I suggest you use $+(Desc.,$address) in place of just Desc, this well allow easy disecting of the string later
Posted By: RusselB Re: wait for reponse before next question - 09/04/05 01:37 PM
I didn't have a clue if there was some way of doing that or not, which is why I said "if possible"... and Yes, I do realize this isn't AIM....if it can't be done, then I'll simply include a message to the user telling them that they have one minute to completely answer the question...just thought it would be nice to have the other option, but I realized when I put it up, that it might not be possible.
Posted By: Riamus2 Re: wait for reponse before next question - 11/04/05 05:12 PM
One thing you may want to look at as well is to specify what kind of $address you want. Example, $address($nick,2). This lets you choose the format to use rather than the default. It will probably help you out later to pick one format that you feel is most appropriate for your needs.
Posted By: RusselB Re: wait for reponse before next question - 13/04/05 09:51 PM
For particular reasons I need to use the same format that $address uses...I've found that I can obtain that same format by using $gettok($address($2,5),2,33)

Although I don't understand how or why this is relevant to my original question...if it helps resolve the query, then there's the information
© mIRC Discussion Forums