Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Times = {6.00,21.00}
- local Open = false
- local Connected = nil
- function Loop()
- peripheral.find("modem",rednet.open)
- GateControl()
- while true do
- local id, message = rednet.receive()
- if Connected ~= nil and id == Connected then
- if message == "open" then
- Open = true
- GateControl()
- elseif message == "close" then
- Open = false
- GateControl()
- end
- elseif Connected == nil then
- if Open == false os.time() > Times[1] and os.time() < Times[1] then
- Open = true
- GateControl()
- elseif Open == true
- Open = false
- GateControl()
- end
- end
- end
- end
- function GateControl()
- redstone.setOutput("bottom",Open)
- end
- Loop()
Add Comment
Please, Sign In to add comment