Yeah, it works. But I have to be in the channel #test, or else it’s not working...

I need, if I am in channel #1, and a nick from #2 joins... Then kick the nick from chan #2... And am not in chan #2.. How to get it work!?