Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Light Control v1
- -- Requires Spawner Control v1
- rednet.open("back")
- local id, msg, prot
- local stat = rs.getOutput("top")
- local data
- local tOutputs = {
- ["lightsCheck"] = function()
- rednet.send(id, stat)
- end,
- ["lightsOn"] = function()
- rs.setOutput("top", false)
- stat = rs.getOutput("top")
- rednet.send(id, stat)
- end,
- ["lightsOff"] = function()
- rs.setOutput("top", true)
- stat = rs.getOutput("top")
- rednet.send(id, stat)
- end
- }
- while true do
- id, msg, prot = rednet.receive()
- stat = rs.getOutput("top")
- if tOutputs[msg] ~= nil then
- tOutputs[msg]()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement