Advertisement
ecco7777

CC mini chatbot

Mar 6th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. c=peripheral.wrap("top")
  2. i=1
  3. owner="ecco7777"
  4. name="Helmut"
  5. dialog={
  6. "sag hallo","hallo",
  7. "wie geht es dir?","gut",
  8. "","",
  9. "","",
  10. "","",
  11. "","",
  12. "","",
  13. "",""}
  14. while true do
  15. e,player,message = os.pullEvent("chat")
  16. i=1
  17. while dialog[i]~= nil do
  18. if player==owner and message==name.." "..dialog[i] then
  19. s.say(name..": "..dialog[i+1])
  20. end
  21. i=i+2
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement