Advertisement
100Toby1

Untitled

Oct 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. speaker = peripheral.wrap("top")
  2. monitor = peripheral.wrap("right")
  3. chatbox = peripheral.wrap("bottom")
  4.  
  5. function centerText(text)
  6. local x,y = monitor.getSize()
  7. local x2,y2 = monitor.getCursorPos()
  8.  
  9. monitor.setCursorPos(math.ceil((x/2)-(text:len()/2)), y/2)
  10. monitor.write(text)
  11. end
  12.  
  13. function writeSlow(text)
  14. local str = ""
  15. for i=0, text:len() do
  16. str = str .. string.sub(text,i,i)
  17. centerText(str)
  18. if (string.sub(text,i,i) == " ") then
  19. sleep(0.1);
  20. end
  21. sleep(0.05);
  22. end
  23. end
  24.  
  25. function writeAndTalk(text)
  26. monitor.clear()
  27. speaker.speak(text)
  28. writeSlow(text)
  29. end
  30.  
  31. function drawFigure()
  32. monitor.clear()
  33. monitor.setCursorPos(1,1)
  34. monitor.write(" |\\ /|")
  35. monitor.write(" | \\ / |")
  36. monitor.write(" '_-^''^-_'")
  37. monitor.write(" /___//// \\")
  38. monitor.write(" | []--[]-|")
  39. monitor.write(" \\ /__\ /")
  40. monitor.write(" __'-\__/-'__")
  41. monitor.write("- . . -")
  42. end
  43.  
  44. monitor.clear()
  45.  
  46. while true do
  47. drawFigure()
  48.  
  49. sleep(5)
  50. writeAndTalk("Enter the password, bitch")
  51.  
  52. local chatevent, player, message = os.pullEvent("chat")
  53.  
  54. if (rs.getInput("back")) then
  55. monitor.clear();
  56. monitor.setCursorPos(1,1)
  57.  
  58. if (message == "yolo") then
  59. writeAndTalk("Cool and good my dude")
  60. sleep(2)
  61. else
  62. writeAndTalk("Fuck you,")
  63. sleep(0.3)
  64. writeAndTalk("Did you really think it was")
  65. sleep(0.3)
  66. writeAndTalk("'" .. message .. "?'")
  67. sleep(2)
  68. end
  69. end
  70.  
  71. if (message == "end") then
  72. monitor.clear();
  73. monitor.setCursorPos(1,1)
  74. monitor.write("Bye.")
  75. os.sleep(1)
  76. monitor.clear()
  77. os.exit(0)
  78. end
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement