Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local channel = 69
- local Peripherals = {
- MODEM = "top",
- DANDELIFEON = "bottom"
- }
- modem = peripheral.wrap(Peripherals.MODEM)
- local e, side, ch, replyCh, msg, dist
- local function listen()
- modem.open(channel)
- e, side, ch, replyCh, msg, dist = os.pullEvent("modem_message")
- if ch == channel then
- return true
- end
- return false
- end
- local function main()
- if listen() then
- if msg == "on" then
- redstone.setOutput("bottom", true)
- elseif msg == "off" then
- redstone.setOutput("bottom", false)
- end
- end
- end
- while true do
- main()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement