You need to mean what you say to them. They keep getting contradictory messages from you, hence keep coming back for more because you ultimately get back together with them.
If you say you do not want to see them anymore, then stick to that. Block them, do not respond and do not go back to talking or hooking up with them.
They keep coming back because they have learnt that you do not mean what you say.