"One who has abandoned nine things is capable of realizing arahantship. Which nine? Passion, aversion, delusion, anger, resentment, arrogance, insolence, envy, & stinginess. One who has abandoned these nine things is capable of realizing arahantship.”
The Buddhas teaching can be summarised very simply, "Do not preform any unskilled acts, skilful acts are the way of a meditator."
If you have a practice and drop it when things don’t go your way, or when things go easy pay less attention to the practice you are following the ways of the world, the Dhammapada verses 3 & 4 say
'He insulted me, hit me, beat me, robbed me' — for those who brood on this, hostility isn't stilled.
'He insulted me, hit me, beat me, robbed me' — for those who don't brood on this, hostility is stilled.
But it is forgotten that the opposite is just as true
‘He praised me, agreed with me, worshipped me’ – for those who brood on this, hostility isn’t stilled.
‘He praised me, agreed with me, worshipped me’ – for those who don’t brood on this, hostility is stilled.
This interpretation looks at the passage from the other side of the worldly conditions, instead of from despair, it is from greed. We often forget that it isn’t only when we are hurt that we need to practice hard, but also when we are in good spirits too, it is easy to see that the practice is important when things seam to be conspiring against us, and hard to see it is just as important when things are going our way, so it is more important to practice in the good times not just the bad.
Doing good and bad depends on what we surround ourselves with, if we are friends with those who indulge in the world we will weaken our practice by association, but if we associate with people dedicated to the path our practice will strengthen because we wont be directly tempted to engage in the world, by connecting with it, after all there is enough of the world already clung to without adding more.
At the end of the day I may be right, I may be wrong, but I share this hoping I am one, the other, both, or neither.