Nice regsubex sunslayer :)
I call that the WorldDMT trick cause that's where I learned it.
If someone doesn't understand how it works, a string of .(dots) is created based on the number of channels. So if there are 7 channels it's like this -->> .......
You use /./g to make it find all matches of the .(dot)
Each time it finds a .(dot) it will do a substitution, so you can use \n inside of $chan() - ie $chan(\n) to return each channel because \n will return the number of the current match or .(dot)
It's a sweet shortcut that can save lots of time and replace a lot of code.