|
Joined: Apr 2005
Posts: 53
Babel fish
|
OP
Babel fish
Joined: Apr 2005
Posts: 53 |
How can i write some kind of ident resolver. I want the script that will echo me a user's ident when he joins a channel. I don't want to display host or something. That's how it should look like: * NICK has ident IDENT - so if the nick's host is nick!soldier@somehost.info it would only return "soldier" in echo function. Thank you
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
For use on its own, address must be in full nick!ident@host format.
Syntax: /getident <address> Syntax: $getident(address) Alias getident { return $gettok($gettok($1,2,33),1,64) }
For use in an event. $remove($gettok($address,1,64),$chr(126))
Example: on *:JOIN:#: echo $target $nick has ident: $remove($gettok($address,1,64),$chr(126))
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Your event version missed one of the $gettoks $remove($gettok($gettok($address,2,33),1,64),$chr(126)) on *:join:#: echo $chan $nick has ident: $remove($gettok($gettok($address,2,33),1,64),$chr(126))
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
Nope, the second gettok is not needed in an event as $address, when used in events, returns in the format ~ident@host without the nickname portion (since that is placed in $nick).
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Lol... Right. Go ahead and smack me.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jan 2004
Posts: 509
Fjord artisan
|
Fjord artisan
Joined: Jan 2004
Posts: 509 |
To return your ident, you can //echo -a $gettok($gettok($address($me,5),2,33),1,64) (or) $deltok($gettok($address($me,5),1,64),1,33).
And to put that into an alias, replace $me with $1.
Anyone got any alternate ways?
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
//echo -a $gettok($right($address(<nick>,0),-2),1,64)
|
|
|
|
|