AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Pandorabots - grappling with conflict between <srai> and <that>
 
 

Hi there - I haven’t posted here for quite a few years.  During Covid lockdown, I decided to revive an old project of mine which was a Second Life/Pandorabot.  I was surprised to find that quite a few people in SL were still using my bots and there was daily activity in my logs.  So I set about doing a bit of development work on an idea for setting up a reminder system.  Here I hit a snag that I’m sure I saw years ago and I think I solved it back then with the use of topics but I can’t get my head around it.  I’ll try and describe the problem briefly.

The trigger category is ADD REMINDER. This asks the user if they would like to set up a reminder.

<category>
<
pattern>ADD REMINDER</pattern><template>Would you like to set up a future reminder (y/n)?</template></category

A ‘y’ answer invites the user to enter the future date.

<category><pattern>Y</pattern><that>Would you like to set up a future reminder (y/n)</that><template>OK.  What date should the reminder be sentFormat MM/DD/YY (for example 12/25/20 for December 25th 2020)</template></category
<category><pattern>_ _ _</pattern>
<
that>Format MM/DD/YY (for example 12/25/20 for December 25th 2020)</that>
<
template><think>mm=<set name="mm"><star/></setdd=<set name="dd"><star index="2"/></setyy=<set name="yy"><star index="3"/></set></think>
<
srai>CHKDATE</srai
DATE VALID
[some code to go here to get the time that the reminder should be sent with error checking]
</template>
</
category

The routine CHKDATE does a lot of error checking to make sure the entered date is valid. If there are no errors then everything works fine.  But if an error is found, the user is informed of the error and invited to resubmit with final part of the error message “Ready to try again (y/n)?” which is intended to start the process again.

<category><pattern>Y</pattern><that>Ready to try again (y/n)?</that><templateOKEnter the date again.   Format MM/DD/YY (for example 12/25/20 for December 25th 2020)</template></category>. 

  This last sentence is meant to direct the user back to the ‘_ _ _’ category above.

My problem is that “<that>Ready to try again (y/n)?</that>” fails to pick up the ‘y’ answer because when the program returns from the <srai>chkdate</srai> error routine, the text ‘DATE VALID’ becomes the last thing the bot says and so the “<that>Ready to try again (y/n)?</that>” is missed.

Been going round in circles for a few hours trying to solve this so thought I’d reach out to the forum as this must be a common problem.  Grateful for any suggestions to solve this.  Thanks.

 

 

 

 

 
  [ # 1 ]

I managed to solve the problem.  Its a bit non-intuitive but the answer was to include the the <srai>CHKDATE</srai> inside a condition test before the </li> rather than after the </condition>.  If anyone wants a fuller explanation then you can contact me and I’ll send the full aiml file.

 

 
  login or register to react