Tokensoup

Tokensoup

Joined
Jan 02, 2008

Activity Stream

Tokensoup commented on a Page, $lentok()  -  Jan 03, 2008

Snippet updated.

Any other input I can get would be great.

Regards.

 Respond  
Tokensoup commented on a Page, $lentok()  -  Jan 03, 2008

Thanks for your input Rebellious :D

I\'m updating the snippet right now.

 Respond  
Tokensoup created a Page  -  Jan 03, 2008
138 

$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..

Tokensoup commented on a Page, Weather Bot  -  Jan 02, 2008

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.

 Respond  
Tokensoup commented on a Page, Weather Bot  -  Jan 02, 2008

@ Scakk, with the alias you just added, it would be much more sufficient to include error checking; or, alternatively, echo it to the active window. Just to solve that problem.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.