1. It helps if you give an idea what the problem is, so people know where to look. If you add a few lines like
//echo -s $scriptline optional variables
You can see if your code is making it inside if() statements when it should, etc.
2. You didn't report a problem of seeing "no such connection number" error in your status window, so we don't know if you just didn't notice the error, or if the code isn't reaching that point, but the line
scon $scon(%i)
should be
scon %i
3. Your read statement should also use the 'n' switch so that lines containing $identifiers don't get executed.
4. Also, switches are ALWAYS case sensitive, so if the helpfile mentions switch 'w' but not 'W', don't use 'W'. In this case, by using a non-existent switch, you're getting line#1 each time, even if it doesn't contain any text.
Edit to add #5
5. Once you've found which connection has your destination channel, use /break to avoid wasting time continuing to search through the rest of the connections.
Last edited by maroon; 22/06/17 02:51 PM.