Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- speaker = peripheral.wrap("top")
- monitor = peripheral.wrap("right")
- chatbox = peripheral.wrap("bottom")
- function centerText(text)
- local x,y = monitor.getSize()
- local x2,y2 = monitor.getCursorPos()
- monitor.setCursorPos(math.ceil((x/2)-(text:len()/2)), y/2)
- monitor.write(text)
- end
- function writeSlow(text)
- local str = ""
- for i=0, text:len() do
- str = str .. string.sub(text,i,i)
- centerText(str)
- if (string.sub(text,i,i) == " ") then
- sleep(0.1);
- end
- sleep(0.05);
- end
- end
- function writeAndTalk(text)
- monitor.clear()
- speaker.speak(text)
- writeSlow(text)
- end
- function drawFigure()
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write(" |\\ /|")
- monitor.setCursorPos(1,2)
- monitor.write(" | \\ / |")
- monitor.setCursorPos(1,3)
- monitor.write(" '_-^''^-_'")
- monitor.setCursorPos(1,4)
- monitor.write(" /___//// \\")
- monitor.setCursorPos(1,5)
- monitor.write(" | []--[]-|")
- monitor.setCursorPos(1,6)
- monitor.write(" \\ /__\\ /")
- monitor.setCursorPos(1,7)
- monitor.write(" __'-\__/-'__")
- monitor.setCursorPos(1,8)
- monitor.write("- . . -")
- end
- monitor.clear()
- while true do
- drawFigure()
- sleep(5)
- writeAndTalk("Enter the password, bitch")
- local chatevent, player, message = os.pullEvent("chat")
- if (rs.getInput("back")) then
- monitor.clear();
- monitor.setCursorPos(1,1)
- if (message == "yolo") then
- writeAndTalk("Cool and good my dude")
- sleep(2)
- else
- writeAndTalk("Fuck you,")
- sleep(0.3)
- writeAndTalk("Did you really think it was")
- sleep(0.3)
- writeAndTalk("'" .. message .. "?'")
- sleep(2)
- end
- end
- if (message == "end") then
- monitor.clear();
- monitor.setCursorPos(1,1)
- monitor.write("Bye.")
- os.sleep(1)
- monitor.clear()
- os.exit(0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement