see more from the shoots! NSFW

Python – Endless Chat

Something I made like a year ago which could be a simple AI with database, string parsing, and storing responses.

You could be a total rookie with Python and code this simple script in 1-2 hours of study. Main things you will learn or need to learn are listed below.

  1. Importing modules, in this case the random module
  2. Creating variables like myChat = myChat + 1
  3. Creating a list with strings of text like our mySlang = [‘text’, ‘in quotes’, ‘are strings’]
  4. While loop ours is, while True:
  5. if elif else, this is one of the most used things in programming to make conditionals
  6. Using input(‘Some message indicating you need input: ‘)
  7. Using print(‘Stuff to print to screen’)
# Simple first endless chat script by Ryan Burleson
# Use 'stop' to end the chat.
import random
mySlang = [
    'hell nah!',
    'too boring...',
    'who df you?',
    'how much you paying?',
    'maybe later!',
    'fine, sup brah!',
    'its about time',
    'lets hit the club first..',
    'always the same shit...'
    'let\'s get to the good stuff'
myChat = 0
while True:
    myChat = myChat + 1
    if myChat == 1:
        chat = input('What you wanna chat about?')
        print('Ok we can talk about:', chat)
    elif chat == 'stop':
        quit('Ok you are the boss (for now) we shall end this! Chatted ' + str(myChat) + ' times.')
    elif chat == '':
        quit('You forgot stuff bruh, don\'t play with me! Chatted ' + str(myChat) + ' times.')
    elif myChat > 1:
        chat = input('Now what you want?')
    print(str.capitalize(chat), random.choice(mySlang))

Results, me typing stupid shit and no real checking of string input so its just dumb. This is like many web bots you see on reddit or other places online. Chatting with the script is like some people I know, clueless.

=============== RESTART: ===============
What you wanna chat about?Fine ass babes
Ok we can talk about: Fine ass babes
Fine ass babes hell nah!
Now what you want?Where they at?
Where they at? its about time
Now what you want?Gime their numbers
Gime their numbers how much you paying?
Now what you want?Bro you drunk?
Bro you drunk? how much you paying?
Now what you want?Nothing
Nothing hell nah!
Now what you want?

Leave a Comment