If you are playing a freeshard it is possible that the function macro is busted like quite a few freeshards. You could try the links ghost posted or you could do what I do which is Select nearest mobile, wait for target, attack selected target. However, with this it will make you attack guild mates as well as anyone and anything in fel.