The problem is that you are sending the message to $active. $active returns the window that is currently active/open on your mIRC. The identifier you need to use is $chan. $chan returns the channel where the event was triggered (ie, where the user joined).

-genius_at_work