In Star Wars: A New Hope, Luke is cleaning R2-D2 when he "stumbles across" the recording of Princess Leia.
Supposedly, Luke somehow triggers R2 playing the recording when he dislodges something from R2's neck joint, but is unable to view the entire message. R2 offers the idea that removing the restraining bolt may allow him to play the entire message, but as soon as it is removed, R2 suddenly claims he doesn't remember any message.
From the script:
Luke struggles to remove a small metal fragment from Artoo's neck joint. He uses a larger pick.
LUKE
Well, my little friend, you've got something jammed in here real good. Were you on a cruiser or...
The fragment breaks loose with a snap, sending Luke tumbling head over heels. He sits up and sees a twelve-inch three- dimensional hologram of Leia Organa, the Rebel senator, being projected from the face of little Artoo. The image is a rainbow of colors as it flickers and jiggles in the dimly lit garage. Luke's mouth hangs open in awe.
LEIA
Help me, Obi-Wan Kenobi. You're my only hope.
later
Luke: Well, I stumbled across a recording while I was cleaning him. He says that he belongs to someone named Obi-Wan Kenobi. I thought he might have meant old Ben. Do you know what he's talking about?
To me, the fact that R2 plays dumb, and then sneaks away later that night indicates that he is capable of lying, and even of coming up with plans of his own but is there any evidence (for or against) the idea that the recording was never triggered by Luke and that R2 was simply putting into motion a plan to somehow go and find Obi-Wan by playing a portion of the recording?