Hi guys,

I need to add a condition to some code I have to add aliases to the channel access list via ChanServ.

When I add a nickname, if the nickname format is: nick* or nick!, I need it to return the following:

nick* -- returns: nick*!*@
nick! -- returns: nick!*@*

But I'm having a small problem.
If I type:

/addnick nick!* -- returns: nick*!*@
or
/addnick nick*! -- returns: nick!*@*

What I want is for it to read the first character on the right and not the last.

Code
alias addnick {
  if ($1) {
    if ($right($1,1) == $chr(42)) { echo -sg Returns: $remove($1,$chr(42),$chr(33)) $+ *!*@* }
    elseif ($right($1,1) == $chr(33)) { echo -sg Returns: $remove($1,$chr(33),$chr(42)) $+ !*@* }
    else { echo -sg Returns: $1 }
  }
}

I would appreciate any help anyone can give me.


TECO
irc.PTirc.org (Co-Admin)