local observer = "left" local rsSwitch = "right" local xEndstop = "back" local yEndstop = "bottom" local rsOut = "top" local out = 0 while true do os.pullEvent("redstone") if rs.getInput(xEndstop) then out=3 elseif rs.getInput(yEndstop) then out=4 elseif rs.getInput(observer) then out=1 elseif rs.getInput(rsSwitch) then out=2 else out=0 end rs.setAnalogOutput(rsOut, out) end