How to setup RFM model?

How to setup RFM model or score?
Automatically so that once a customer action on certain things then the score will change accordingly. Thank you!