Rope is a complex object which is reality is fairly simple. If we look closely at rope, we notic strands wrapping around in a coil, around the axis of the piece of rope. Looking at these strands, we see that they are made up of smaller strands. Typically, rope is made up of between three and eight layers of strands, each one wrapping together the smaller one for more strength. Thus, we can think of a shader to created rope as a number of layers containing rounded ridges which twist around the piece of rope.

To produce the rounded ridges, we can simply use abs(sin(x)). X should be either s or t so that the rope conforms to the surface of the object.

To create the twisting pattern around the rope object, we need to increment x according to y. In other words, say our ridges go along abs(sin(s)), then our pattern should be offset more and more as t increases. This gives us the formula abs(sin(s*F +t)) which creates diagonal lines.
Next, we use the preceding formula as a displacement map and put it in a for loop to create layers of detail.