Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("top")
- modem.open(697)
- modem.open(666)
- function Working()
- modem.transmit(666,666,"hi")
- end
- local openlist = {false, false, false, false, false}
- local side = "left"
- while true do
- redstone.redstone.setBundledOutput(side, 0)
- local event, shit, shit2, shit3, message = os.pullEvent("modem_message")
- message = tonumber(message)
- print(message)
- if message == 1 then
- if openlist[1] == false then
- Working()
- openlist[1] = true
- redstone.setBundledOutput(side, colors.white)
- sleep(7)
- Working()
- else
- Working()
- openlist[1] = false
- redstone.setBundledOutput(side, colors.lime)
- sleep(7)
- Working()
- end
- elseif message == 2 then
- if openlist[2] == false then
- Working()
- openlist[2] = true
- redstone.setBundledOutput(side, colors.orange)
- sleep(7)
- Working()
- else
- Working()
- openlist[2] = false
- redstone.setBundledOutput(side, colors.pink)
- sleep(7)
- Working()
- end
- elseif message == 3 then
- if openlist[3] == false then
- Working()
- openlist[3] = true
- redstone.setBundledOutput(side, colors.magenta)
- sleep(7)
- Working()
- else
- Working()
- openlist[3] = false
- redstone.setBundledOutput(side, colors.gray)
- sleep(7)
- Working()
- end
- elseif message == 4 then
- if openlist[4] == false then
- Working()
- openlist[4] = true
- redstone.setBundledOutput(side, colors.lightBlue)
- sleep(7)
- Working()
- else
- Working()
- openlist[4] = false
- redstone.setBundledOutput(side, colors.lightGray)
- sleep(7)
- Working()
- end
- elseif message == 5 then
- if openlist[5] == false then
- Working()
- openlist[5] = true
- redstone.setBundledOutput(side, colors.yellow)
- sleep(7)
- Working()
- else
- Working()
- openlist[5] = false
- redstone.setBundledOutput(side, colors.cyan)
- sleep(7)
- Working()
- end
- elseif message == 6 then
- Working()
- for i=1,5 do
- openlist[i] = true
- end
- redstone.setBundledOutput(side, colors.combine(colors.white,colors.orange,colors.magenta,colors.lightBlue,colors.yellow))
- sleep(7)
- Working()
- else
- print("Bigg ass error!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement