Well the flag the makes a girl leave is
name.set_gone_forever()
I think you can reverse it with
name.unhide()
(replace name with the girl's name (lowercase)), but I've never had an excuse to test it so I'm not certain. Also here's a list of flags and what triggers them that could roadblock you from Emma's content.
If Sam introduces you as her boyfriend or master
emma.flags.samgirlfriend
is set to
True
(if Sam introduced you as her master
emma.flags.samgirlmaster
is also set to
True
but all it does is change some dialogue).
emma.flags.samgirlfriend
can also be set to
True
if during the
You must be registered to see the links
you tell Emma Sam is cheating on Ryan and when asked if you love Sam and you answer Yes (the flag
emma.flags.mikecheats
is also set to
True
when you tell her Sam is cheating but it does nothing as of right now).
emma.flags.lovepoints = x
is for the
You must be registered to see the links
a value of
3+
is necessary for the optimal outcome.
Emma will leave if
samantha.flags.friendzone
is set to
True
and
emma.flags.samok
is set to
False
.