Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- if (modem == nil) then
- print("no modem link")
- return
- end
- modem.open(0)
- local upState = false
- local function switch()
- redstone.setOutput("top",upState)
- upState = ~upState
- end
- local function redstoneCheck()
- while true do
- os.pullEvent("redstone")
- printf("redstone")
- switch()
- end
- end
- local function modemcheck()
- while true do
- local event, modemSide, senderChannel,
- replyChannel, message, senderDistance = os.pullEvent("modem_message")
- switch()
- printf("modem")
- end
- end
- parallel.waitForAny(redstoneCheck,modemcheck)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement