Advertisement
100Toby1

Untitled

Oct 19th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 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(open)
  32. monitor.clear()
  33. monitor.setCursorPos(1,1)
  34. monitor.write(" |\\ /|")
  35. monitor.setCursorPos(1,2)
  36. monitor.write(" | \\ / |")
  37. monitor.setCursorPos(1,3)
  38. monitor.write(" '_^''^_'")
  39. monitor.setCursorPos(1,4)
  40. monitor.write(" /__/// \\")
  41. monitor.setCursorPos(1,5)
  42. monitor.write(" |[]--[]|")
  43. monitor.setCursorPos(1,6)
  44. monitor.write(" | __ |")
  45. monitor.setCursorPos(1,7)
  46. if open then
  47. monitor.write(" \\ /__\\ /")
  48. monitor.setCursorPos(1,8)
  49. monitor.write(" __'\\__/'__")
  50. else
  51. monitor.write(" \\ /--\\ /")
  52. monitor.setCursorPos(1,8)
  53. monitor.write(" __'\\^^/'__")
  54. end
  55. monitor.setCursorPos(1,9)
  56. monitor.write(" - . . -")
  57. end
  58.  
  59. monitor.clear()
  60.  
  61. while true do
  62. while true do
  63. drawFigure(false)
  64. sleep(0.5)
  65. drawFigure(true)
  66. sleep(0.5)
  67. end
  68. writeAndTalk("Enter the password, bitch")
  69.  
  70. local chatevent, player, message = os.pullEvent("chat")
  71.  
  72. if (rs.getInput("back")) then
  73. monitor.clear();
  74. monitor.setCursorPos(1,1)
  75.  
  76. if (message == "yolo") then
  77. writeAndTalk("Cool and good my dude")
  78. sleep(2)
  79. else
  80. writeAndTalk("Fuck you,")
  81. sleep(0.3)
  82. writeAndTalk("Did you really think it was")
  83. sleep(0.3)
  84. writeAndTalk("'" .. message .. "?'")
  85. sleep(2)
  86. end
  87. end
  88.  
  89. if (message == "end") then
  90. monitor.clear();
  91. monitor.setCursorPos(1,1)
  92. monitor.write("Bye.")
  93. os.sleep(1)
  94. monitor.clear()
  95. os.exit(0)
  96. end
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement