For example,
alias gethost { if ($me ison #) && ($1 ison #) { echo -a $1's host is: $address($1,2) } }
Command: /gethost Nick
will return his or her nickname and host. I hope you get the idea. For the text event with a trigger, the $1 becomes $2.