1

I cannot get this aiml script for calculationg how many days from this day till Monday.

I make chatbots on botlibre. I tried the code I am going to post.

<category> 
<pattern>HOW MANY DAYS UNTIL monday</pattern> 
<template> 
<interval> 
<jformat>ddddd </jformat> 
<style>days</style> 
<from><date jformat="ddddd"/></from> 
<to>saturday</to> 
</interval> 
days until saturday. 
</template> 
</category> 

I expect the aiml script to display in the chatbot response how many days until Monday.

that worked thanks i needed that. i made a chatbot named pioyu on botlibre that acquires likes,dislikes and opinion about why people like or dislike something. she makes them her own. That is how I make my chatbot seem more human. It could acquire sentences of things people have as well if they tell it and make them it's own.

1 Answers1

1

Ok, so first we need to know what day it is and set it in a predicate called "day". The format part is UNIX strftime and is explained here: https://devhints.io/datetime

We then check the value of "day" and can display a suitable response, including saying "day" rather than "days" when it's Sunday.

<category> 
<pattern>HOW MANY DAYS UNTIL MONDAY</pattern> 
<template> 
<think><set name="day"><date format="%A"/></set></think>
    <condition name="day">
        <li value="Monday">0 days </li>
        <li value="Tuesday">6 days </li>
        <li value="Wednesday">5 days </li>
        <li value="Thursday">4 days </li>
        <li value="Friday">3 days </li>
        <li value="Saturday">2 days </li>
        <li value="Sunday">1 day </li>
    </condition>
until Monday. 
</template> 
</category> 
Steve Worswick
  • 880
  • 2
  • 5
  • 11