Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("bottom")
- local interval = 30
- os.queueEvent("timer")
- while true do
- local ev, p1, p2 = os.pullEvent()
- if ev == "timer" then
- os.startTimer(interval)
- end
- if ev == "rednet_message" then
- local tbl = {}
- print("Message:"..p2)
- for i in string.gmatch(p2,"%S+") do
- table.insert(tbl,i)
- end
- if tbl[1] == os.getComputerLabel() then
- if tbl[2] == "on" then
- rs.setOutput("top",true)
- end
- if tbl[2] == "off" then
- rs.setOutput("top",false)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement