$target
From Scriptwiki
Returns the name of the target for a specific event.
$target
It takes no parameters.
on *:text:hello:*: { msg $target $nick Hello $nick $+ ! }
If a user said hello in a channel, this would message the channel, if a user private messaged you, it would private message them back. It would also trigger in DCC Chats and File Serve.