Then that depends on what you're trying to do. $nick will return the nick of the person who triggered a script, so if you have something that triggers when you receive a query (or a notice, or a DCC...) you don't need to be in a channel for that to happen. If you give specifics of what you're trying to do, we can answer your question better.