# $EPIC: userhost_function.txt,v 1.5 2006/08/30 21:02:47 sthalik Exp $
$userhost()
$userhost(<nickname list>)
$userhost(<channel>)
Once upon a time the server didn't give the userhost when it sent messages to you. When /ON was invented, userhosts weren't available and they could not put them in $*. Because you can't change $* in /ONs without breaking backwards compatibility (breaking people's scripts), $userhost() was created to give the new userhost information to the user.
After EPIC began caching the userhosts of people who are in the channels that you JOIN, $userhost() started accepting nicknames. If you ask for the userhost of someone who isn't in a channel you are in, or if you ask before ON CHANNEL_SYNC is thrown, then you will probably get the “UNKNOWN” userhost. Use the USERHOST command to ask the server for the userhost in these cases.
To show someone's address when they leave a channel:
on ^leave "*" { echo *** $0 \($userhost()\) left channel $1 }
To show another person's address on demand (must be in same channel):
eval echo Nuke!$userhost(Nuke) writes terrible help files.
This function originally appeared in ircII-2.1.5 Support for nickname arguments originally appeared in EPIC4pre0.027