Advertisement
100Toby1

Untitled

Oct 19th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 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.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. monitor.write(" \\ /__\\ /")
  47. monitor.setCursorPos(1,8)
  48. monitor.write(" __'-\\__/-'__")
  49. monitor.setCursorPos(1,9)
  50. monitor.write("- . . -")
  51. end
  52.  
  53. monitor.clear()
  54.  
  55. while true do
  56. drawFigure()
  57.  
  58. sleep(100)
  59. writeAndTalk("Enter the password, bitch")
  60.  
  61. local chatevent, player, message = os.pullEvent("chat")
  62.  
  63. if (rs.getInput("back")) then
  64. monitor.clear();
  65. monitor.setCursorPos(1,1)
  66.  
  67. if (message == "yolo") then
  68. writeAndTalk("Cool and good my dude")
  69. sleep(2)
  70. else
  71. writeAndTalk("Fuck you,")
  72. sleep(0.3)
  73. writeAndTalk("Did you really think it was")
  74. sleep(0.3)
  75. writeAndTalk("'" .. message .. "?'")
  76. sleep(2)
  77. end
  78. end
  79.  
  80. if (message == "end") then
  81. monitor.clear();
  82. monitor.setCursorPos(1,1)
  83. monitor.write("Bye.")
  84. os.sleep(1)
  85. monitor.clear()
  86. os.exit(0)
  87. end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement