In social psychology whats the term that describes this scenario: someone treats you in a certain way then you respond in a certain way consistent with how you were treated. however, that is the way you wanted to act.

The term that describes the scenario you mentioned is called self-fulfilling prophecy. It refers to a belief or expectation about someone or something that influences how we behave, leading that belief to come true.

To understand how self-fulfilling prophecy works in social psychology, here's an example that relates to your scenario:

Let's say you believe that a certain person is unfriendly. Due to this belief, you may approach that person with caution or even treat them more distantly. Because of your behavior, the person may respond to you in a cold or unfriendly manner, confirming your initial belief. In this case, your behavior influenced the person's response, and their response reinforced your initial belief. Thus, your expectation of their unfriendliness was fulfilled.

However, it's important to note that in your scenario, you mentioned that "that is the way you wanted to act." If you consciously chose to behave in a certain way to elicit a specific response, it may not fit the exact definition of a self-fulfilling prophecy. In this case, your behavior aligns with your desired outcome rather than being solely driven by an initial belief or expectation.