Running patterns X amount of times

I posted an idea and or concept that you could sue to get your code doing the thing you want. I wrote that the code is untested and figured you'd be able to troubleshoot it. If you want help troubleshooting your efforts then post your efforts and describe the issue you ran into.