Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: chattable on June 12, 2022, 05:24:48 pm

Title: this chatbot responds differently after you have not inputted
Post by: chattable on June 12, 2022, 05:24:48 pm
Code
import os
import json
import random
import time
mytime = time.localtime() 
my_time = time.strftime("%B %d %Y %H:%M:%S", mytime)
###print(mytime)
myttime = []
for i in myttime:
   

 print(i, end="")

myttimez = mytime[5]
myttimek = str(myttimez)
 
talking = [
    "tell me a food you like eating",
    "tell me a tvshow you like to watch",
    "tell me a joke",
    "tell me a poem",
    "have you been having fun ",
    "have you played any games lately",
     
]
print (random.choice(talking)) 
 
##print(mytime[5])
isxa = "is a"
quest = "?"
applex = "apple"
fruitx = "fruit"
foodx = "food"
tastex = "taste"
whatx = "what"
doesx = "does"
applesd = "apple"
yoou = "you"
az = "a"
xix = []
xitimeb = ["01", "02", "03"]     
xitimec = ["01", "02", "03"]
xitimed = ["01", "02"]
tex = "axe"
thirtyer = []
sixtyer = []
tthirtyer = []
tstory = []
yesser = "yes"
x = []
a = 1
things = {'apple': {'name' : 'apple', 'living' : 'no', 'food' : 'yes', 'taste' : 'sweet'},
       'lemon': {'name' : 'lemon', 'living' : 'no', 'food' : 'yes', 'taste' : 'bitter'},
       'grape': {'name' : 'grape', 'living' : 'no', 'food' : 'yes', 'taste' : 'sweet'}}
things[4] = {'name' : 'carrot', 'living' : 'no', 'food' : 'yes', 'taste' : 'woody'}
###print(things[4])
del things[4]['taste']
del things['grape']['taste']
###print (things['grape'])
###print (things[4])
del things[4]
json_string = json.dumps(things)
###print(json_string)
hood = dict((new_val,new_k) for new_k,new_val in things['grape'].items()).get('yes')
###print("Dictionary search by value:",hood)
with open('names_of.json', 'w') as outfile:
    json.dump(json_string, outfile)
with open('names_of.json') as file_object:
        # store file data in object
        data = json.load(file_object)
        ###print(data)
        x  =  json.loads(data)   
       
        ###print(x)
        thinger =  random.choice(list(x.items()))
        ###print('see it')
        ###print(thinger)
start_time = time.time()       
my_dict = {}
b = ["/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/"] 
while True:
      user = input('enter a word')
       
     
      for i in myttime:
 

     

       
           myitime = time.localtime() 
           myi_time = time.strftime("%B %d %Y %H:%M:%S", myitime)
           ###print(myitime[5])
           viv = user.split()
           coo = viv + b
           tee = coo[0]
           tex = coo[1]
           tec = coo[2]
           tep = coo[3]
           tes = coo[4]
           tet = coo[5]
           ###print(x)
      if mytime.tm_hour < 6 or mytime.tm_hour > 17:
         
        xix.append("keep sleeping in her bed")
         
        print(xix)
        break
     
       
     



      elif isxa in user and foodx in user and applex in user and quest in user and yesser in (thirtyer and tstory) and yesser  in (sixtyer and tstory):
         print(x["apple"]["food"])
         xix.clear()


     
           
      elif whatx in user and doesx in user and tastex in user and applex in user and quest in user:
        print("a apple taste's")
        print(x['apple']["taste"])
        xix.clear()
      elif tex in x.keys():
       print('it is there')
       print(tex in x.keys())
       xix.clear()

      elif az in user and isxa in user:
       my_dict.update({tex:tes})
       print(my_dict)
       xix.clear()
      elif yesser in user:
       print("yes")
      elif yoou in user and quest in user:
       print("i am fine")
     

      else:
           print("i am sorry i do not understand")
      elapsed_time = time.time() - start_time
      start_time = time.time()
      mom = str(time.strftime("%M", time.gmtime(elapsed_time)))
      print(mom)
      def herresponse1():
          print('what are you thinking about')
          pass
      def herresponse2():   
          print('are you bored of me')
          pass
      def herresponse3():
          print('did you dose off?')
          pass
      what_she_says = [herresponse1,herresponse2,herresponse3]   
      she_says = random.choice(what_she_says)

      if mom in (xitimeb and xitimec):         
         she_says = random.choice(what_she_says)
         she_says()

         print(she_says)
         if mom in (xitimed and xitimec):
             os.system("thingermy.py")
  this chatbot says one of the follow. if you do not input
in two minutes or three minutes.             
what are you thinking about?
are you bored of me       
did you dose off?
Title: Re: this chatbot responds differently after you have not inputted
Post by: 8pla.net on June 12, 2022, 09:14:18 pm
What does the last line do, thingermy.py?

Title: Re: this chatbot responds differently after you have not inputted
Post by: chattable on June 13, 2022, 12:13:19 am
it restarts the python program after 2 minutes if you input then.
Title: Re: this chatbot responds differently after you have not inputted
Post by: MikeB on June 13, 2022, 07:04:40 am
An old chatbot called Rose used to do that as well. Not sure she's still around though, the link doesn't seem to work.

It takes a different kind of platform to allow the bot to post at will instead of only repond.
Title: Re: this chatbot responds differently after you have not inputted
Post by: chattable on June 13, 2022, 10:29:45 am
An old chatbot called Rose used to do that as well. Not sure she's still around though, the link doesn't seem to work.

It takes a different kind of platform to allow the bot to post at will instead of only repond.
i wonder why more people are not working on chatbots like these.
Title: Re: this chatbot responds differently after you have not inputted
Post by: MikeB on June 15, 2022, 05:52:57 am
You're building the platform as well as the bot. If you ask an existing platform to allow the bot to post at will they may say no due to spam risk... or allow one idle message only.

I don't know how you wouldn't have to do both at the same time...
Title: Re: this chatbot responds differently after you have not inputted
Post by: squarebear on June 15, 2022, 07:20:22 am
i wonder why more people are not working on chatbots like these.
Because a chatbot that chose to talk to you when it wished, would soon become annoying.
The toaster from the TV show Red Dwarf, which constantly asked if anyone wanted any toast is a good example of this.  ;D
https://www.youtube.com/watch?v=LRq_SAuQDec (https://www.youtube.com/watch?v=LRq_SAuQDec)
Title: Re: this chatbot responds differently after you have not inputted
Post by: chattable on June 15, 2022, 03:02:50 pm
i wonder why more people are not working on chatbots like these.
Because a chatbot that chose to talk to you when it wished, would soon become annoying.
The toaster from the TV show Red Dwarf, which constantly asked if anyone wanted any toast is a good example of this.  ;D
https://www.youtube.com/watch?v=LRq_SAuQDec (https://www.youtube.com/watch?v=LRq_SAuQDec)
i think it would not annoy everybody.me myself i love it.
Title: Re: this chatbot responds differently after you have not inputted
Post by: LOCKSUIT on June 15, 2022, 10:20:02 pm
GPT-3 to respond differently with time would need maybe video, not just text. Silence is in the video. Text, text is always text. Unless you record text chats and make no input time a Character/Word. Video solves all though, no need for that.
Title: Re: this chatbot responds differently after you have not inputted
Post by: chattable on June 16, 2022, 01:14:51 pm
GPT-3 to respond differently with time would need maybe video, not just text. Silence is in the video. Text, text is always text. Unless you record text chats and make no input time a Character/Word. Video solves all though, no need for that.
i don't want to pay to use that.besides it is restrictive.