$lentok() generates a sorted list of tokens based on length. From this list of tokens, you specify N to return the Nth token (the syntax imitating that of $gettok [e.g 1-2 or 1- or 1]). Comes with a commented version, for educational purposes, or a non commented version for those of you who don't need comments.Syntax $lentok(string,N,C)[.lrp] (Each property is optional)l returns the length of the Nth..
Oh, what I meant by my previous comment was, a user will receive errors if they don\'t send this to the active channel. What I would do for /weatherm is something like this:
alias weatherm {
if ($1 isnum) && ($len($1) == 5) && ($active ischan) {
weather $1 | set %we.chan $chan }
elseif ($active !ischan) { echo -a Invalid window. (Use a channel window) }
else {
echo -a Incorrect zip code format.
}
}
Giving the user information on the proper use of the alias. Or you can have your socket echo the information into the active window instead of msging to %we.chan if the active window isn\'t a channel.