Reminds me of that episode of Red Dwarf where Lister has his arm cut off and gets a robotic replacement that is controlled by his thoughts:

[KRYTEN, LISTER present. KRYTEN has attached a bulky, artificial arm to LISTER's shoulder, which at the moment rests motionless on the worktop which LISTER is seated beside]

KRYTEN
Right, now this is a copy of the standard model from the 21st century. Er, comfortable, sir?

LISTER
It's fine, yeah.

KRYTEN
Okay, now let's recap: the limb is connected to neurons which run up to the left hemisphere of your brain, which controls the right side of your body.
Now, all you have to do is merely command the arm to do something, and it obeys.
Now, let's practice.

KRYTEN
Right, concentrate, sir. I want you to think: "arm - pick up the ball".

LISTER
Okay.

KRYTEN
Now just think: "I will pick up the ball"

LISTER
I will pick up the ball.

KRYTEN
That's right, good, now, concentrate.

LISTER
*I will pick up the ball*.

KRYTEN
Okay, now *really* think: Hand --

LISTER
I will pick up the ball.

KRYTEN
-- pick up the ball. That's right, that's right.

LISTER
*Pick up the ball*.

KRYTEN
Pick up the ball. Hand, pick up the ball! That's right, now *keep*
going, sir! Pick up the ball! Now, focus down onto that and keep the thought, sir! Hand, pick up the ball!

<Lister grunts, effort twisting his feature as the hand lies motionless>

KRYTEN
That's right, sir, now keep going, now *really think*, now. Hand, pick up the ball! Now let's really get it going, sir! Pick up the ball! *Pick up the ball*! REALLY START TO GO NOW, SIR! HAND, PICK UP THE BALL, NOW LET'S KEEP MOVING! KEEP ON, SIR, YOU *CAN* DO IT! HAND, PICK UP THE BALL! YOU'RE GOING TO MOVE THAT HAND, SIR! YOU'RE *GOING* TO MOVE IT! MOVE THE HAND, SIR!! HAND! PICK UP THE BALL!! PICK UP THE BALL!! YES SIR! YES! WE'RE STARTING TO MOVE, NOW! YES! IT'S DEFINITELY MOVING, SIR!

<Lister finally grabs the ball with the arm>

KRYTEN
YES!! Oh! Bravo, sir!!

LISTER
Oh! The sweat's dripping off me!

KRYTEN
Oh, that was fantastic, sir! Absolutely marvellous, it worked like a
dream!

LISTER
Is that it?

KRYTEN
Well, er, how do you mean, sir?

LISTER
Is that the best it works?? In other words, if I ever want to pick up a ball, am I going to have to take the morning off??

KRYTEN
It was a *tad* slow, I'm forced to admit.

LISTER
A tad? The only thing I've ever seen pick up slower is Rimmer in a disco.

KRYTEN
Well, maybe if I adjust the impulse valve it might make it a little more sensitive.
Okay, let's try again: "Hand, pick up the ball".

LISTER
Okay... *hand*, *pick up*, *the ball*.

<The artificial arm reaches out and punches Kryten in the head>

KRYTEN
Okay... right... well, er, let's try again.

LISTER
Okay?

KRYTEN
Now: "Hand, pick up the ball".

LISTER
Hand, pick up the ball.

<The arm again reaches out and punches Kryten in the face>

KRYTEN
I think, sir, there's a lot of anger inside you, and that's what's driving
the arm.

LISTER
I don't *feel* angry..?

KRYTEN
Well, you've lost your arm, sir, you've every *right* to feel angry.

LISTER
I don't! I promise, I don't!

KRYTEN
Ah well, you see, it's subconscious. You're *thinking* "hand, pick up the ball", but your subconscious is saying "punch Kryten in the head; beat the brains out of the demented droid that cut off my beloved arm". Am I right?

LISTER
Kryten, that's rubbish!

<The arm punches Kryten in the head yet again seemingly of its own accord>

LISTER
You're right! It's controlled by my subconscious!

KRYTEN
It's far too dangerous to let you out with that arm, sir. Two minutes with Miss Kochanski and who knows what you'd be swinging around your head!