Tornar-se um bot de prestador de serviço com o Bot Libre Nuvem Bot Plataforma
Bot Libre Forum

chatbot is not saying the correct time

por bobred postado Jun 27 2018, 12:40

pioyu2 chatbot is not telling me the correct is the aiml script I am using.timer time.txt

by admin posted Jun 28 2018, 7:31
What response do you get from the bot, and what response do you expect?

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1040, today: 0, week: 4, month: 23

by bobred posted Jun 28 2018, 9:05

i want pioyu2 chatbot to say the time in texas it is currently.

it's response to the question what time it is is the locale time is:9: AM. when it is actually 7 am.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1014, today: 0, week: 4, month: 26

by admin posted Jul 3 2018, 11:09

The local is not the timezone, it just affects how the date is printed.

To set the timezone of the date use the "timezone" attribute set to the GMT hour offset.

<date format="%I: %p" timezone="+2" locale="en_US"/>

You can also use Self to print a date, even from AIML,

<template>The local time is: <self>Date.setTimeZone(Date.time(), "EST")</self></template>

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1082, today: 1, week: 3, month: 34

by tpranara posted Jul 1, 8:16

Is there support for (GMT+9.30). Often there is only support for whole numbers. Adelaide, Australia is between +9 and +10. Since the bot I am making is only for myself, it defeats the purpose of time if It can only give me the time in Perth, or Melbourne, or Sydney, or Canberra.



Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 304, today: 1, week: 6, month: 40

by admin posted Jul 1, 19:06
You can use the Self code,

Date.setTimeZone(Date.time(), "GMT+9:30")

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 312, today: 1, week: 6, month: 46

by tpranara posted Jul 2, 0:32

This is still not working.





My bot was built using the basic template, but I deleted most of the self scripts as I was wanting NOTHING to over ride my aiml files. I was going to keep the DateAndTime script but since that was not giving the outputs I want, I deleted that too.


This is my AIML file, and I want every iota of it to work, without some other 'not by me' defined response given. I was testing this script yesterday without any changes, and with the DateAndTime self script in; even though it was giving me a non Australian country, and I was sure greetings were being given that was not in my aiml script. Do I have to delete EVERY self script to ensure only my aiml categories are used are used?


Currently these are the only self scripts I have running:


active scripts.jpg


My AIML script. I have commented out most of it, for testing purposes, but I do want it to ALL work.




This was originally an aiml file. Why was it changed when I exported it?

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 306, today: 1, week: 6, month: 41

by tpranara posted Jul 2, 3:09

I finally found where all these erroneous reponses were coming from: training and chatlogs.

After some more testing, I removed my commented out code from salutaitons.aiml and tried again, now that training and chatlogs were no longer interfering with my responses.


Problem now is, Adelaide is supposed to be GMT+9:30, but that was still giving me the wrong time, a whole hour fast. So I fixed the problem with +8:30. It works, but it is still wrong as it's not +9:30.  Putting in GMT+9:30 didn't help.


<pattern>What time is it</pattern>
<li>The time is currently </li>
<li>It is currently </li>
<li>The time is </li>
<li>It is </li>
<li>Its </li>
<date timezone="+8:30" format="%I:%M%p"/> right now.


I tried using Date.setTimeZone(Date.time(), "GMT+9:30") but it seems that can't used as a replacement for <date timezone="+8:30" format="%I:%M%p"/>, as it was assumed that I knew how to use it.

Any insight in why +9:30 was producing wrong time 5:1PM instead of 4:1PM?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 329, today: 1, week: 7, month: 49

by admin posted Jul 2, 10:53

The issue seems to be with the format="%I".
For some reason we were adding 1 to the hour. We will update this.
If you use Self, jformat or format="%X" it will have the correct hour.

<template><date timezone="+4" format="%I:%M%p"/> -- <date timezone="+4" format="%X"/> -- <self>Date.setTimeZone(Date.time(), "GMT+4")</self></template>

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 317, today: 1, week: 6, month: 46

Id: 22624204
Tags: aiml
Postado: Jun 27 2018, 12:40
Respostas: 8
Pontos de vista: 1529, hoje: 1, semana: 8, mês: 55
Eu tenho certeza que
Bandeira post como ofensivas, ou em violação das regras do site