Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("top")
- modem.open(1)
- res = -1
- function maint()
- if res == 0 then
- print("MAINT")
- redstone.setBundledOutput("right", 16384)
- res = -1
- else
- print("Basement 1")
- redstone.setBundledOutput("right", 0)
- res = -1
- end
- end
- function fll1()
- if res == 0 then
- print("Lobby")
- redstone.setBundledOutput("right", 32)
- res = -1
- else
- print("FLOOR1")
- redstone.setBundledOutput("right", 8192)
- res = -1
- end
- end
- function fl23()
- if res == 0 then
- print("FLOOR2")
- redstone.setBundledOutput("right", 1)
- res = -1
- else
- print("FLOOR3")
- redstone.setBundledOutput("right", 8)
- res = -1
- end
- end
- function fl45()
- if res == 0 then
- print("FLOOR4")
- redstone.setBundledOutput("right", 4)
- res = -1
- else
- print("FLOOR5")
- redstone.setBundledOutput("right", 16)
- res = -1
- end
- end
- while true do
- event, side, frequency, replyFrequency, message, distance = os.pullEvent("modem_message")
- if message == "b1" then
- res = 1
- maint()
- end
- if message == "maint" then
- res = 0
- maint()
- end
- if message == "lobby" then
- res = 0
- fll1()
- end
- if message == "one" then
- res = 1
- fll1()
- end
- if message == "two" then
- res = 0
- fl23()
- end
- if message == "three" then
- res = 1
- fl23()
- end
- if message == "four" then
- res = 0
- fl45()
- end
- if message == "five" then
- res = 1
- fl45()
- end
- end
Add Comment
Please, Sign In to add comment