getting and setting scripts on objects via code

Long story short I am trying to get the scripts attached to an object in the game and transfer them to another object.

example:

after object B hits object A I want to get the script that controls Object A’s movement pattern and put that into object B. Object A has three scripts a spawn script, script 1 handles the start and everything that needs to happen when the object comes into gamePlay. script 2 handles the movement pattern of the object and script 3 spawns clones of the object (to prevent my brain from turning to mush for every object the movement script is always script 2nd (so its always in position 3 (transform, sprite render, startscript, movescript), I was hoping to do something like this

object2.addComponent(this.GetComponents<MonoBehaviour().GetValue(3)));

this works if i want to get the transform or sprite render but not for the movement or spawn script

public class ViperMove : MonoBehaviour {

I don’t mean to demean your approach, but my instincts tell me that this way madness lies.

Instead, I would recommend giving all your moving objects the same script that has some “Behaviour” variable which defines how they actually move. Then, you can simply do:

 object2.GetComponent<MoveScript>().Behaviour = 
        this.GetComponent<MoveScript>().Behaviour;

This has several benefits. Mostly in debugging, but also in opening potential for later polymorphism and/or unit testing.