In this study, we developed an algorithm that provides automatic protection against swarm drones by using directional jammers in anti-drone systems. Directional jammers are a special type of jammers that can be rotated to a certain angle and do jamming around only that angle. This feature is useful for jamming particular targets and not jamming areas where it is not desired. We worked on a specialized version of the threat evaluation and weapon allocation (TEWA) problem, in which weapons (jammers for this problem) should be assigned to angles to cover threats at a maximum rate by satisfying their priorities. In this problem, it is aimed at keeping the threat within jamming signals at the maximum rate by turning the directional jammers to appropriate angles, taking into account the threat priorities. We have presented an algorithm that solves this problem by meeting the physical constraints of the jammers and tactical constraints defined by the user. The solutions created include: using as few jammers as possible, minimizing the angle changes jammers make in each new plan, prioritizing threats according to their characteristics (type, direction, speed, and distance), and preventing jammers from returning to the physical constraints defined for them. We solved the threat evaluation problem with the help of genetic programming and the jammer angle assignment problem by transforming it into an integer linear programming (ILP) formulation. We also handled physical constraints unsuitable for ILP formulation with post-processing. Since there are few studies directly dealing with this version of the problem, we compared our study with the study that was claimed to be the first to solve this particular version of this problem. Furthermore, we compared our study with the different versions of the algorithm we created. Experiments have shown that threat coverage percentage is vastly increased, achieving this without a significant drop in problem-solving speed.