Use the code Rock gave you.

And this is why your script froze when you tried it...

You set the %usernick to $nick. So it was the nickname, not the length of the nickname. That's what $len is for. So your While statement checked to see if the nickname (not the length of it) was more than 15 characters. Because of how comparisons work, if you try to check < or > between a number and a word/nick/text, it will always be true. And because you used a While statement, it would keep looping forever. It's much better to use If instead of While if you aren't actually trying to loop through something multiple times.

Btw, you can usually break out of a frozen state by using Ctrl-Break rather than using Ctrl-Alt-Del. Sometimes you'll need to hit it a few times, but it usually works... especially in a case where you're frozen because of a broken loop.


Invision Support
#Invision on irc.irchighway.net