Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inputTop = "top"
- local inputRight = "right"
- local outputLeft = "left"
- local statoPorta = false
- local function apriPorta()
- statoporta = false
- rs.setOutput(outputLeft, false)
- end
- local function chiudiPorta()
- statoporta = true
- rs.setOutput(outputLeft, true)
- end
- while true do
- if rs.getInput(inputTop) then
- if statoporta then
- apriPorta()
- end
- while rs.getInput(inputTop) do
- sleep(0.1)
- end
- sleep(1)
- chiudiPorta()
- elseif rs.getInput(inputRight) then
- if not statoporta then
- chiudiPorta()
- end
- while rs.getInput(inputRight) do
- sleep(0.1)
- end
- sleep(4)
- apriPorta()
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment