Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local sides = require("sides")
- local wirelress = component.modem
- local redstone = component.redstone
- local port = 904
- local singal = false
- local on = 15
- local off = 0
- local running = true
- function setRedstone()
- if signal then
- redstone.setOutput(sides.north, on)
- else
- redstone.setOutput(sides.north, off)
- end
- end
- setRedstone()
- while running do
- local _, _, from, port, _, command, value = event.pull("modem_message")
- if command == "redstone" then
- wireless.broadcast(port, signal)
- elseif command == "set" then
- signal = value
- setRedstone()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement