girls only need two things from a guy: emotional support and
security.
if it's like what you said, she can't leave her boyfriend for some
reason. and she has no one to cry her heart out to. hence she lacks
emotional support. [i don't know whether her bf provides a sense of
security.]
and then you came along and showered her with your care and
concern. you provided her the emotional support that she needs. she
realises that she can get her emotional support from you, hence she
looks for you whenever she's troubled.
when she's gotten enough of the emotional support, she disappears
without a word and you can't seem to contact her. she only appears
again when she's low on emotional support.
in short, you're like an emotional tampon: used when needed,
discarded when not.
bro, get this straight: you cannot change her because:
1) your position in her heart is not great enough to affect her
thinking.
2) it is near impossible to make a person have a 180 degrees change
in personality.
like what the other guys said, both of you belong to two worlds.
just be glad that she crossed your path, because you wouldn't have
learnt so much without her. 