A stalker who was given 'mixed messages' by his ex has been told that he has to realise that the relationship is over, a court heard.