Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string seatName = "seat name";
- string rotorName = "rotor name";
- float speed = 1;
- IMyShipController c;
- IMyMotorStator r;
- Vector3 mi;
- public Program()
- {
- c = GridTerminalSystem.GetBlockWithName(seatName) as IMyShipController;
- r = GridTerminalSystem.GetBlockWithName(rotorName) as IMyMotorStator;
- Runtime.UpdateFrequency = UpdateFrequency.Update10;
- }
- public void Main(string argument)
- {
- if(c.IsUnderControl)
- mi = c.MoveIndicator;
- else
- mi = Vector3.Zero;
- if(mi.Z == -1)
- r.TargetVelocityRPM = speed;
- if(mi.Z == 1)
- r.TargetVelocityRPM = -speed;
- if(mi.Z == 0)
- r.TargetVelocityRPM = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement