Wow, I was in a very similiar situation a couple of years ago. Naturally, I did everything wrong too. I swore to be there for her through thick and thin and what not. In the end, no amount of begging, reasoning, or coaxing kept her from doing drugs. No amount of NA meetings, boyfriend beatings, or losing her child visitations kept her from her "lost weekends".
No, in the end, she had to hit rock bottom...then and only then did she finally quit. The sad thing that you must realize is that there really is nothing you can do. You see, because unless she WANTS to quit and straighten out her life the only thing you will be to her is an emotional rag for her to dump on.
My advice is to tell her that there is no longer room in your life for drugs and that unless she gets clean she is never to darken your doorstep. Tough love, I know, but it is the only way. I'm in no way saying that you should abadon your friend in her time of need...be there when she wants help...REAL help. If she accepts your help, take her to an NA (Narcotics Anonymous) meeting. There she'll be with people who are going through much of the same problems and (most importantly) it really works. Good luck and keep us informed, ok?