Please make sure the title you enter for the question describes the context of your request. The title you entered, "Can you convert an indicator to a scanner?", can apply to just about anything. If that was truly your question the answer would be yes.
However when you include the context in the title of the question then everyone knows exactly what your question is about. This will help other viewers searching for a solution to find your post and perhaps provide some helpful feedback. Otherwise, they are likely to pass on buy without even taking a peak.
The code from the post you linked in the body of your question uses the ZigZag study. These studies are completely useless so make sure you avoid using them. They cannot be used for any scan because their signals are repainted as new bars are added to the chart. The simplest way to describe them is that they plot perfect signals by reading the future. 100% snake oil. Wish they had never been invented and really wish they would ban this sort of garbage on the trading platform.