opportunistic
Taking chances to benefit yourself, often without caring about others.
Opportunistic describes someone who takes advantage of situations to benefit themselves, often without much concern for principles or how it affects others. When a friend only talks to you when they need help with homework but ignores you the rest of the time, they're being opportunistic. They're using the friendship as an opportunity for their own gain rather than caring about the relationship itself.
The word can describe actions that are merely practical and smart, like an opportunistic shopper who snaps up great deals whenever they appear. But it often carries a negative tone, suggesting someone is willing to bend their values or use people when convenient. An opportunistic politician might switch positions on important issues just to win votes, or an opportunistic business might raise prices dramatically during an emergency when people are desperate.
In science, the word has a more neutral meaning. Opportunistic animals are those that eat whatever food they can find: raccoons and crows are opportunistic feeders who adapt their diets based on what's available. Opportunistic infections are illnesses that take advantage of a weakened immune system to attack the body.
The key idea is seizing chances as they arise. Whether that's admirable or selfish depends on whether you're being flexible and resourceful, or using others for your own benefit.