xXm0dzXx

Untitled

May 31st, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. local messages = {}
  2. local keywords =
  3. {
  4. "Hi", "Hello", "Hey", "Hello", "Noob", "Right back at ya", "Goodbye", "Cya", "do","end","function","while","repeat","until","if","then","elseif","then","else","for","in","local","return","break",
  5. "nil","false","true",
  6. "%.%.%.","==","~=","%.%.","<=",">=","and","or","not",
  7. "[-+;.:+*/,=%[%]%(%)%<%>%^%%#{}]", ">.<", "<_>", "O_o",
  8. "I know, that was my reaction too!", "Fart", "*toot*"
  9. }
  10.  
  11. --Format:
  12. --"What you say", "What they say"
  13.  
  14. rednet.open("right")
  15.  
  16. while true do
  17. term.clear()
  18. term.setCursorPos(1,1)
  19. print("SmartTurtle v1.0")
  20. local x,y = term.getSize()
  21. print("\nTurtle: Hello.")
  22. for i = 1,#messages do
  23. print(messages[i])
  24. end
  25. term.setCursorPos(1,y)
  26. write("> ")
  27. input = read()
  28. messages[#messages+1] = "- You: " ..input
  29. term.setCursorPos(1,#messages+4)
  30. write("- You: " ..input)
  31. rednet.broadcast(input)
  32. term.setCursorPos(1, y-1)
  33. term.clearLine()
  34. term.setCursorPos(1, y)
  35. print("Waiting...")
  36. repeat
  37. id, message = rednet.receive()
  38. until id == 324
  39.  
  40. messages[#messages+1] = "Turtle: " ..message
  41. end
Advertisement
Add Comment
Please, Sign In to add comment