Code:
on !@*:join:#channel1:{
  ;when someone other than me enters the room while I have full ops in #channel1
  if $nick ison #channel2 && $iil($chan,$nick).by {
    ;check to see if the person is on #channel2 and see if they are in the inivte list for #channel1
    .ban -k $chan $iil($chan,$nick).by Invited $nick who is on #channel2
    ;if they are, get the name of the address of the person that invited them, then ban that address from #channel1
  }
}


; prefixed lines are comments, so this can be used in mIRC only having to change the actual channel names.