Advertisement
minimite

clevertalk

Mar 16th, 2015
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. print("Initializing..")
  2. if not fs.exists("cleverbot") then
  3.   print("Downloading cleverbot API..")
  4.   shell.run("pastebin", "get", "Dv9x1ppc", "cleverbot")
  5. end
  6. print("Loading API..")
  7. os.loadAPI("cleverbot")
  8. print("Creating bot1..")
  9. local bot1 = cleverbot.Cleverbot.new()
  10. print("Creating bot2..")
  11. local bot2 = cleverbot.Cleverbot.new()
  12. local message = ""
  13. local response = ""
  14. write("What will Bot1 say first? ")
  15. local starter = read()
  16.  
  17. print("Starting conversation!")
  18. sleep(1)
  19. term.clear()
  20. term.setCursorPos(1,1)
  21. print("Bot1: " .. starter)
  22. response = bot1:send(starter)
  23. print("Bot2: " .. response)
  24. while true do
  25.   message = bot1:send(response)
  26.   print("Bot1: " .. message)
  27.   response = bot2:send(message)
  28.   print("Bot2: " .. response)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement