Shouldn\'t ($opnick == %pnick) be ($bnick == %pnick) ? Of course, that would only work if the ban included the nick of %pnick.