Here is a paragraph from Feynman lecture about conservation of energy:
Consider weight-lifting machines—machines which have the property that they lift one weight by lowering another. Let us also make a hypothesis: that there is no such thing as perpetual motion with these weight-lifting machines. (In fact, that there is no perpetual motion at all is a general statement of the law of conservation of energy.) We must be careful to define perpetual motion. First, let us do it for weight-lifting machines. If, when we have lifted and lowered a lot of weights and restored the machine to the original condition, we find that the net result is to have lifted a weight, then we have a perpetual motion machine because we can use that lifted weight to run something else. That is, provided the machine which lifted the weight is brought back to its exact original condition, and furthermore that it is completely self-contained—that it has not received the energy to lift that weight from some external source—like Bruce’s blocks.
I do not understand his definition of perpetual motion. On the one hand, he says that "If, when we have lifted and lowered a lot of weights and restored the machine to the original condition, we find that the net result is to have lifted a weight, then we have a perpetual motion machine", so we lift and lower the weights, which means the machine received energy from the outside.
On the other hand, he says that this is true provided that the machine has not received the energy from an external source.
So what does he mean?