Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random rand = new Random();
- void Main()
- {
- GridTerminalSystem.Blocks[0].CubeGrid.ConvertToDynamic(); //Dzieki Moskit za pomysl
- //A teraz podawimy sie zyroskopami...
- var gyros = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyGyro>(gyros);
- for(var i=0; i<gyros.Count; i++) {
- var gyro = gyros[i] as IMyGyro;
- gyro.GetActionWithName("OnOff_On").Apply(gyro);
- if(!gyro.GyroOverride) {
- gyro.GetActionWithName("Override").Apply(gyro);
- }
- gyro.GetActionWithName("IncreasePower").Apply(gyro);
- gyro.GetActionWithName("IncreaseYaw").Apply(gyro);
- gyro.GetActionWithName("IncreasePitch").Apply(gyro);
- gyro.GetActionWithName("IncreaseRoll").Apply(gyro);
- }
- //I silnikami...
- var thrusters = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyThrust>(thrusters);
- for(var i=0; i<thrusters.Count; i++) {
- var thruster = thrusters[i] as IMyThrust;
- thruster.GetActionWithName("OnOff_On").Apply(thruster);
- if(rand.Next(2) == 0) {
- thruster.GetActionWithName("IncreaseOverride").Apply(thruster);
- } else {
- thruster.GetActionWithName("DecreaseOverride").Apply(thruster);
- }
- }
- //Sterowanie? Nope
- var cockpits = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyShipController>(cockpits); //To lapie wszystkie kokpity i remote control
- for(var i=0; i<cockpits.Count; i++) {
- var cockpit = cockpits[i] as IMyCockpit;
- if(cockpit.ControlThrusters) {
- cockpit.GetActionWithName("ControlThrusters").Apply(cockpit);
- }
- if(cockpit.DampenersOverride) {
- cockpit.GetActionWithName("DampenersOverride").Apply(cockpit);
- }
- }
- //I wylaczmy wiezyczki, stacje medyczne i anteny (po co to komu?)
- var disable = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyLargeGatlingTurret>(disable);
- GridTerminalSystem.GetBlocksOfType<IMyLargeInteriorTurret>(disable);
- GridTerminalSystem.GetBlocksOfType<IMyLargeMissileTurret>(disable);
- GridTerminalSystem.GetBlocksOfType<IMySmallGatlingGun>(disable);
- GridTerminalSystem.GetBlocksOfType<IMySmallMissileLauncher>(disable);
- GridTerminalSystem.GetBlocksOfType<IMySmallMissileLauncherReload>(disable);
- GridTerminalSystem.GetBlocksOfType<IMyInteriorLight>(disable); //Czy komary boja sie ciemnosci?
- GridTerminalSystem.GetBlocksOfType<IMyMedicalRoom>(disable);
- GridTerminalSystem.GetBlocksOfType<IMyBeacon>(disable);
- GridTerminalSystem.GetBlocksOfType<IMyRadioAntenna>(disable);
- for(var i=0; i<disable.Count; i++) {
- disable[i].GetActionWithName("OnOff_Off").Apply(disable[i]);
- }
- //Drzwi oddzielnie (zamknij, nie wylacz)
- var doors = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyDoor>(doors);
- for(var i=0; i<doors.Count; i++) {
- var door = doors[i] as IMyDoor;
- if(door.Open) {
- door.GetActionWithName("Open_Off").Apply(door); //Nie wyjdziecie!
- }
- }
- //Do gory nogami?
- var gravigens = new List<IMyTerminalBlock>();
- GridTerminalSystem.GetBlocksOfType<IMyGravityGenerator>(gravigens);
- for(var i=0; i<gravigens.Count; i++) {
- var gravigen = gravigens[i] as IMyGravityGenerator;
- gravigen.GetActionWithName("OnOff_On").Apply(gravigen);
- gravigen.GetActionWithName("DecreaseGravity").Apply(gravigen);
- }
- //Na koniec pozmieniajmy nazwy :>
- for(var i=0; i<GridTerminalSystem.Blocks.Count; i++) {
- GridTerminalSystem.Blocks[i].SetCustomName("*YOU'VE BEEN HACKED*");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement