According to most people and BattleEye, AHK scripts are "detected", I have used them for 2 months and I still haven't got a ban. However, I never compile my scripts (to exe) as that susposedly makes them way easier to detect, if I downloaded a public AHK macro I convert it to a normal ahk script and slightly change the mouse movements to be safe. You can also use Enigma and a bunch of other things. I guess its just luck.
If your worried use this:
https://www.mpgh.net/forum/showthread.php?t=1327830