jiàn jī xíng shì

见机行事 (見機行事)

see the occasion and act

play it by ear; act according to circumstances; use one’s discretion; to do as one sees fit