Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- --------------------
- local doorLocation = "left"
- local doorTime = 2
- local channel = 20
- local modem = peripheral.wrap("back")
- --------------------
- modem.open(channel)
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter Password:")
- input = read("*")
- modem.transmit(channel, channel, input)
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if message == "accepted" then
- redstone.setOutput(doorLocation, true)
- sleep(doorTime)
- redstone.setOutput(doorLocation, false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement