Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* v:2.0174 [1.191 compatibility, new Inventory variants]
- * Automatic LCDs 2 - In-game script by MMaster
- *
- * Last Update: Fixed multiline command marker \ at the end of line not working
- * Slower command updates in SlowMode
- * Added NB (no bars), NN (no numbers) & NNB (no bars or numbers) variants of Inventory, InvList, Missing and all their variants (check guide)
- * Cockpit (and other blocks) panels support - read guide section 'How to use with cockpits?'
- * Script now correctly uses the Text Padding property of the LCD (you can set it however you want and the script will work with it)
- * Optimizations for servers running script limiter - use SlowMode!
- * Added SlowMode setting to considerably slow down the script (4-5 times less processing per second)
- * Now using MDK!
- * First part of rewrite of memory management which should optimize memory allocations a lot (more optimizations in progress)
- *
- * Previous updates: Look at Change notes tab on Steam workshop page. */
- /* Customize these: */
- // Use this tag to identify LCDs managed by this script
- // Name filtering rules can be used here so you can use even G:Group or T:[My LCD]
- public string LCD_TAG = "T:[LCD]";
- // Set to true if you want to slow down the script
- public const bool SlowMode = false;
- // How many lines to scroll per step
- public const int SCROLL_LINES_PER_STEP = 1;
- // Script automatically figures if LCD is using monospace font
- // if you use custom font scroll down to the bottom, then scroll a bit up until you find AddCharsSize lines
- // monospace font name and size definition is above those
- // Enable initial boot sequence (after compile / world load)
- public const bool ENABLE_BOOT = true;
- /* READ THIS FULL GUIDE
- http://steamcommunity.com/sharedfiles/filedetails/?id=407158161
- Basic video guide
- Please watch the video guide even if you don't understand my English. You can see how things are done there.
- https://youtu.be/vqpPQ_20Xso
- Please carefully read the FULL GUIDE before asking questions I had to remove guide from here to add more features :(
- Please DO NOT publish this script or its derivations without my permission! Feel free to use it in blueprints!
- Special Thanks
- Keen Software House for awesome Space Engineers game
- Malware for contributing to programmable blocks game code and MDK!
- Watch Twitter: https://twitter.com/MattsPlayCorner
- and Facebook: https://www.facebook.com/MattsPlayCorner1080p
- for more crazy stuff from me in the future :)
- If you want to make scripts for Space Engineers check out MDK by Malware:
- https://github.com/malware-dev/MDK-SE/wiki/Quick-Introduction-to-Space-Engineers-Ingame-Scripts
- */
- bool MDK_IS_GREAT = true;
- /* Customize characters used by script */
- class MMStyle {
- // Monospace font characters (\uXXXX is special character code)
- public const char BAR_MONO_START = '[';
- public const char BAR_MONO_END = ']';
- public const char BAR_MONO_EMPTY = '\u2591'; // 25% rect
- public const char BAR_MONO_FILL = '\u2588'; // full rect
- // Classic (Debug) font characters
- // Start and end characters of progress bar need to be the same width!
- public const char BAR_START = '[';
- public const char BAR_END = ']';
- // Empty and fill characters of progress bar need to be the same width!
- public const char BAR_EMPTY = '\'';
- public const char BAR_FILL = '|';
- }
- // (for developer) Debug level to show
- public const int DebugLevel = 0;
- // (for modded lcds) Affects all LCDs managed by this programmable block
- /* LCD height modifier
- 0.5f makes the LCD have only 1/2 the lines of normal LCD
- 2.0f makes it fit 2x more lines on LCD */
- public const float HEIGHT_MOD = 1.0f;
- /* line width modifier
- 0.5f moves the right edge to 50% of normal LCD width
- 2.0f makes it fit 200% more text on line */
- public const float WIDTH_MOD = 1.0f;
- List<string> BOOT_FRAMES = new List<string>() {
- /* BOOT FRAMES
- * Each @"<text>" marks single frame, add as many as you want each will be displayed for one second
- * @"" is multiline string so you can write multiple lines */
- @"
- Initializing systems"
- ,
- @"
- Verifying connections"
- ,
- @"
- Loading commands"
- };
- void ItemsConf() {
- // ITEMS AND QUOTAS LIST
- // (subType, mainType, quota, display name, short name)
- // VANILLA ITEMS
- Add("Stone", "Ore");
- Add("Iron", "Ore");
- Add("Nickel", "Ore");
- Add("Cobalt", "Ore");
- Add("Magnesium", "Ore");
- Add("Silicon", "Ore");
- Add("Silver", "Ore");
- Add("Gold", "Ore");
- Add("Platinum", "Ore");
- Add("Uranium", "Ore");
- Add("Ice", "Ore");
- Add("Scrap", "Ore");
- Add("Stone", "Ingot", 40000, "Gravel", "gravel");
- Add("Iron", "Ingot", 300000);
- Add("Nickel", "Ingot", 900000);
- Add("Cobalt", "Ingot", 120000);
- Add("Magnesium", "Ingot", 80000);
- Add("Silicon", "Ingot", 80000);
- Add("Silver", "Ingot", 800000);
- Add("Gold", "Ingot", 80000);
- Add("Platinum", "Ingot", 45000);
- Add("Uranium", "Ingot", 12000);
- Add("AutomaticRifleItem", "Tool", 0, "Automatic Rifle");
- Add("PreciseAutomaticRifleItem", "Tool", 0, "* Precise Rifle");
- Add("RapidFireAutomaticRifleItem", "Tool", 0, "** Rapid-Fire Rifle");
- Add("UltimateAutomaticRifleItem", "Tool", 0, "*** Elite Rifle");
- Add("WelderItem", "Tool", 0, "Welder");
- Add("Welder2Item", "Tool", 0, "* Enh. Welder");
- Add("Welder3Item", "Tool", 0, "** Prof. Welder");
- Add("Welder4Item", "Tool", 0, "*** Elite Welder");
- Add("AngleGrinderItem", "Tool", 0, "Angle Grinder");
- Add("AngleGrinder2Item", "Tool", 0, "* Enh. Grinder");
- Add("AngleGrinder3Item", "Tool", 0, "** Prof. Grinder");
- Add("AngleGrinder4Item", "Tool", 0, "*** Elite Grinder");
- Add("HandDrillItem", "Tool", 0, "Hand Drill");
- Add("HandDrill2Item", "Tool", 0, "* Enh. Drill");
- Add("HandDrill3Item", "Tool", 0, "** Prof. Drill");
- Add("HandDrill4Item", "Tool", 0, "*** Elite Drill");
- Add("Construction", "Component", 50000);
- Add("MetalGrid", "Component", 15500, "Metal Grid");
- Add("InteriorPlate", "Component", 55000, "Interior Plate");
- Add("SteelPlate", "Component", 300000, "Steel Plate");
- Add("Girder", "Component", 3500);
- Add("SmallTube", "Component", 26000, "Small Tube");
- Add("LargeTube", "Component", 6000, "Large Tube");
- Add("Motor", "Component", 16000);
- Add("Display", "Component", 500);
- Add("BulletproofGlass", "Component", 12000, "Bulletp. Glass", "bpglass");
- Add("Computer", "Component", 6500);
- Add("Reactor", "Component", 10000);
- Add("Thrust", "Component", 16000, "Thruster", "thruster");
- Add("GravityGenerator", "Component", 250, "GravGen", "gravgen");
- Add("Medical", "Component", 120);
- Add("RadioCommunication", "Component", 250, "Radio-comm", "radio");
- Add("Detector", "Component", 400);
- Add("Explosives", "Component", 500);
- Add("SolarCell", "Component", 2800, "Solar Cell");
- Add("PowerCell", "Component", 2800, "Power Cell");
- Add("Superconductor", "Component", 3000);
- Add("Canvas", "Component", 300);
- Add("NATO_5p56x45mm", "Ammo", 8000, "5.56x45mm", "5.56x45mm");
- Add("NATO_25x184mm", "Ammo", 2500, "25x184mm", "25x184mm");
- Add("Missile200mm", "Ammo", 1600, "200mm Missile", "200mmmissile");
- Add("OxygenBottle", "OxygenContainerObject", 5, "Oxygen Bottle");
- Add("HydrogenBottle", "GasContainerObject", 5, "Hydrogen Bottle");
- // MODDED ITEMS
- // (subType, mainType, quota, display name, short name, used)
- // * if used is true, item will be shown in inventory even for 0 items
- // * if used is false, item will be used only for display name and short name
- // AzimuthSupercharger
- Add("AzimuthSupercharger", "Component", 1600, "Supercharger", "supercharger", false);
- // OKI Ammo
- Add("OKI23mmAmmo", "Ammo", 500, "23x180mm", "23x180mm", false);
- Add("OKI50mmAmmo", "Ammo", 500, "50x450mm", "50x450mm", false);
- Add("OKI122mmAmmo", "Ammo", 200, "122x640mm", "122x640mm", false);
- Add("OKI230mmAmmo", "Ammo", 100, "230x920mm", "230x920mm", false);
- // REALLY REALLY REALLY
- // DO NOT MODIFY ANYTHING BELOW THIS (TRANSLATION STRINGS ARE AT THE BOTTOM)
- }
- void Add(string sT, string mT, int q = 0, string dN = "", string sN = "", bool u = true) { Ə.ƃ(sT, mT, q, dN, sN, u); }
- Ƈ Ə;ȓ ƕ;Ģ ϓ;ɖ o=null;void ϒ(string ƚ){}void ϑ(string ϐ,string Ϗ){string Ƕ=ϐ.ToLower();switch(Ƕ){case"lcd_tag":LCD_TAG=Ϗ;
- break;}}void ϔ(){string[]lj=Me.CustomData.Split('\n');for(int F=0;F<lj.Length;F++){string ǎ=lj[F];int š=ǎ.IndexOf('=');if(š<0){ϒ
- (ǎ);continue;}string ώ=ǎ.Substring(0,š).Trim();string ǫ=ǎ.Substring(š+1).Trim();ϑ(ώ,ǫ);}}void ύ(ȓ ƕ){Ə=new Ƈ();ItemsConf(
- );ϔ();o=new ɖ(this,DebugLevel,ƕ);o.Ə=Ə;o.ɧ=LCD_TAG;o.ɦ=SCROLL_LINES_PER_STEP;o.ɥ=ENABLE_BOOT;o.ɤ=BOOT_FRAMES;o.ɣ=!
- MDK_IS_GREAT;o.ɢ=HEIGHT_MOD;o.ɬ=WIDTH_MOD;o.Ǡ();}void ό(){ƕ.ǂ=this;o.ǂ=this;}Program(){Runtime.UpdateFrequency=UpdateFrequency.
- Update1;}void Main(string ą,UpdateType ϊ){try{if(ƕ==null){ƕ=new ȓ(this,DebugLevel,SlowMode);ύ(ƕ);ϓ=new Ģ(o);ƕ.Ȉ(ϓ,0);}else{ό();
- o.ő.Ѕ();}if(ą.Length==0&&(ϊ&(UpdateType.Update1|UpdateType.Update10|UpdateType.Update100))==0){ƕ.ȩ();return;}if(ą!=""){if
- (ϓ.ă(ą)){ƕ.ȩ();return;}}ϓ.Ġ=0;ƕ.Ƞ();}catch(Exception ex){Echo("ERROR DESCRIPTION:\n"+ex.ToString());Me.Enabled=false;}}
- class ζ:ɓ{Ģ ē;ɖ o;string ą="";public ζ(ɖ Û,Ģ đ,string ij){Ɏ=-1;ɒ="ArgScroll";ą=ij;ē=đ;o=Û;}int Ŵ;β ε;public override void Ʌ(){ε
- =new β(Ɠ,o.ő);}int δ=0;int Y=0;ʤ ƚ;public override bool Ʉ(bool ë){if(!ë){Y=0;ε.Ŧ();ƚ=new ʤ(Ɠ);δ=0;}if(Y==0){if(!ƚ.ʻ(ą,ë))
- return false;if(ƚ.ˋ.Count>0){if(!int.TryParse(ƚ.ˋ[0].ij,out Ŵ))Ŵ=1;else if(Ŵ<1)Ŵ=1;}if(ƚ.ʸ.EndsWith("up"))Ŵ=-Ŵ;else if(!ƚ.ʸ.
- EndsWith("down"))Ŵ=0;Y++;ë=false;}if(Y==1){if(!ε.ϼ("textpanel",ƚ.ʣ,ë))return false;Y++;ë=false;}è n;for(;δ<ε.ϲ();δ++){if(!Ɠ.Ȝ(20
- ))return false;IMyTextPanel γ=ε.ί[δ]as IMyTextPanel;if(!ē.Ĝ.TryGetValue(γ,out n))continue;if(n==null||n.å!=γ)continue;if(
- n.é)n.æ.Ļ=10;if(Ŵ>0)n.æ.ň(Ŵ);else if(Ŵ<0)n.æ.Ŭ(-Ŵ);else n.æ.ĺ();n.N();}return true;}}class β{ȓ Ɠ;ϵ α;IMyCubeGrid ΰ{get{
- return Ɠ.ǂ.Me.CubeGrid;}}IMyGridTerminalSystem ƿ{get{return Ɠ.ǂ.GridTerminalSystem;}}public List<IMyTerminalBlock>ί=new List<
- IMyTerminalBlock>();public β(ȓ ƕ,ϵ ή){Ɠ=ƕ;α=ή;}int η=0;public double ω(ref double χ,ref double φ,bool ë){if(!ë)η=0;for(;η<ί.Count;η++){
- if(!Ɠ.Ȝ(4))return Double.NaN;IMyInventory ρ=ί[η].GetInventory(0);if(ρ==null)continue;χ+=(double)ρ.CurrentVolume;φ+=(double
- )ρ.MaxVolume;}χ*=1000;φ*=1000;return(φ>0?χ/φ*100:100);}int υ=0;double τ=0;public double σ(bool ë){if(!ë){υ=0;τ=0;}for(;υ<
- ί.Count;υ++){if(!Ɠ.Ȝ(6))return Double.NaN;for(int ς=0;ς<2;ς++){IMyInventory ρ=ί[υ].GetInventory(ς);if(ρ==null)continue;τ
- +=(double)ρ.CurrentMass;}}return τ*1000;}int ψ=0;private bool π(bool ë=false){if(!ë)ψ=0;while(ψ<ί.Count){if(!Ɠ.Ȝ(4))return
- false;if(ί[ψ].CubeGrid!=ΰ){ί.RemoveAt(ψ);continue;}ψ++;}return true;}List<IMyBlockGroup>ο=new List<IMyBlockGroup>();List<
- IMyTerminalBlock>ξ=new List<IMyTerminalBlock>();int ν=0;public bool μ(string ʣ,bool ë){int λ=ʣ.IndexOf(':');string κ=(λ>=1&&λ<=2?ʣ.
- Substring(0,λ):"");bool ι=κ.Contains("T");if(κ!="")ʣ=ʣ.Substring(λ+1);if(ʣ==""||ʣ=="*"){if(!ë){ξ.Clear();ƿ.GetBlocks(ξ);ί.AddList
- (ξ);}if(ι)if(!π(ë))return false;return true;}string ϋ=(κ.Contains("G")?ʣ.Trim():"");if(ϋ!=""){if(!ë){ο.Clear();ƿ.
- GetBlockGroups(ο);ν=0;}for(;ν<ο.Count;ν++){IMyBlockGroup ϕ=ο[ν];if(string.Compare(ϕ.Name,ϋ,true)==0){if(!ë){ξ.Clear();ϕ.GetBlocks(ξ);ί
- .AddList(ξ);}if(ι)if(!π(ë))return false;return true;}}return true;}if(!ë){ξ.Clear();ƿ.SearchBlocksOfName(ʣ,ξ);ί.AddList(ξ
- );}if(ι)if(!π(ë))return false;return true;}List<IMyBlockGroup>ϱ=new List<IMyBlockGroup>();List<IMyTerminalBlock>Ͻ=new
- List<IMyTerminalBlock>();int ϻ=0;int Ϻ=0;public bool Ϲ(string ʐ,string ϋ,bool ι,bool ë){if(!ë){ϱ.Clear();ƿ.GetBlockGroups(ϱ)
- ;ϻ=0;}for(;ϻ<ϱ.Count;ϻ++){IMyBlockGroup ϕ=ϱ[ϻ];if(string.Compare(ϕ.Name,ϋ,true)==0){if(!ë){Ϻ=0;Ͻ.Clear();ϕ.GetBlocks(Ͻ);}
- else ë=false;for(;Ϻ<Ͻ.Count;Ϻ++){if(!Ɠ.Ȝ(6))return false;if(ι&&Ͻ[Ϻ].CubeGrid!=ΰ)continue;if(α.Ѐ(Ͻ[Ϻ],ʐ))ί.Add(Ͻ[Ϻ]);}return
- true;}}return true;}List<IMyTerminalBlock>ϸ=new List<IMyTerminalBlock>();int Ϸ=0;public bool ϼ(string ʐ,string ʣ,bool ë){int
- λ=ʣ.IndexOf(':');string κ=(λ>=1&&λ<=2?ʣ.Substring(0,λ):"");bool ι=κ.Contains("T");if(κ!="")ʣ=ʣ.Substring(λ+1);if(!ë){ϸ.
- Clear();Ϸ=0;}string ϋ=(κ.Contains("G")?ʣ.Trim():"");if(ϋ!=""){if(!Ϲ(ʐ,ϋ,ι,ë))return false;return true;}if(!ë)α.Ё(ref ϸ,ʐ);if(
- ʣ==""||ʣ=="*"){if(!ë)ί.AddList(ϸ);if(ι)if(!π(ë))return false;return true;}for(;Ϸ<ϸ.Count;Ϸ++){if(!Ɠ.Ȝ(4))return false;if(
- ι&&ϸ[Ϸ].CubeGrid!=ΰ)continue;if(ϸ[Ϸ].CustomName.Contains(ʣ))ί.Add(ϸ[Ϸ]);}return true;}public void ϴ(β ϳ){ί.AddList(ϳ.ί);}
- public void Ŧ(){ί.Clear();}public int ϲ(){return ί.Count;}}class ϵ{ȓ Ɠ;ɖ o;public MyGridProgram ǂ{get{return Ɠ.ǂ;}}public
- IMyGridTerminalSystem ƿ{get{return Ɠ.ǂ.GridTerminalSystem;}}public ϵ(ȓ ƕ,ɖ Û){Ɠ=ƕ;o=Û;}void Љ<ǡ>(List<IMyTerminalBlock>Ј,Func<
- IMyTerminalBlock,bool>Ї=null)where ǡ:class,IMyTerminalBlock{ƿ.GetBlocksOfType<ǡ>(Ј,Ї);}public Dictionary<string,Action<List<
- IMyTerminalBlock>,Func<IMyTerminalBlock,bool>>>І;public void Ѕ(){if(І!=null)return;І=new Dictionary<string,Action<List<IMyTerminalBlock>
- ,Func<IMyTerminalBlock,bool>>>(){{"CargoContainer",Љ<IMyCargoContainer>},{"TextPanel",Љ<IMyTextPanel>},{"Assembler",Љ<
- IMyAssembler>},{"Refinery",Љ<IMyRefinery>},{"Reactor",Љ<IMyReactor>},{"SolarPanel",Љ<IMySolarPanel>},{"BatteryBlock",Љ<
- IMyBatteryBlock>},{"Beacon",Љ<IMyBeacon>},{"RadioAntenna",Љ<IMyRadioAntenna>},{"AirVent",Љ<IMyAirVent>},{"ConveyorSorter",Љ<
- IMyConveyorSorter>},{"OxygenTank",Љ<IMyGasTank>},{"OxygenGenerator",Љ<IMyGasGenerator>},{"OxygenFarm",Љ<IMyOxygenFarm>},{"LaserAntenna",Љ
- <IMyLaserAntenna>},{"Thrust",Љ<IMyThrust>},{"Gyro",Љ<IMyGyro>},{"SensorBlock",Љ<IMySensorBlock>},{"ShipConnector",Љ<
- IMyShipConnector>},{"ReflectorLight",Љ<IMyReflectorLight>},{"InteriorLight",Љ<IMyInteriorLight>},{"LandingGear",Љ<IMyLandingGear>},{
- "ProgrammableBlock",Љ<IMyProgrammableBlock>},{"TimerBlock",Љ<IMyTimerBlock>},{"MotorStator",Љ<IMyMotorStator>},{"PistonBase",Љ<
- IMyPistonBase>},{"Projector",Љ<IMyProjector>},{"ShipMergeBlock",Љ<IMyShipMergeBlock>},{"SoundBlock",Љ<IMySoundBlock>},{"Collector",Љ<
- IMyCollector>},{"JumpDrive",Љ<IMyJumpDrive>},{"Door",Љ<IMyDoor>},{"GravityGeneratorSphere",Љ<IMyGravityGeneratorSphere>},{
- "GravityGenerator",Љ<IMyGravityGenerator>},{"ShipDrill",Љ<IMyShipDrill>},{"ShipGrinder",Љ<IMyShipGrinder>},{"ShipWelder",Љ<IMyShipWelder>}
- ,{"Parachute",Љ<IMyParachute>},{"LargeGatlingTurret",Љ<IMyLargeGatlingTurret>},{"LargeInteriorTurret",Љ<
- IMyLargeInteriorTurret>},{"LargeMissileTurret",Љ<IMyLargeMissileTurret>},{"SmallGatlingGun",Љ<IMySmallGatlingGun>},{
- "SmallMissileLauncherReload",Љ<IMySmallMissileLauncherReload>},{"SmallMissileLauncher",Љ<IMySmallMissileLauncher>},{"VirtualMass",Љ<IMyVirtualMass>}
- ,{"Warhead",Љ<IMyWarhead>},{"FunctionalBlock",Љ<IMyFunctionalBlock>},{"LightingBlock",Љ<IMyLightingBlock>},{
- "ControlPanel",Љ<IMyControlPanel>},{"Cockpit",Љ<IMyCockpit>},{"CryoChamber",Љ<IMyCryoChamber>},{"MedicalRoom",Љ<IMyMedicalRoom>},{
- "RemoteControl",Љ<IMyRemoteControl>},{"ButtonPanel",Љ<IMyButtonPanel>},{"CameraBlock",Љ<IMyCameraBlock>},{"OreDetector",Љ<
- IMyOreDetector>},{"ShipController",Љ<IMyShipController>},{"Decoy",Љ<IMyDecoy>}};}public void Њ(ref List<IMyTerminalBlock>Ā,string Є){
- Action<List<IMyTerminalBlock>,Func<IMyTerminalBlock,bool>>Ѓ;if(Є=="SurfaceProvider"){ƿ.GetBlocksOfType<IMyTextSurfaceProvider>
- (Ā);return;}if(І.TryGetValue(Є,out Ѓ))Ѓ(Ā,null);else{if(Є=="WindTurbine"){ƿ.GetBlocksOfType<IMyPowerProducer>(Ā,(Ђ)=>Ђ.
- BlockDefinition.TypeIdString.EndsWith("WindTurbine"));return;}if(Є=="HydrogenEngine"){ƿ.GetBlocksOfType<IMyPowerProducer>(Ā,(Ђ)=>Ђ.
- BlockDefinition.TypeIdString.EndsWith("HydrogenEngine"));return;}}}public void Ё(ref List<IMyTerminalBlock>Ā,string Ͽ){Њ(ref Ā,ϰ(Ͽ.Trim
- ()));}public bool Ѐ(IMyTerminalBlock å,string Ͽ){string Ͼ=ϰ(Ͽ);switch(Ͼ){case"FunctionalBlock":return true;case
- "ShipController":return(å as IMyShipController!=null);default:return å.BlockDefinition.TypeIdString.Contains(ϰ(Ͽ));}}public string ϰ(
- string Ϟ){if(Ϟ=="surfaceprovider")return"SurfaceProvider";if(Ϟ.ǭ("carg")||Ϟ.ǭ("conta"))return"CargoContainer";if(Ϟ.ǭ("text")||
- Ϟ.ǭ("lcd"))return"TextPanel";if(Ϟ.ǭ("ass"))return"Assembler";if(Ϟ.ǭ("refi"))return"Refinery";if(Ϟ.ǭ("reac"))return
- "Reactor";if(Ϟ.ǭ("solar"))return"SolarPanel";if(Ϟ.ǭ("wind"))return"WindTurbine";if(Ϟ.ǭ("hydro")&&Ϟ.Contains("eng"))return
- "HydrogenEngine";if(Ϟ.ǭ("bat"))return"BatteryBlock";if(Ϟ.ǭ("bea"))return"Beacon";if(Ϟ.Ǭ("vent"))return"AirVent";if(Ϟ.Ǭ("sorter"))return
- "ConveyorSorter";if(Ϟ.Ǭ("tank"))return"OxygenTank";if(Ϟ.Ǭ("farm")&&Ϟ.Ǭ("oxy"))return"OxygenFarm";if(Ϟ.Ǭ("gene")&&Ϟ.Ǭ("oxy"))return
- "OxygenGenerator";if(Ϟ.Ǭ("cryo"))return"CryoChamber";if(string.Compare(Ϟ,"laserantenna",true)==0)return"LaserAntenna";if(Ϟ.Ǭ("antenna"))
- return"RadioAntenna";if(Ϟ.ǭ("thrust"))return"Thrust";if(Ϟ.ǭ("gyro"))return"Gyro";if(Ϟ.ǭ("sensor"))return"SensorBlock";if(Ϟ.Ǭ(
- "connector"))return"ShipConnector";if(Ϟ.ǭ("reflector")||Ϟ.ǭ("spotlight"))return"ReflectorLight";if((Ϟ.ǭ("inter")&&Ϟ.Ǫ("light")))
- return"InteriorLight";if(Ϟ.ǭ("land"))return"LandingGear";if(Ϟ.ǭ("program"))return"ProgrammableBlock";if(Ϟ.ǭ("timer"))return
- "TimerBlock";if(Ϟ.ǭ("motor")||Ϟ.ǭ("rotor"))return"MotorStator";if(Ϟ.ǭ("piston"))return"PistonBase";if(Ϟ.ǭ("proj"))return"Projector";
- if(Ϟ.Ǭ("merge"))return"ShipMergeBlock";if(Ϟ.ǭ("sound"))return"SoundBlock";if(Ϟ.ǭ("col"))return"Collector";if(Ϟ.Ǭ("jump"))
- return"JumpDrive";if(string.Compare(Ϟ,"door",true)==0)return"Door";if((Ϟ.Ǭ("grav")&&Ϟ.Ǭ("sphe")))return
- "GravityGeneratorSphere";if(Ϟ.Ǭ("grav"))return"GravityGenerator";if(Ϟ.Ǫ("drill"))return"ShipDrill";if(Ϟ.Ǭ("grind"))return"ShipGrinder";if(Ϟ.Ǫ(
- "welder"))return"ShipWelder";if(Ϟ.ǭ("parach"))return"Parachute";if((Ϟ.Ǭ("turret")&&Ϟ.Ǭ("gatl")))return"LargeGatlingTurret";if((Ϟ
- .Ǭ("turret")&&Ϟ.Ǭ("inter")))return"LargeInteriorTurret";if((Ϟ.Ǭ("turret")&&Ϟ.Ǭ("miss")))return"LargeMissileTurret";if(Ϟ.Ǭ
- ("gatl"))return"SmallGatlingGun";if((Ϟ.Ǭ("launcher")&&Ϟ.Ǭ("reload")))return"SmallMissileLauncherReload";if((Ϟ.Ǭ(
- "launcher")))return"SmallMissileLauncher";if(Ϟ.Ǭ("mass"))return"VirtualMass";if(string.Compare(Ϟ,"warhead",true)==0)return
- "Warhead";if(Ϟ.ǭ("func"))return"FunctionalBlock";if(string.Compare(Ϟ,"shipctrl",true)==0)return"ShipController";if(Ϟ.ǭ("light"))
- return"LightingBlock";if(Ϟ.ǭ("contr"))return"ControlPanel";if(Ϟ.ǭ("coc"))return"Cockpit";if(Ϟ.ǭ("medi"))return"MedicalRoom";if
- (Ϟ.ǭ("remote"))return"RemoteControl";if(Ϟ.ǭ("but"))return"ButtonPanel";if(Ϟ.ǭ("cam"))return"CameraBlock";if(Ϟ.Ǭ("detect")
- )return"OreDetector";if(Ϟ.ǭ("decoy"))return"Decoy";return"Unknown";}public string Ϫ(IMyBatteryBlock ō){string ϝ="";if(ō.
- ChargeMode==ChargeMode.Recharge)ϝ="(+) ";else if(ō.ChargeMode==ChargeMode.Discharge)ϝ="(-) ";else ϝ="(±) ";return ϝ+o.Ǽ((ō.
- CurrentStoredPower/ō.MaxStoredPower)*100.0f)+"%";}Dictionary<MyLaserAntennaStatus,string>Ϝ=new Dictionary<MyLaserAntennaStatus,string>(){{
- MyLaserAntennaStatus.Idle,"IDLE"},{MyLaserAntennaStatus.Connecting,"CONNECTING"},{MyLaserAntennaStatus.Connected,"CONNECTED"},{
- MyLaserAntennaStatus.OutOfRange,"OUT OF RANGE"},{MyLaserAntennaStatus.RotatingToTarget,"ROTATING"},{MyLaserAntennaStatus.
- SearchingTargetForAntenna,"SEARCHING"}};public string ϛ(IMyLaserAntenna ŋ){return Ϝ[ŋ.Status];}public double Ϛ(IMyJumpDrive Ō,out double ˆ,out
- double Ŷ){ˆ=Ō.CurrentStoredPower;Ŷ=Ō.MaxStoredPower;return(Ŷ>0?ˆ/Ŷ*100:0);}public double ϙ(IMyJumpDrive Ō){double ˆ=Ō.
- CurrentStoredPower;double Ŷ=Ō.MaxStoredPower;return(Ŷ>0?ˆ/Ŷ*100:0);}}class Ϙ:ɓ{ɖ o;Ģ ē;public int ϗ=0;public Ϙ(ɖ Û,Ģ k){ɒ="BootPanelsTask"
- ;Ɏ=1;o=Û;ē=k;if(!o.ɥ){ϗ=int.MaxValue;ē.Ć=true;}}ǒ Ď;public override void Ʌ(){Ď=o.Ď;}public override bool Ʉ(bool ë){if(ϗ>o
- .ɤ.Count){Ɇ();return true;}if(!ë&&ϗ==0){ē.Ć=false;}if(!Ϯ(ë))return false;ϗ++;return true;}public override void Ƀ(){ē.Ć=
- true;}public void ϖ(){û ç=ē.ç;for(int F=0;F<ç.º();F++){è n=ç.ª(F);n.H();}ϗ=(o.ɥ?0:int.MaxValue);}int F;ŝ ϯ=null;public bool
- Ϯ(bool ë){û ç=ē.ç;if(!ë)F=0;int ϭ=0;for(;F<ç.º();F++){if(!Ɠ.Ȝ(40)||ϭ>5)return false;è n=ç.ª(F);ϯ=o.Ǐ(ϯ,n);float?Ϭ=n.ß?.
- FontSize;if(Ϭ!=null&&Ϭ>3f)continue;if(ϯ.ŗ.Count<=0)ϯ.Ť(o.Lj(null,n));else o.Lj(ϯ.ŗ[0],n);o.Ƭ();o.Ƣ(Ď.ǡ("B1"));double ʒ=(double)ϗ/o
- .ɤ.Count*100;o.Ư(ʒ);if(ϗ==o.ɤ.Count){o.Ǎ("");o.Ƣ("Automatic LCDs 2");o.Ƣ("by MMaster");}else o.nj(o.ɤ[ϗ]);bool é=n.é;n.é=
- false;o.Ǒ(n,ϯ);n.é=é;ϭ++;}return true;}public bool ϫ(){return ϗ<=o.ɤ.Count;}}public enum ϩ{Ϩ=0,ϧ=1,Ϧ=2,ϥ=3,Ϥ=4,ϣ=5,Ϣ=6,ϡ=7,Ϡ=
- 8,ϟ=9,έ=10,ʹ=11,Β=12,ʷ=13,ʶ=14,ʵ=15,ʴ=16,ʳ=17,ʲ=18,ʱ=19,ʰ=20,ʯ=21,ʮ=22,ʭ=23,ʬ=24,ʫ=25,ʪ=26,ʩ=27,ʨ=28,ʧ=29,ʦ=30,ʥ=31,}
- class ʤ{ȓ Ɠ;public string ʸ="";public string ʣ="";public string ʺ="";public string ˏ="";public ϩ ˎ=ϩ.Ϩ;public ʤ(ȓ ƕ){Ɠ=ƕ;}ϩ ˍ
- (){if(ʸ=="echo"||ʸ=="center"||ʸ=="right")return ϩ.ϧ;if(ʸ.StartsWith("hscroll"))return ϩ.ʦ;if(ʸ.StartsWith("inventory")||ʸ
- .StartsWith("missing")||ʸ.StartsWith("invlist"))return ϩ.Ϧ;if(ʸ.StartsWith("working"))return ϩ.ʲ;if(ʸ.StartsWith("cargo")
- )return ϩ.ϥ;if(ʸ.StartsWith("mass"))return ϩ.Ϥ;if(ʸ.StartsWith("shipmass"))return ϩ.ʭ;if(ʸ=="oxygen")return ϩ.ϣ;if(ʸ.
- StartsWith("tanks"))return ϩ.Ϣ;if(ʸ.StartsWith("powertime"))return ϩ.ϡ;if(ʸ.StartsWith("powerused"))return ϩ.Ϡ;if(ʸ.StartsWith(
- "power"))return ϩ.ϟ;if(ʸ.StartsWith("speed"))return ϩ.έ;if(ʸ.StartsWith("accel"))return ϩ.ʹ;if(ʸ.StartsWith("alti"))return ϩ.ʫ;
- if(ʸ.StartsWith("charge"))return ϩ.Β;if(ʸ.StartsWith("docked"))return ϩ.ʥ;if(ʸ.StartsWith("time")||ʸ.StartsWith("date"))
- return ϩ.ʷ;if(ʸ.StartsWith("countdown"))return ϩ.ʶ;if(ʸ.StartsWith("textlcd"))return ϩ.ʵ;if(ʸ.EndsWith("count"))return ϩ.ʴ;if(
- ʸ.StartsWith("dampeners")||ʸ.StartsWith("occupied"))return ϩ.ʳ;if(ʸ.StartsWith("damage"))return ϩ.ʱ;if(ʸ.StartsWith(
- "amount"))return ϩ.ʰ;if(ʸ.StartsWith("pos"))return ϩ.ʯ;if(ʸ.StartsWith("distance"))return ϩ.ʬ;if(ʸ.StartsWith("details"))return
- ϩ.ʮ;if(ʸ.StartsWith("stop"))return ϩ.ʪ;if(ʸ.StartsWith("gravity"))return ϩ.ʩ;if(ʸ.StartsWith("customdata"))return ϩ.ʨ;if(
- ʸ.StartsWith("prop"))return ϩ.ʧ;return ϩ.Ϩ;}public ŵ ˌ(){switch(ˎ){case ϩ.ϧ:return new Ҕ();case ϩ.Ϧ:return new Ҡ();case ϩ
- .ϥ:return new ʙ();case ϩ.Ϥ:return new ҿ();case ϩ.ϣ:return new ҷ();case ϩ.Ϣ:return new щ();case ϩ.ϡ:return new Т();case ϩ.
- Ϡ:return new Р();case ϩ.ϟ:return new Ҥ();case ϩ.έ:return new я();case ϩ.ʹ:return new ʔ();case ϩ.Β:return new Ν();case ϩ.ʷ
- :return new ˮ();case ϩ.ʶ:return new Ω();case ϩ.ʵ:return new Ĺ();case ϩ.ʴ:return new ʏ();case ϩ.ʳ:return new ѩ();case ϩ.ʲ:
- return new ķ();case ϩ.ʱ:return new Ρ();case ϩ.ʰ:return new Ҽ();case ϩ.ʯ:return new Ҧ();case ϩ.ʮ:return new ˑ();case ϩ.ʭ:return
- new Ѩ();case ϩ.ʬ:return new Έ();case ϩ.ʫ:return new ʑ();case ϩ.ʪ:return new ь();case ϩ.ʩ:return new Ғ();case ϩ.ʨ:return new
- Τ();case ϩ.ʧ:return new ќ();case ϩ.ʦ:return new ґ();case ϩ.ʥ:return new Ҙ();default:return new ŵ();}}public List<ˀ>ˋ=new
- List<ˀ>();string[]ˊ=null;string ˉ="";bool ˈ=false;int ĵ=1;public bool ʻ(string ˇ,bool ë){if(!ë){ˎ=ϩ.Ϩ;ʣ="";ʸ="";ʺ=ˇ.
- TrimStart(' ');ˋ.Clear();if(ʺ=="")return true;int ˁ=ʺ.IndexOf(' ');if(ˁ<0||ˁ>=ʺ.Length-1)ˏ="";else ˏ=ʺ.Substring(ˁ+1);ˊ=ʺ.Split(
- ' ');ˉ="";ˈ=false;ʸ=ˊ[0].ToLower();ĵ=1;}for(;ĵ<ˊ.Length;ĵ++){if(!Ɠ.Ȝ(40))return false;string ij=ˊ[ĵ];if(ij=="")continue;if(ij[
- 0]=='{'&&ij[ij.Length-1]=='}'){ij=ij.Substring(1,ij.Length-2);if(ij=="")continue;if(ʣ=="")ʣ=ij;else ˋ.Add(new ˀ(ij));continue;}if
- (ij[0]=='{'){ˈ=true;ˉ=ij.Substring(1);continue;}if(ij[ij.Length-1]=='}'){ˈ=false;ˉ+=' '+ij.Substring(0,ij.Length-1);if(ʣ=="")ʣ=
- ˉ;else ˋ.Add(new ˀ(ˉ));continue;}if(ˈ){if(ˉ.Length!=0)ˉ+=' ';ˉ+=ij;continue;}if(ʣ=="")ʣ=ij;else ˋ.Add(new ˀ(ij));}ˎ=ˍ();
- return true;}}class ˀ{public string ʿ="";public string ʾ="";public string ij="";public List<string>ʽ=new List<string>();public
- ˀ(string ʼ){ij=ʼ;}public void ʻ(){if(ij==""||ʿ!=""||ʾ!=""||ʽ.Count>0)return;string ˆ=ij.Trim();if(ˆ[0]=='+'||ˆ[0]=='-'){ʿ+=ˆ
- [0];ˆ=ij.Substring(1);}string[]Ɵ=ˆ.Split('/');string ʛ=Ɵ[0];if(Ɵ.Length>1){ʾ=Ɵ[0];ʛ=Ɵ[1];}else ʾ="";if(ʛ.Length>0){string[
- ]Ą=ʛ.Split(',');for(int F=0;F<Ą.Length;F++)if(Ą[F]!="")ʽ.Add(Ą[F]);}}}class ʔ:ŵ{public ʔ(){Ɏ=0.5;ɒ="CmdAccel";}public
- override bool Ɨ(bool ë){double ʓ=0;if(ƚ.ʣ!="")double.TryParse(ƚ.ʣ.Trim(),out ʓ);o.ƃ(Ď.ǡ("AC1")+" ");o.ƴ(o.ǀ.ʀ.ToString("F1")+
- " m/s²");if(ʓ>0){double ʒ=o.ǀ.ʀ/ʓ*100;o.Ư(ʒ);}return true;}}class ʑ:ŵ{public ʑ(){Ɏ=1;ɒ="CmdAltitude";}public override bool Ɨ(
- bool ë){string ʐ=(ƚ.ʸ.EndsWith("sea")?"sea":"ground");switch(ʐ){case"sea":o.ƃ(Ď.ǡ("ALT1"));o.ƴ(o.ǀ.ɷ.ToString("F0")+" m");
- break;default:o.ƃ(Ď.ǡ("ALT2"));o.ƴ(o.ǀ.ɵ.ToString("F0")+" m");break;}return true;}}class ʏ:ŵ{public ʏ(){Ɏ=15;ɒ=
- "CmdBlockCount";}β Ķ;public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}bool ʎ;bool ʍ;int ĵ=0;int Y=0;public override bool Ɨ(bool ë){if(!ë){ʎ=(ƚ.
- ʸ=="enabledcount");ʍ=(ƚ.ʸ=="prodcount");ĵ=0;Y=0;}if(ƚ.ˋ.Count==0){if(Y==0){if(!ë)Ķ.Ŧ();if(!Ķ.μ(ƚ.ʣ,ë))return false;Y++;ë=
- false;}if(!ʜ(Ķ,"blocks",ʎ,ʍ,ë))return false;return true;}for(;ĵ<ƚ.ˋ.Count;ĵ++){ˀ ij=ƚ.ˋ[ĵ];if(!ë)ij.ʻ();if(!Į(ij,ë))return false
- ;ë=false;}return true;}int ı=0;int IJ=0;bool Į(ˀ ij,bool ë){if(!ë){ı=0;IJ=0;}for(;ı<ij.ʽ.Count;ı++){if(IJ==0){if(!ë)Ķ.Ŧ();if(!
- Ķ.ϼ(ij.ʽ[ı],ƚ.ʣ,ë))return false;IJ++;ë=false;}if(!ʜ(Ķ,ij.ʽ[ı],ʎ,ʍ,ë))return false;IJ=0;ë=false;}return true;}Dictionary<
- string,int>ʢ=new Dictionary<string,int>();Dictionary<string,int>ʡ=new Dictionary<string,int>();List<string>ʠ=new List<string>(
- );int ì=0;int ʟ=0;int ʞ=0;ʌ ʝ=new ʌ();bool ʜ(β Ā,string ʐ,bool ʎ,bool ʍ,bool ë){if(Ā.ϲ()==0){ʝ.Ŧ().ʆ(char.ToUpper(ʐ[0])).
- ʆ(ʐ.ToLower(),1,ʐ.Length-1);o.ƃ(ʝ.ʆ(" ").ʆ(Ď.ǡ("C1")).ʆ(" "));string ʚ=(ʎ||ʍ?"0 / 0":"0");o.ƴ(ʚ);return true;}if(!ë){ʢ.
- Clear();ʡ.Clear();ʠ.Clear();ì=0;ʟ=0;ʞ=0;}if(ʞ==0){for(;ì<Ā.ϲ();ì++){if(!Ɠ.Ȝ(15))return false;IMyProductionBlock Ő=Ā.ί[ì]as
- IMyProductionBlock;ʝ.Ŧ().ʆ(Ā.ί[ì].DefinitionDisplayNameText);string Ƕ=ʝ.ɕ();if(ʠ.Contains(Ƕ)){ʢ[Ƕ]++;if((ʎ&&Ā.ί[ì].IsWorking)||(ʍ&&Ő!=null
- &&Ő.IsProducing))ʡ[Ƕ]++;}else{ʢ.Add(Ƕ,1);ʠ.Add(Ƕ);if(ʎ||ʍ)if((ʎ&&Ā.ί[ì].IsWorking)||(ʍ&&Ő!=null&&Ő.IsProducing))ʡ.Add(Ƕ,1)
- ;else ʡ.Add(Ƕ,0);}}ʞ++;ë=false;}for(;ʟ<ʢ.Count;ʟ++){if(!Ɠ.Ȝ(8))return false;o.ƃ(ʠ[ʟ]+" "+Ď.ǡ("C1")+" ");string ʚ=(ʎ||ʍ?ʡ[
- ʠ[ʟ]]+" / ":"")+ʢ[ʠ[ʟ]];o.ƴ(ʚ);}return true;}}class ʙ:ŵ{β Ķ;public ʙ(){Ɏ=2;ɒ="CmdCargo";}public override void Ʌ(){Ķ=new β
- (Ɠ,o.ő);}bool ʘ=true;bool ʗ=false;bool ʕ=false;bool ʖ=false;double ː=0;double Ο=0;int Y=0;public override bool Ɨ(bool ë){
- if(!ë){Ķ.Ŧ();ʘ=ƚ.ʸ.Contains("all");ʖ=ƚ.ʸ.EndsWith("bar");ʗ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='x');ʕ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='p');ː=0;Ο=0;Y=0
- ;}if(Y==0){if(ʘ){if(!Ķ.μ(ƚ.ʣ,ë))return false;}else{if(!Ķ.ϼ("cargocontainer",ƚ.ʣ,ë))return false;}Y++;ë=false;}double Ξ=Ķ.
- ω(ref ː,ref Ο,ë);if(Double.IsNaN(Ξ))return false;if(ʖ){o.Ư(Ξ);return true;}o.ƃ(Ď.ǡ("C2")+" ");if(!ʗ&&!ʕ){o.ƴ(o.ȅ(ː)+
- "L / "+o.ȅ(Ο)+"L");o.Ƶ(Ξ,1.0f,o.ə);o.Ǎ(' '+o.Ǽ(Ξ)+"%");}else if(ʕ){o.ƴ(o.Ǽ(Ξ)+"%");o.Ư(Ξ);}else o.ƴ(o.Ǽ(Ξ)+"%");return true;}}
- class Ν:ŵ{public Ν(){Ɏ=3;ɒ="CmdCharge";}β Ķ;public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}int Y=0;int ì=0;bool ʗ=false;bool Μ=
- false;bool ʖ=false;Dictionary<long,double>f=new Dictionary<long,double>();Dictionary<long,double>Κ=new Dictionary<long,double
- >();Dictionary<long,double>Ι=new Dictionary<long,double>();Dictionary<long,double>Θ=new Dictionary<long,double>();
- Dictionary<long,double>Η=new Dictionary<long,double>();double Ζ(long Ε,double ˆ,double Ŷ){double Δ=0;double Γ=0;double Λ=0;double
- Π=0;if(Κ.TryGetValue(Ε,out Λ)){Π=Θ[Ε];}if(f.TryGetValue(Ε,out Δ)){Γ=Ι[Ε];}double Χ=(Ɠ.ȏ-Λ);double ά=0;if(Χ>0)ά=(ˆ-Π)/Χ;if
- (ά<0){if(!Η.TryGetValue(Ε,out ά))ά=0;}else Η[Ε]=ά;if(Δ>0){Κ[Ε]=f[Ε];Θ[Ε]=Ι[Ε];}f[Ε]=Ɠ.ȏ;Ι[Ε]=ˆ;return(ά>0?(Ŷ-ˆ)/ά:0);}
- public override bool Ɨ(bool ë){if(!ë){Ķ.Ŧ();ʖ=ƚ.ʸ.EndsWith("bar");ʗ=ƚ.ʸ.Contains("x");Μ=ƚ.ʸ.Contains("time");ì=0;Y=0;}if(Y==0)
- {if(!Ķ.ϼ("jumpdrive",ƚ.ʣ,ë))return false;if(Ķ.ϲ()<=0){o.Ǎ("Charge: "+Ď.ǡ("D2"));return true;}Y++;ë=false;}for(;ì<Ķ.ϲ();ì
- ++){if(!Ɠ.Ȝ(25))return false;IMyJumpDrive Ō=Ķ.ί[ì]as IMyJumpDrive;double ˆ,Ŷ,ʒ;ʒ=o.ő.Ϛ(Ō,out ˆ,out Ŷ);if(ʖ){o.Ư(ʒ);}else{o
- .ƃ(Ō.CustomName+" ");if(Μ){TimeSpan Ϊ=TimeSpan.FromSeconds(Ζ(Ō.EntityId,ˆ,Ŷ));o.ƴ(o.ǁ.ȕ(Ϊ));if(!ʗ){o.Ƶ(ʒ,1.0f,o.ə);o.ƴ(
- ' '+ʒ.ToString("0.0")+"%");}}else{if(!ʗ){o.ƴ(o.ȅ(ˆ)+"Wh / "+o.ȅ(Ŷ)+"Wh");o.Ƶ(ʒ,1.0f,o.ə);}o.ƴ(' '+ʒ.ToString("0.0")+"%");}}
- }return true;}}class Ω:ŵ{public Ω(){Ɏ=1;ɒ="CmdCountdown";}public override bool Ɨ(bool ë){bool ˣ=ƚ.ʸ.EndsWith("c");bool Ϋ=
- ƚ.ʸ.EndsWith("r");string Ψ="";int ͷ=ƚ.ʺ.IndexOf(' ');if(ͷ>=0)Ψ=ƚ.ʺ.Substring(ͷ+1).Trim();DateTime Φ=DateTime.Now;DateTime
- Υ;if(!DateTime.TryParseExact(Ψ,"H:mm d.M.yyyy",System.Globalization.CultureInfo.InvariantCulture,System.Globalization.
- DateTimeStyles.None,out Υ)){o.Ǎ(Ď.ǡ("C3"));o.Ǎ(" Countdown 19:02 28.2.2015");return true;}TimeSpan ˠ=Υ-Φ;string ĸ="";if(ˠ.Ticks<=0)ĸ=
- Ď.ǡ("C4");else{if((int)ˠ.TotalDays>0)ĸ+=(int)ˠ.TotalDays+" "+Ď.ǡ("C5")+" ";if(ˠ.Hours>0||ĸ!="")ĸ+=ˠ.Hours+"h ";if(ˠ.
- Minutes>0||ĸ!="")ĸ+=ˠ.Minutes+"m ";ĸ+=ˠ.Seconds+"s";}if(ˣ)o.Ƣ(ĸ);else if(Ϋ)o.ƴ(ĸ);else o.Ǎ(ĸ);return true;}}class Τ:ŵ{public Τ(
- ){Ɏ=1;ɒ="CmdCustomData";}public override bool Ɨ(bool ë){string ĸ="";if(ƚ.ʣ!=""&&ƚ.ʣ!="*"){IMyTerminalBlock Σ=o.ƿ.
- GetBlockWithName(ƚ.ʣ)as IMyTerminalBlock;if(Σ==null){o.Ǎ("CustomData: "+Ď.ǡ("CD1")+ƚ.ʣ);return true;}ĸ=Σ.CustomData;}else{o.Ǎ(
- "CustomData:"+Ď.ǡ("CD2"));return true;}if(ĸ.Length==0)return true;o.nj(ĸ);return true;}}class Ρ:ŵ{public Ρ(){Ɏ=5;ɒ="CmdDamage";}β Ķ;
- public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}bool Ɯ=false;int ì=0;public override bool Ɨ(bool ë){bool ʗ=ƚ.ʸ.StartsWith("damagex");
- bool Ͷ=ƚ.ʸ.EndsWith("noc");bool ʹ=(!Ͷ&&ƚ.ʸ.EndsWith("c"));float ͳ=100;if(!ë){Ķ.Ŧ();Ɯ=false;ì=0;}if(!Ķ.μ(ƚ.ʣ,ë))return false;
- if(ƚ.ˋ.Count>0){if(!float.TryParse(ƚ.ˋ[0].ij,out ͳ))ͳ=100;}ͳ-=0.00001f;for(;ì<Ķ.ϲ();ì++){if(!Ɠ.Ȝ(30))return false;
- IMyTerminalBlock å=Ķ.ί[ì];IMySlimBlock Ͳ=å.CubeGrid.GetCubeBlock(å.Position);if(Ͳ==null)continue;float ͱ=(Ͷ?Ͳ.MaxIntegrity:Ͳ.
- BuildIntegrity);if(!ʹ)ͱ-=Ͳ.CurrentDamage;float ʒ=100*(ͱ/Ͳ.MaxIntegrity);if(ʒ>=ͳ)continue;Ɯ=true;string Ͱ=o.ǜ(Ͳ.FatBlock.
- DisplayNameText,o.ɠ*0.69f-o.ə);o.ƃ(Ͱ+' ');if(!ʗ){o.Ʃ(o.ȅ(ͱ)+" / ",0.69f);o.ƃ(o.ȅ(Ͳ.MaxIntegrity));}o.ƴ(' '+ʒ.ToString("0.0")+'%');o.Ư(ʒ
- );}if(!Ɯ)o.Ǎ(Ď.ǡ("D3"));return true;}}class ˮ:ŵ{public ˮ(){Ɏ=1;ɒ="CmdDateTime";}public override bool Ɨ(bool ë){bool ˬ=(ƚ.
- ʸ.StartsWith("datetime"));bool ˤ=(ƚ.ʸ.StartsWith("date"));bool ˣ=ƚ.ʸ.Contains("c");int ˢ=ƚ.ʸ.IndexOf('+');if(ˢ<0)ˢ=ƚ.ʸ.
- IndexOf('-');float ˡ=0;if(ˢ>=0)float.TryParse(ƚ.ʸ.Substring(ˢ),out ˡ);DateTime ˠ=DateTime.Now.AddHours(ˡ);string ĸ="";int ͷ=ƚ.ʺ
- .IndexOf(' ');if(ͷ>=0)ĸ=ƚ.ʺ.Substring(ͷ+1);if(!ˬ){if(!ˤ)ĸ+=ˠ.ToShortTimeString();else ĸ+=ˠ.ToShortDateString();}else{if(ĸ
- =="")ĸ=String.Format("{0:d} {0:t}",ˠ);else{ĸ=ĸ.Replace("/","\\/");ĸ=ĸ.Replace(":","\\:");ĸ=ĸ.Replace("\"","\\\"");ĸ=ĸ.
- Replace("'","\\'");ĸ=ˠ.ToString(ĸ+' ');ĸ=ĸ.Substring(0,ĸ.Length-1);}}if(ˣ)o.Ƣ(ĸ);else o.Ǎ(ĸ);return true;}}class ˑ:ŵ{public ˑ()
- {Ɏ=5;ɒ="CmdDetails";}string Α="";β Ķ;public override void Ʌ(){Ķ=new β(Ɠ,o.ő);if(ƚ.ˋ.Count>0)Α=ƚ.ˋ[0].ij.Trim();}int Y=0;
- int ì=1;bool ΐ=false;IMyTerminalBlock å;public override bool Ɨ(bool ë){if(ƚ.ʣ==""||ƚ.ʣ=="*"){o.Ǎ("Details: "+Ď.ǡ("D1"));
- return true;}if(!ë){Ķ.Ŧ();ΐ=ƚ.ʸ.Contains("non");Y=0;ì=1;}if(Y==0){if(!Ķ.μ(ƚ.ʣ,ë))return true;if(Ķ.ϲ()<=0){o.Ǎ("Details: "+Ď.ǡ(
- "D2"));return true;}Y++;ë=false;}int Ώ=(ƚ.ʸ.EndsWith("x")?1:0);if(Y==1){if(!ë){å=Ķ.ί[0];if(!ΐ)o.Ǎ(å.CustomName);}if(!Ί(å,Ώ,ë
- ))return false;Y++;ë=false;}for(;ì<Ķ.ϲ();ì++){if(!ë){å=Ķ.ί[ì];if(!ΐ){o.Ǎ("");o.Ǎ(å.CustomName);}}if(!Ί(å,Ώ,ë))return
- false;ë=false;}return true;}string[]lj;int Ύ=0;bool Ό=false;ʌ ƫ=new ʌ();bool Ί(IMyTerminalBlock å,int Ή,bool ë){if(!ë){lj=ƫ.Ŧ()
- .ʆ(å.DetailedInfo).ʆ('\n').ʆ(å.CustomInfo).ɕ().Split('\n');Ύ=Ή;Ό=(Α.Length==0);}for(;Ύ<lj.Length;Ύ++){if(!Ɠ.Ȝ(5))return
- false;if(lj[Ύ].Length==0)continue;if(!Ό){if(!lj[Ύ].Contains(Α))continue;Ό=true;}o.Ǎ(ƫ.Ŧ().ʆ(" ").ʆ(lj[Ύ]));}return true;}}class
- Έ:ŵ{public Έ(){Ɏ=1;ɒ="CmdDistance";}string Ά="";string[]ͽ;Vector3D ͼ;string ͻ="";bool ͺ=false;public override void Ʌ(){ͺ=
- false;if(ƚ.ˋ.Count<=0)return;Ά=ƚ.ˋ[0].ij.Trim();ͽ=Ά.Split(':');if(ͽ.Length<5||ͽ[0]!="GPS")return;double θ,Ћ,Ѽ;if(!double.
- TryParse(ͽ[2],out θ))return;if(!double.TryParse(ͽ[3],out Ћ))return;if(!double.TryParse(ͽ[4],out Ѽ))return;ͼ=new Vector3D(θ,Ћ,Ѽ);
- ͻ=ͽ[1];ͺ=true;}public override bool Ɨ(bool ë){if(!ͺ){o.Ǎ("Distance: "+Ď.ǡ("DTU")+" '"+Ά+"'.");return true;}
- IMyTerminalBlock å=k.E.å;if(ƚ.ʣ!=""&&ƚ.ʣ!="*"){å=o.ƿ.GetBlockWithName(ƚ.ʣ);if(å==null){o.Ǎ("Distance: "+Ď.ǡ("P1")+": "+ƚ.ʣ);return true;
- }}double ъ=Vector3D.Distance(å.GetPosition(),ͼ);o.ƃ(ͻ+": ");o.ƴ(o.ȅ(ъ)+"m ");return true;}}class Ҙ:ŵ{β Ķ;public Ҙ(){Ɏ=2;ɒ
- ="CmdDocked";}public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}int Y=0;int җ=0;bool Җ=false;bool ҕ=false;IMyShipConnector œ;
- public override bool Ɨ(bool ë){if(!ë){if(ƚ.ʸ.EndsWith("e"))Җ=true;if(ƚ.ʸ.Contains("cn"))ҕ=true;Ķ.Ŧ();Y=0;}if(Y==0){if(!Ķ.ϼ(
- "connector",ƚ.ʣ,ë))return false;Y++;җ=0;ë=false;}if(Ķ.ϲ()<=0){o.Ǎ("Docked: "+Ď.ǡ("DO1"));return true;}for(;җ<Ķ.ϲ();җ++){œ=Ķ.ί[җ]as
- IMyShipConnector;if(œ.Status==MyShipConnectorStatus.Connected){if(ҕ){o.ƃ(œ.CustomName+":");o.ƴ(œ.OtherConnector.CubeGrid.CustomName);}
- else{o.Ǎ(œ.OtherConnector.CubeGrid.CustomName);}}else{if(Җ){if(ҕ){o.ƃ(œ.CustomName+":");o.ƴ("-");}else o.Ǎ("-");}}}return
- true;}}class Ҕ:ŵ{public Ҕ(){Ɏ=30;ɒ="CmdEcho";}public override bool Ɨ(bool ë){string ʐ=(ƚ.ʸ=="center"?"c":(ƚ.ʸ=="right"?"r":
- "n"));switch(ʐ){case"c":o.Ƣ(ƚ.ˏ);break;case"r":o.ƴ(ƚ.ˏ);break;default:o.Ǎ(ƚ.ˏ);break;}return true;}}class Ғ:ŵ{public Ғ(){Ɏ=
- 1;ɒ="CmdGravity";}public override bool Ɨ(bool ë){string ʐ=(ƚ.ʸ.Contains("nat")?"n":(ƚ.ʸ.Contains("art")?"a":(ƚ.ʸ.Contains
- ("tot")?"t":"s")));Vector3D ϕ;if(o.ǀ.ɲ==null){o.Ǎ("Gravity: "+Ď.ǡ("GNC"));return true;}switch(ʐ){case"n":o.ƃ(Ď.ǡ("G2")+
- " ");ϕ=o.ǀ.ɲ.GetNaturalGravity();o.ƴ(ϕ.Length().ToString("F1")+" m/s²");break;case"a":o.ƃ(Ď.ǡ("G3")+" ");ϕ=o.ǀ.ɲ.
- GetArtificialGravity();o.ƴ(ϕ.Length().ToString("F1")+" m/s²");break;case"t":o.ƃ(Ď.ǡ("G1")+" ");ϕ=o.ǀ.ɲ.GetTotalGravity();o.ƴ(ϕ.Length().
- ToString("F1")+" m/s²");break;default:o.ƃ(Ď.ǡ("GN"));o.Ʃ(" | ",0.33f);o.Ʃ(Ď.ǡ("GA")+" | ",0.66f);o.ƴ(Ď.ǡ("GT"),1.0f);o.ƃ("");ϕ=o
- .ǀ.ɲ.GetNaturalGravity();o.Ʃ(ϕ.Length().ToString("F1")+" | ",0.33f);ϕ=o.ǀ.ɲ.GetArtificialGravity();o.Ʃ(ϕ.Length().
- ToString("F1")+" | ",0.66f);ϕ=o.ǀ.ɲ.GetTotalGravity();o.ƴ(ϕ.Length().ToString("F1")+" ");break;}return true;}}class ґ:ŵ{public ґ
- (){Ɏ=0.5;ɒ="CmdHScroll";}ʌ ғ=new ʌ();int ҙ=1;public override bool Ɨ(bool ë){if(ғ.ʊ==0){string ĸ=ƚ.ˏ+" ";if(ĸ.Length==0)
- return true;float ҡ=o.ɠ;float Ʀ=o.Ǟ(ĸ,o.ƹ);float ю=ҡ/Ʀ;if(ю>1)ғ.ʆ(string.Join("",Enumerable.Repeat(ĸ,(int)Math.Ceiling(ю))));
- else ғ.ʆ(ĸ);if(ĸ.Length>40)ҙ=3;else if(ĸ.Length>5)ҙ=2;else ҙ=1;o.Ǎ(ғ);return true;}bool Ϋ=ƚ.ʸ.EndsWith("r");if(Ϋ){ғ.ƫ.Insert
- (0,ғ.ɕ(ғ.ʊ-ҙ,ҙ));ғ.ʅ(ғ.ʊ-ҙ,ҙ);}else{ғ.ʆ(ғ.ɕ(0,ҙ));ғ.ʅ(0,ҙ);}o.Ǎ(ғ);return true;}}class Ҡ:ŵ{public Ҡ(){Ɏ=7;ɒ="CmdInvList";
- }float ҟ=-1;float Ҟ=-1;public override void Ʌ(){Ķ=new β(Ɠ,o.ő);ѱ=new Ɩ(Ɠ,o);}ʌ ƫ=new ʌ(100);Dictionary<string,string>ҝ=
- new Dictionary<string,string>();void Ң(string ȥ,double ѳ,int ć){if(ć>0){if(!Ҍ)o.Ƶ(Math.Min(100,100*ѳ/ć),0.3f);string Ͱ;if(ҝ
- .ContainsKey(ȥ)){Ͱ=ҝ[ȥ];}else{if(!ҍ)Ͱ=o.ǜ(ȥ,o.ɠ*0.5f-қ-Ҟ);else{if(!Ҍ)Ͱ=o.ǜ(ȥ,o.ɠ*0.5f);else Ͱ=o.ǜ(ȥ,o.ɠ*0.9f);}ҝ[ȥ]=Ͱ;}ƫ.
- Ŧ();if(!Ҍ)ƫ.ʆ(' ');if(!ҍ){o.ƃ(ƫ.ʆ(Ͱ).ʆ(' '));o.Ʃ(o.ȅ(ѳ),1.0f,қ+Ҟ);o.Ǎ(ƫ.Ŧ().ʆ(" / ").ʆ(o.ȅ(ć)));}else{o.Ǎ(ƫ.ʆ(Ͱ));}}else{
- if(!ҍ){o.ƃ(ƫ.Ŧ().ʆ(ȥ).ʆ(':'));o.ƴ(o.ȅ(ѳ),1.0f,ҟ);}else o.Ǎ(ƫ.Ŧ().ʆ(ȥ));}}void Ҝ(string ȥ,double ѳ,double Ѳ,int ć){if(ć>0){
- if(!ҍ){o.ƃ(ƫ.Ŧ().ʆ(ȥ).ʆ(' '));o.Ʃ(o.ȅ(ѳ),0.51f);o.ƃ(ƫ.Ŧ().ʆ(" / ").ʆ(o.ȅ(ć)));o.ƴ(ƫ.Ŧ().ʆ(" +").ʆ(o.ȅ(Ѳ)).ʆ(" ").ʆ(Ď.ǡ(
- "I1")),1.0f);}else o.Ǎ(ƫ.Ŧ().ʆ(ȥ));if(!Ҍ)o.Ư(Math.Min(100,100*ѳ/ć));}else{if(!ҍ){o.ƃ(ƫ.Ŧ().ʆ(ȥ).ʆ(':'));o.Ʃ(o.ȅ(ѳ),0.51f);o.
- ƴ(ƫ.Ŧ().ʆ(" +").ʆ(o.ȅ(Ѳ)).ʆ(" ").ʆ(Ď.ǡ("I1")),1.0f);}else{o.Ǎ(ƫ.Ŧ().ʆ(ȥ));}}}float қ=0;bool Қ(Ÿ ż){int ć=(ҏ?ż.ŷ:ż.Ŷ);if(ć
- <0)return true;float Ʋ=o.Ǟ(o.ȅ(ć),o.ƹ);if(Ʋ>қ)қ=Ʋ;return true;}List<Ÿ>Ѿ;int ѻ=0;int Ѻ=0;bool ѹ(bool ë,bool Ѹ,string Ï,
- string П){if(!ë){Ѻ=0;ѻ=0;}if(Ѻ==0){if(ҁ){if((Ѿ=ѱ.ž(Ï,ë,Қ))==null)return false;}else{if((Ѿ=ѱ.ž(Ï,ë))==null)return false;}Ѻ++;ë=
- false;}if(Ѿ.Count>0){if(!Ѹ&&!ë){if(!o.Ƹ)o.Ǎ();o.Ƣ(ƫ.Ŧ().ʆ("<< ").ʆ(П).ʆ(" ").ʆ(Ď.ǡ("I2")).ʆ(" >>"));}for(;ѻ<Ѿ.Count;ѻ++){if(!
- Ɠ.Ȝ(30))return false;double ѳ=Ѿ[ѻ].ƌ;if(ҏ&&ѳ>=Ѿ[ѻ].ŷ)continue;int ć=Ѿ[ѻ].Ŷ;if(ҏ)ć=Ѿ[ѻ].ŷ;string ȥ=o.Dz(Ѿ[ѻ].Ð,Ѿ[ѻ].Ï);Ң(ȥ,
- ѳ,ć);}}return true;}List<Ÿ>ѷ;int Ѷ=0;int ѵ=0;bool Ѵ(bool ë){if(!ë){Ѷ=0;ѵ=0;}if(ѵ==0){if((ѷ=ѱ.ž("Ingot",ë))==null)return
- false;ѵ++;ë=false;}if(ѷ.Count>0){if(!Ҏ&&!ë){if(!o.Ƹ)o.Ǎ();o.Ƣ(ƫ.Ŧ().ʆ("<< ").ʆ(Ď.ǡ("I4")).ʆ(" ").ʆ(Ď.ǡ("I2")).ʆ(" >>"));}for(
- ;Ѷ<ѷ.Count;Ѷ++){if(!Ɠ.Ȝ(40))return false;double ѳ=ѷ[Ѷ].ƌ;if(ҏ&&ѳ>=ѷ[Ѷ].ŷ)continue;int ć=ѷ[Ѷ].Ŷ;if(ҏ)ć=ѷ[Ѷ].ŷ;string ȥ=o.Dz
- (ѷ[Ѷ].Ð,ѷ[Ѷ].Ï);if(ѷ[Ѷ].Ð!="Scrap"){double Ѳ=ѱ.Ɓ(ѷ[Ѷ].Ð+" Ore",ѷ[Ѷ].Ð,"Ore").ƌ;Ҝ(ȥ,ѳ,Ѳ,ć);}else Ң(ȥ,ѳ,ć);}}return true;}β
- Ķ=null;Ɩ ѱ;List<ˀ>ˋ;bool Ѱ,ʗ,ҏ,Ҏ,ҍ,Ҍ;int ĵ,ı;string ҋ="";float Ҋ=0;bool ҁ=true;void Ҁ(){if(o.ƹ!=ҋ||Ҋ!=o.ɠ){ҝ.Clear();Ҋ=o.
- ɠ;}if(o.ƹ!=ҋ){Ҟ=o.Ǟ(" / ",o.ƹ);ҟ=o.Ǹ(' ',o.ƹ);ҋ=o.ƹ;}Ķ.Ŧ();Ѱ=ƚ.ʸ.EndsWith("x")||ƚ.ʸ.EndsWith("xs");ʗ=ƚ.ʸ.EndsWith("s")||ƚ
- .ʸ.EndsWith("sx");ҏ=ƚ.ʸ.StartsWith("missing");Ҏ=ƚ.ʸ.Contains("list");Ҍ=ƚ.ʸ.Contains("nb");ҍ=ƚ.ʸ.Contains("nn");ѱ.Ŧ();ˋ=ƚ.
- ˋ;if(ˋ.Count==0)ˋ.Add(new ˀ("all"));}bool ѿ(bool ë){if(!ë)ĵ=0;for(;ĵ<ˋ.Count;ĵ++){ˀ ij=ˋ[ĵ];ij.ʻ();string Ï=ij.ʾ;if(!ë)ı=0;
- else ë=false;for(;ı<ij.ʽ.Count;ı++){if(!Ɠ.Ȝ(30))return false;string[]Ą=ij.ʽ[ı].Split(':');double Ȃ;if(string.Compare(Ą[0],
- "all",true)==0)Ą[0]="";int ŷ=1;int Ŷ=-1;if(Ą.Length>1){if(Double.TryParse(Ą[1],out Ȃ)){if(ҏ)ŷ=(int)Math.Ceiling(Ȃ);else Ŷ=(
- int)Math.Ceiling(Ȃ);}}string Ơ=Ą[0];if(!string.IsNullOrEmpty(Ï))Ơ+=' '+Ï;ѱ.ơ(Ơ,ij.ʿ=="-",ŷ,Ŷ);}}return true;}int Л=0;int ς=0
- ;int ѽ=0;List<MyInventoryItem>Ɔ=new List<MyInventoryItem>();bool Ґ(bool ë){β ϳ=Ķ;if(!ë)Л=0;for(;Л<ϳ.ί.Count;Л++){if(!ë)ς=
- 0;for(;ς<ϳ.ί[Л].InventoryCount;ς++){IMyInventory ρ=ϳ.ί[Л].GetInventory(ς);if(!ë){ѽ=0;Ɔ.Clear();ρ.GetItems(Ɔ);}else ë=
- false;for(;ѽ<Ɔ.Count;ѽ++){if(!Ɠ.Ȝ(40))return false;MyInventoryItem À=Ɔ[ѽ];string Ò=o.ǵ(À);string Ð,Ï;o.dz(Ò,out Ð,out Ï);if(
- string.Compare(Ï,"ore",true)==0){if(ѱ.Ɲ(Ð+" ingot",Ð,"Ingot")&&ѱ.Ɲ(Ò,Ð,Ï))continue;}else{if(ѱ.Ɲ(Ò,Ð,Ï))continue;}o.dz(Ò,out Ð,
- out Ï);Ÿ Ź=ѱ.Ɓ(Ò,Ð,Ï);Ź.ƌ+=(double)À.Amount;}}}return true;}int Y=0;public override bool Ɨ(bool ë){if(!ë){Ҁ();Y=0;}for(;Y<=
- 10;Y++){switch(Y){case 0:if(!Ķ.μ(ƚ.ʣ,ë))return false;break;case 1:if(!ѿ(ë))return false;if(Ѱ)Y++;break;case 2:if(!ѱ.ź(ë))
- return false;break;case 3:if(!Ґ(ë))return false;break;case 4:if(!ѹ(ë,Ҏ,"Ore",Ď.ǡ("I3")))return false;break;case 5:if(ʗ){if(!ѹ(
- ë,Ҏ,"Ingot",Ď.ǡ("I4")))return false;}else{if(!Ѵ(ë))return false;}break;case 6:if(!ѹ(ë,Ҏ,"Component",Ď.ǡ("I5")))return
- false;break;case 7:if(!ѹ(ë,Ҏ,"OxygenContainerObject",Ď.ǡ("I6")))return false;break;case 8:if(!ѹ(ë,true,"GasContainerObject",
- ""))return false;break;case 9:if(!ѹ(ë,Ҏ,"AmmoMagazine",Ď.ǡ("I7")))return false;break;case 10:if(!ѹ(ë,Ҏ,"PhysicalGunObject"
- ,Ď.ǡ("I8")))return false;break;}ë=false;}ҁ=false;return true;}}class Ҽ:ŵ{public Ҽ(){Ɏ=2;ɒ="CmdAmount";}β Ķ;public
- override void Ʌ(){Ķ=new β(Ɠ,o.ő);}bool ҽ;bool һ=false;int IJ=0;int ĵ=0;int ı=0;public override bool Ɨ(bool ë){if(!ë){ҽ=!ƚ.ʸ.
- EndsWith("x");һ=ƚ.ʸ.EndsWith("bar");if(һ)ҽ=true;if(ƚ.ˋ.Count==0)ƚ.ˋ.Add(new ˀ(
- "reactor,gatlingturret,missileturret,interiorturret,gatlinggun,launcherreload,launcher,oxygenerator"));ĵ=0;}for(;ĵ<ƚ.ˋ.Count;ĵ++){ˀ ij=ƚ.ˋ[ĵ];if(!ë){ij.ʻ();IJ=0;ı=0;}for(;ı<ij.ʽ.Count;ı++){if(IJ==0){if(!ë){if(ij.ʽ[ı]=="")
- continue;Ķ.Ŧ();}string į=ij.ʽ[ı];if(!Ķ.ϼ(į,ƚ.ʣ,ë))return false;IJ++;ë=false;}if(!ӂ(ë))return false;ë=false;IJ=0;}}return true;}int
- ҹ=0;int ĭ=0;double Ź=0;double Ҹ=0;double Һ=0;int ѽ=0;IMyTerminalBlock Ҿ;IMyInventory ӄ;List<MyInventoryItem>Ɔ=new List<
- MyInventoryItem>();string Ӄ="";bool ӂ(bool ë){if(!ë){ҹ=0;ĭ=0;}for(;ҹ<Ķ.ϲ();ҹ++){if(ĭ==0){if(!Ɠ.Ȝ(50))return false;Ҿ=Ķ.ί[ҹ];ӄ=Ҿ.
- GetInventory(0);if(ӄ==null)continue;ĭ++;ë=false;}if(!ë){Ɔ.Clear();ӄ.GetItems(Ɔ);Ӄ=(Ɔ.Count>0?Ɔ[0].Type.ToString():"");ѽ=0;Ź=0;Ҹ=0;Һ=
- 0;}for(;ѽ<Ɔ.Count;ѽ++){if(!Ɠ.Ȝ(30))return false;MyInventoryItem À=Ɔ[ѽ];if(À.Type.ToString()!=Ӄ)Һ+=(double)À.Amount;else Ź
- +=(double)À.Amount;}string Ӂ=Ď.ǡ("A1");string ŀ=Ҿ.CustomName;if(Ź>0&&(double)ӄ.CurrentVolume>0){double Ӏ=Һ*(double)ӄ.
- CurrentVolume/(Ź+Һ);Ҹ=Math.Floor(Ź*((double)ӄ.MaxVolume-Ӏ)/((double)ӄ.CurrentVolume-Ӏ));Ӂ=o.ȅ(Ź)+" / "+(Һ>0?"~":"")+o.ȅ(Ҹ);}if(!һ||Ҹ
- <=0){ŀ=o.ǜ(ŀ,o.ɠ*0.8f);o.ƃ(ŀ);o.ƴ(Ӂ);}if(ҽ&&Ҹ>0){double ʒ=100*Ź/Ҹ;o.Ư(ʒ);}ĭ=0;ë=false;}return true;}}class ҿ:ŵ{β Ķ;public
- ҿ(){Ɏ=2;ɒ="CmdMass";}public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}bool ʗ=false;bool ʕ=false;int Y=0;public override bool Ɨ(
- bool ë){if(!ë){Ķ.Ŧ();ʗ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='x');ʕ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='p');Y=0;}if(Y==0){if(!Ķ.μ(ƚ.ʣ,ë))return false;Y++;ë=
- false;}double È=Ķ.σ(ë);if(Double.IsNaN(È))return false;double ʓ=0;int Ѧ=ƚ.ˋ.Count;if(Ѧ>0){double.TryParse(ƚ.ˋ[0].ij.Trim(),out
- ʓ);if(Ѧ>1){string ѥ=ƚ.ˋ[1].ij.Trim();char э=' ';if(ѥ.Length>0)э=Char.ToLower(ѥ[0]);int Ѥ="kmgtpezy".IndexOf(э);if(Ѥ>=0)ʓ*=
- Math.Pow(1000.0,Ѥ);}ʓ*=1000.0;}o.ƃ(Ď.ǡ("M1")+" ");if(ʓ<=0){o.ƴ(o.ȃ(È,false));return true;}double ʒ=È/ʓ*100;if(!ʗ&&!ʕ){o.ƴ(o.
- ȃ(È)+" / "+o.ȃ(ʓ));o.Ƶ(ʒ,1.0f,o.ə);o.Ǎ(' '+o.Ǽ(ʒ)+"%");}else if(ʕ){o.ƴ(o.Ǽ(ʒ)+"%");o.Ư(ʒ);}else o.ƴ(o.Ǽ(ʒ)+"%");return
- true;}}class ҷ:ŵ{ȳ ǁ;β Ķ;public ҷ(){Ɏ=3;ɒ="CmdOxygen";}public override void Ʌ(){ǁ=o.ǁ;Ķ=new β(Ɠ,o.ő);}int Y=0;int ì=0;bool Ɯ
- =false;int ҩ=0;double ȵ=0;double ȶ=0;double Ʈ;public override bool Ɨ(bool ë){if(!ë){Ķ.Ŧ();Y=0;ì=0;Ʈ=0;}if(Y==0){if(!Ķ.ϼ(
- "airvent",ƚ.ʣ,ë))return false;Ɯ=(Ķ.ϲ()>0);Y++;ë=false;}if(Y==1){for(;ì<Ķ.ϲ();ì++){if(!Ɠ.Ȝ(8))return false;IMyAirVent ŏ=Ķ.ί[ì]as
- IMyAirVent;Ʈ=Math.Max(ŏ.GetOxygenLevel()*100,0f);o.ƃ(ŏ.CustomName);if(ŏ.CanPressurize)o.ƴ(o.Ǽ(Ʈ)+"%");else o.ƴ(Ď.ǡ("O1"));o.Ư(Ʈ);}
- Y++;ë=false;}if(Y==2){if(!ë)Ķ.Ŧ();if(!Ķ.ϼ("oxyfarm",ƚ.ʣ,ë))return false;ҩ=Ķ.ϲ();Y++;ë=false;}if(Y==3){if(ҩ>0){if(!ë)ì=0;
- double Ҩ=0;for(;ì<ҩ;ì++){if(!Ɠ.Ȝ(4))return false;IMyOxygenFarm ҧ=Ķ.ί[ì]as IMyOxygenFarm;Ҩ+=ҧ.GetOutput()*100;}Ʈ=Ҩ/ҩ;if(Ɯ)o.Ǎ(
- "");Ɯ|=(ҩ>0);o.ƃ(Ď.ǡ("O2"));o.ƴ(o.Ǽ(Ʈ)+"%");o.Ư(Ʈ);}Y++;ë=false;}if(Y==4){if(!ë)Ķ.Ŧ();if(!Ķ.ϼ("oxytank",ƚ.ʣ,ë))return
- false;ҩ=Ķ.ϲ();if(ҩ==0){if(!Ɯ)o.Ǎ(Ď.ǡ("O3"));return true;}Y++;ë=false;}if(Y==5){if(!ë){ȵ=0;ȶ=0;ì=0;}if(!ǁ.ȸ(Ķ.ί,"oxygen",ref ȶ
- ,ref ȵ,ë))return false;if(ȵ==0){if(!Ɯ)o.Ǎ(Ď.ǡ("O3"));return true;}Ʈ=ȶ/ȵ*100;if(Ɯ)o.Ǎ("");o.ƃ(Ď.ǡ("O4"));o.ƴ(o.Ǽ(Ʈ)+"%");o
- .Ư(Ʈ);Y++;}return true;}}class Ҧ:ŵ{public Ҧ(){Ɏ=1;ɒ="CmdPosition";}public override bool Ɨ(bool ë){bool ҥ=(ƚ.ʸ=="posxyz");
- bool Ά=(ƚ.ʸ=="posgps");IMyTerminalBlock å=k.E.å;if(ƚ.ʣ!=""&&ƚ.ʣ!="*"){å=o.ƿ.GetBlockWithName(ƚ.ʣ);if(å==null){o.Ǎ("Pos: "+Ď.
- ǡ("P1")+": "+ƚ.ʣ);return true;}}if(Ά){Vector3D Ū=å.GetPosition();o.Ǎ("GPS:"+Ď.ǡ("P2")+":"+Ū.GetDim(0).ToString("F2")+":"+
- Ū.GetDim(1).ToString("F2")+":"+Ū.GetDim(2).ToString("F2")+":");return true;}o.ƃ(Ď.ǡ("P2")+": ");if(!ҥ){o.ƴ(å.GetPosition(
- ).ToString("F0"));return true;}o.Ǎ("");o.ƃ(" X: ");o.ƴ(å.GetPosition().GetDim(0).ToString("F0"));o.ƃ(" Y: ");o.ƴ(å.
- GetPosition().GetDim(1).ToString("F0"));o.ƃ(" Z: ");o.ƴ(å.GetPosition().GetDim(2).ToString("F0"));return true;}}class Ҥ:ŵ{public Ҥ(
- ){Ɏ=3;ɒ="CmdPower";}ȳ ǁ;β ң;β Ҫ;β Ҷ;β Ш;β Ҵ;β Ķ;public override void Ʌ(){ң=new β(Ɠ,o.ő);Ҫ=new β(Ɠ,o.ő);Ҷ=new β(Ɠ,o.ő);Ш=
- new β(Ɠ,o.ő);Ҵ=new β(Ɠ,o.ő);Ķ=new β(Ɠ,o.ő);ǁ=o.ǁ;}string П;bool ҳ;string Ц;string Ҳ;int ұ;int Y=0;public override bool Ɨ(
- bool ë){if(!ë){П=(ƚ.ʸ.EndsWith("x")?"s":(ƚ.ʸ.EndsWith("p")?"p":(ƚ.ʸ.EndsWith("v")?"v":"n")));ҳ=(ƚ.ʸ.StartsWith(
- "powersummary"));Ц="a";Ҳ="";if(ƚ.ʸ.Contains("stored"))Ц="s";else if(ƚ.ʸ.Contains("in"))Ц="i";else if(ƚ.ʸ.Contains("out"))Ц="o";Y=0;ң.Ŧ
- ();Ҫ.Ŧ();Ҷ.Ŧ();Ш.Ŧ();Ҵ.Ŧ();}if(Ц=="a"){if(Y==0){if(!ң.ϼ("reactor",ƚ.ʣ,ë))return false;ë=false;Y++;}if(Y==1){if(!Ҫ.ϼ(
- "hydrogenengine",ƚ.ʣ,ë))return false;ë=false;Y++;}if(Y==2){if(!Ҷ.ϼ("solarpanel",ƚ.ʣ,ë))return false;ë=false;Y++;}if(Y==3){if(!Ҵ.ϼ(
- "windturbine",ƚ.ʣ,ë))return false;ë=false;Y++;}}else if(Y==0)Y=4;if(Y==4){if(!Ш.ϼ("battery",ƚ.ʣ,ë))return false;ë=false;Y++;}int ҵ=ң.
- ϲ();int Ұ=Ҫ.ϲ();int ү=Ҷ.ϲ();int Ү=Ш.ϲ();int ҭ=Ҵ.ϲ();if(Y==5){ұ=0;if(ҵ>0)ұ++;if(Ұ>0)ұ++;if(ү>0)ұ++;if(ҭ>0)ұ++;if(Ү>0)ұ++;
- if(ұ<1){o.Ǎ(Ď.ǡ("P6"));return true;}if(ƚ.ˋ.Count>0){if(ƚ.ˋ[0].ij.Length>0)Ҳ=ƚ.ˋ[0].ij;}Y++;ë=false;}if(Ц!="a"){if(!Щ(Ш,(Ҳ==
- ""?Ď.ǡ("P7"):Ҳ),Ц,П,ë))return false;return true;}string Ч=Ď.ǡ("P8");if(!ҳ){if(Y==6){if(ҵ>0)if(!в(ң,(Ҳ==""?Ď.ǡ("P9"):Ҳ),П,ë
- ))return false;Y++;ë=false;}if(Y==7){if(Ұ>0)if(!в(Ҫ,(Ҳ==""?Ď.ǡ("P12"):Ҳ),П,ë))return false;Y++;ë=false;}if(Y==8){if(ү>0)
- if(!в(Ҷ,(Ҳ==""?Ď.ǡ("P10"):Ҳ),П,ë))return false;Y++;ë=false;}if(Y==9){if(ҭ>0)if(!в(Ҵ,(Ҳ==""?Ď.ǡ("P13"):Ҳ),П,ë))return false
- ;Y++;ë=false;}if(Y==10){if(Ү>0)if(!Щ(Ш,(Ҳ==""?Ď.ǡ("P7"):Ҳ),Ц,П,ë))return false;Y++;ë=false;}}else{Ч=Ď.ǡ("P11");ұ=10;if(Y
- ==6)Y=11;}if(ұ==1)return true;if(!ë){Ķ.Ŧ();Ķ.ϴ(ң);Ķ.ϴ(Ҫ);Ķ.ϴ(Ҷ);Ķ.ϴ(Ҵ);Ķ.ϴ(Ш);}if(!в(Ķ,Ч,П,ë))return false;return true;}
- void Н(double ˆ,double Ŷ){double М=(Ŷ>0?ˆ/Ŷ*100:0);switch(П){case"s":o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(М.ToString("F1")).ʆ("%"));break;case
- "v":o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(ˆ)).ʆ("W / ").ʆ(o.ȅ(Ŷ)).ʆ("W"));break;case"c":o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(ˆ)).ʆ("W"));break;case"p":o.ƴ(ƫ.Ŧ().ʆ(' '
- ).ʆ(М.ToString("F1")).ʆ("%"));o.Ư(М);break;default:o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(ˆ)).ʆ("W / ").ʆ(o.ȅ(Ŷ)).ʆ("W"));o.Ƶ(М,1.0f,o.ə);o.ƴ(ƫ.
- Ŧ().ʆ(' ').ʆ(М.ToString("F1")).ʆ("%"));break;}}double Ҭ=0;double З=0,ҫ=0;int ѯ=0;bool в(β ј,string Ч,string ʐ,bool ë){if(
- !ë){З=0;ҫ=0;ѯ=0;}if(ѯ==0){if(!ǁ.Ƚ(ј.ί,ǁ.ȱ,ref Ҭ,ref Ҭ,ref З,ref ҫ,ë))return false;ѯ++;ë=false;}if(!Ɠ.Ȝ(50))return false;
- double М=(ҫ>0?З/ҫ*100:0);o.ƃ(Ч+": ");Н(З*1000000,ҫ*1000000);return true;}double а=0,Я=0,Ю=0,Э=0;double Ь=0,Ы=0;int Ъ=0;ʌ ƫ=new
- ʌ(100);bool Щ(β Ш,string Ч,string Ц,string ʐ,bool ë){if(!ë){а=Я=0;Ю=Э=0;Ь=Ы=0;Ъ=0;}if(Ъ==0){if(!ǁ.ȭ(Ш.ί,ref Ю,ref Э,ref а
- ,ref Я,ref Ь,ref Ы,ë))return false;Ю*=1000000;Э*=1000000;а*=1000000;Я*=1000000;Ь*=1000000;Ы*=1000000;Ъ++;ë=false;}double
- Х=(Ы>0?Ь/Ы*100:0);double Ф=(Я>0?а/Я*100:0);double У=(Э>0?Ю/Э*100:0);bool б=Ц=="a";if(Ъ==1){if(!Ɠ.Ȝ(50))return false;if(б)
- {if(ʐ!="p"){o.ƃ(ƫ.Ŧ().ʆ(Ч).ʆ(": "));o.ƴ(ƫ.Ŧ().ʆ("(IN ").ʆ(o.ȅ(Ю)).ʆ("W / OUT ").ʆ(o.ȅ(а)).ʆ("W)"));}else o.Ǎ(ƫ.Ŧ().ʆ(Ч).ʆ
- (": "));o.ƃ(ƫ.Ŧ().ʆ(" ").ʆ(Ď.ǡ("P3")).ʆ(": "));}else o.ƃ(ƫ.Ŧ().ʆ(Ч).ʆ(": "));if(б||Ц=="s")switch(ʐ){case"s":o.ƴ(ƫ.Ŧ().ʆ(
- ' ').ʆ(Х.ToString("F1")).ʆ("%"));break;case"v":o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(Ь)).ʆ("Wh / ").ʆ(o.ȅ(Ы)).ʆ("Wh"));break;case"p":o.ƴ(ƫ.Ŧ().ʆ(
- ' ').ʆ(Х.ToString("F1")).ʆ("%"));o.Ư(Х);break;default:o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(Ь)).ʆ("Wh / ").ʆ(o.ȅ(Ы)).ʆ("Wh"));o.Ƶ(Х,1.0f,o.ə);o.ƴ
- (ƫ.Ŧ().ʆ(' ').ʆ(Х.ToString("F1")).ʆ("%"));break;}if(Ц=="s")return true;Ъ++;ë=false;}if(Ъ==2){if(!Ɠ.Ȝ(50))return false;if(
- б)o.ƃ(ƫ.Ŧ().ʆ(" ").ʆ(Ď.ǡ("P4")).ʆ(": "));if(б||Ц=="o")switch(ʐ){case"s":o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(Ф.ToString("F1")).ʆ("%"));
- break;case"v":o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(а)).ʆ("W / ").ʆ(o.ȅ(Я)).ʆ("W"));break;case"p":o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(Ф.ToString("F1")).ʆ("%"));o.Ư(
- Ф);break;default:o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(а)).ʆ("W / ").ʆ(o.ȅ(Я)).ʆ("W"));o.Ƶ(Ф,1.0f,o.ə);o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(Ф.ToString("F1")).ʆ(
- "%"));break;}if(Ц=="o")return true;Ъ++;ë=false;}if(!Ɠ.Ȝ(50))return false;if(б)o.ƃ(ƫ.Ŧ().ʆ(" ").ʆ(Ď.ǡ("P5")).ʆ(": "));if(б
- ||Ц=="i")switch(ʐ){case"s":o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(У.ToString("F1")).ʆ("%"));break;case"v":o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(Ю)).ʆ("W / ").ʆ(o.ȅ(
- Э)).ʆ("W"));break;case"p":o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(У.ToString("F1")).ʆ("%"));o.Ư(У);break;default:o.ƴ(ƫ.Ŧ().ʆ(o.ȅ(Ю)).ʆ("W / ")
- .ʆ(o.ȅ(Э)).ʆ("W"));o.Ƶ(У,1.0f,o.ə);o.ƴ(ƫ.Ŧ().ʆ(' ').ʆ(У.ToString("F1")).ʆ("%"));break;}return true;}}class Т:ŵ{public Т()
- {Ɏ=7;ɒ="CmdPowerTime";}class х{public TimeSpan Ċ=new TimeSpan(-1);public double А=-1;public double у=0;}х т=new х();β с;β
- р;public override void Ʌ(){с=new β(Ɠ,o.ő);р=new β(Ɠ,o.ő);}int п=0;double о=0;double н=0,м=0;double ф=0,л=0,й=0;double и=0
- ,з=0;int ж=0;private bool е(string ʣ,out TimeSpan д,out double г,bool ë){MyResourceSourceComponent Ⱥ;
- MyResourceSinkComponent Ȫ;double к=ɏ;х С=т;д=С.Ċ;г=С.А;if(!ë){с.Ŧ();р.Ŧ();С.А=0;п=0;о=0;н=м=0;ф=0;л=й=0;и=з=0;ж=0;}if(п==0){if(!с.ϼ("reactor",ʣ
- ,ë))return false;ë=false;п++;}if(п==1){for(;ж<с.ί.Count;ж++){if(!Ɠ.Ȝ(6))return false;IMyReactor å=с.ί[ж]as IMyReactor;if(
- å==null||!å.IsWorking)continue;if(å.Components.TryGet<MyResourceSourceComponent>(out Ⱥ)){н+=Ⱥ.CurrentOutputByType(o.ǁ.ȱ);
- м+=Ⱥ.MaxOutputByType(o.ǁ.ȱ);}о+=(double)å.GetInventory(0).CurrentMass;}ë=false;п++;}if(п==2){if(!р.ϼ("battery",ʣ,ë))
- return false;ë=false;п++;}if(п==3){if(!ë)ж=0;for(;ж<р.ί.Count;ж++){if(!Ɠ.Ȝ(15))return false;IMyBatteryBlock å=р.ί[ж]as
- IMyBatteryBlock;if(å==null||!å.IsWorking)continue;if(å.Components.TryGet<MyResourceSourceComponent>(out Ⱥ)){л=Ⱥ.CurrentOutputByType(o.ǁ
- .ȱ);й=Ⱥ.MaxOutputByType(o.ǁ.ȱ);}if(å.Components.TryGet<MyResourceSinkComponent>(out Ȫ)){л-=Ȫ.CurrentInputByType(o.ǁ.ȱ);}
- double И=(л<0?(å.MaxStoredPower-å.CurrentStoredPower)/(-л/3600):0);if(И>С.А)С.А=И;if(å.ChargeMode==ChargeMode.Recharge)
- continue;и+=л;з+=й;ф+=å.CurrentStoredPower;}ë=false;п++;}double З=н+и;if(З<=0)С.Ċ=TimeSpan.FromSeconds(-1);else{double Ж=С.Ċ.
- TotalSeconds;double Е;double Д=(С.у-о)/к;if(н<=0)Д=Math.Min(З,м)/3600000;double Г=0;if(з>0)Г=Math.Min(З,з)/3600;if(Д<=0&&Г<=0)Е=-1;
- else if(Д<=0)Е=ф/Г;else if(Г<=0)Е=о/Д;else{double В=Г;double Б=(н<=0?З/3600:Д*З/н);Е=ф/В+о/Б;}if(Ж<=0||Е<0)Ж=Е;else Ж=(Ж+Е)/
- 2;try{С.Ċ=TimeSpan.FromSeconds(Ж);}catch{С.Ċ=TimeSpan.FromSeconds(-1);}}С.у=о;г=С.А;д=С.Ċ;return true;}int Y=0;bool ʖ=
- false;bool ʗ=false;bool ʕ=false;double А=0;TimeSpan Ȕ;int Џ=0,Ў=0,Ѝ=0;int ǰ=0;int Ќ=0;public override bool Ɨ(bool ë){if(!ë){ʖ
- =ƚ.ʸ.EndsWith("bar");ʗ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='x');ʕ=(ƚ.ʸ[ƚ.ʸ.Length-1]=='p');Y=0;Џ=Ў=Ѝ=ǰ=0;Ќ=0;А=0;}if(Y==0){if(ƚ.ˋ.Count>0
- ){for(;Ќ<ƚ.ˋ.Count;Ќ++){if(!Ɠ.Ȝ(100))return false;ƚ.ˋ[Ќ].ʻ();if(ƚ.ˋ[Ќ].ʽ.Count<=0)continue;string ij=ƚ.ˋ[Ќ].ʽ[0];int.
- TryParse(ij,out ǰ);if(Ќ==0)Џ=ǰ;else if(Ќ==1)Ў=ǰ;else if(Ќ==2)Ѝ=ǰ;}}Y++;ë=false;}if(Y==1){if(!е(ƚ.ʣ,out Ȕ,out А,ë))return false;Y
- ++;ë=false;}if(!Ɠ.Ȝ(30))return false;double Ċ=0;TimeSpan Й;try{Й=new TimeSpan(Џ,Ў,Ѝ);}catch{Й=TimeSpan.FromSeconds(-1);}
- string ĸ;if(Ȕ.TotalSeconds>0||А<=0){if(!ʖ)o.ƃ(Ď.ǡ("PT1")+" ");ĸ=o.ǁ.ȕ(Ȕ);Ċ=Ȕ.TotalSeconds;}else{if(!ʖ)o.ƃ(Ď.ǡ("PT2")+" ");ĸ=o.
- ǁ.ȕ(TimeSpan.FromSeconds(А));if(Й.TotalSeconds>=А)Ċ=Й.TotalSeconds-А;else Ċ=0;}if(Й.Ticks<=0){o.ƴ(ĸ);return true;}double
- ʒ=Ċ/Й.TotalSeconds*100;if(ʒ>100)ʒ=100;if(ʖ){o.Ư(ʒ);return true;}if(!ʗ&&!ʕ){o.ƴ(ĸ);o.Ƶ(ʒ,1.0f,o.ə);o.Ǎ(' '+ʒ.ToString(
- "0.0")+"%");}else if(ʕ){o.ƴ(ʒ.ToString("0.0")+"%");o.Ư(ʒ);}else o.ƴ(ʒ.ToString("0.0")+"%");return true;}}class Р:ŵ{public Р()
- {Ɏ=7;ɒ="CmdPowerUsed";}ȳ ǁ;β Ķ;public override void Ʌ(){Ķ=new β(Ɠ,o.ő);ǁ=o.ǁ;}string П;string О;string ϝ;void Н(double ˆ,
- double Ŷ){double М=(Ŷ>0?ˆ/Ŷ*100:0);switch(П){case"s":o.ƴ(М.ToString("0.0")+"%",1.0f);break;case"v":o.ƴ(o.ȅ(ˆ)+"W / "+o.ȅ(Ŷ)+
- "W",1.0f);break;case"c":o.ƴ(o.ȅ(ˆ)+"W",1.0f);break;case"p":o.ƴ(М.ToString("0.0")+"%",1.0f);o.Ư(М);break;default:o.ƴ(o.ȅ(ˆ)+
- "W / "+o.ȅ(Ŷ)+"W");o.Ƶ(М,1.0f,o.ə);o.ƴ(' '+М.ToString("0.0")+"%");break;}}double Ȭ=0,Ȳ=0;int Л=0;int Y=0;ѡ К=new ѡ();public
- override bool Ɨ(bool ë){if(!ë){П=(ƚ.ʸ.EndsWith("x")?"s":(ƚ.ʸ.EndsWith("usedp")||ƚ.ʸ.EndsWith("topp")?"p":(ƚ.ʸ.EndsWith("v")?"v":
- (ƚ.ʸ.EndsWith("c")?"c":"n"))));О=(ƚ.ʸ.Contains("top")?"top":"");ϝ=(ƚ.ˋ.Count>0?ƚ.ˋ[0].ij:Ď.ǡ("PU1"));Ȭ=Ȳ=0;Y=0;Л=0;Ķ.Ŧ();К
- .w();}if(Y==0){if(!Ķ.μ(ƚ.ʣ,ë))return false;ë=false;Y++;}MyResourceSinkComponent Ȫ;MyResourceSourceComponent Ⱥ;switch(О){
- case"top":if(Y==1){for(;Л<Ķ.ί.Count;Л++){if(!Ɠ.Ȝ(20))return false;IMyTerminalBlock å=Ķ.ί[Л];if(å.Components.TryGet<
- MyResourceSinkComponent>(out Ȫ)){ListReader<MyDefinitionId>Ȗ=Ȫ.AcceptedResources;if(Ȗ.IndexOf(ǁ.ȱ)<0)continue;Ȭ=Ȫ.CurrentInputByType(ǁ.ȱ)*
- 1000000;}else continue;К.A(Ȭ,å);}ë=false;Y++;}if(К.º()<=0){o.Ǎ("PowerUsedTop: "+Ď.ǡ("D2"));return true;}int Ľ=10;if(ƚ.ˋ.Count>0
- )if(!int.TryParse(ϝ,out Ľ)){Ľ=10;}if(Ľ>К.º())Ľ=К.º();if(Y==2){if(!ë){Л=К.º()-1;К.Ã();}for(;Л>=К.º()-Ľ;Л--){if(!Ɠ.Ȝ(30))
- return false;IMyTerminalBlock å=К.ª(Л);string ŀ=o.ǜ(å.CustomName,o.ɠ*0.4f);if(å.Components.TryGet<MyResourceSinkComponent>(out
- Ȫ)){Ȭ=Ȫ.CurrentInputByType(ǁ.ȱ)*1000000;Ȳ=Ȫ.MaxRequiredInputByType(ǁ.ȱ)*1000000;}o.ƃ(ŀ+" ");Н(Ȭ,Ȳ);}}break;default:for(;Л
- <Ķ.ί.Count;Л++){if(!Ɠ.Ȝ(10))return false;double Ѣ;IMyTerminalBlock å=Ķ.ί[Л];if(å.Components.TryGet<
- MyResourceSinkComponent>(out Ȫ)){ListReader<MyDefinitionId>Ȗ=Ȫ.AcceptedResources;if(Ȗ.IndexOf(ǁ.ȱ)<0)continue;Ѣ=Ȫ.CurrentInputByType(ǁ.ȱ);Ȳ+=Ȫ.
- MaxRequiredInputByType(ǁ.ȱ);}else continue;if(å.Components.TryGet<MyResourceSourceComponent>(out Ⱥ)&&(å as IMyBatteryBlock!=null)){Ѣ-=Ⱥ.
- CurrentOutputByType(ǁ.ȱ);if(Ѣ<=0)continue;}Ȭ+=Ѣ;}o.ƃ(ϝ);Н(Ȭ*1000000,Ȳ*1000000);break;}return true;}public class ѡ{List<KeyValuePair<double,
- IMyTerminalBlock>>Ѡ=new List<KeyValuePair<double,IMyTerminalBlock>>();public void A(double џ,IMyTerminalBlock å){Ѡ.Add(new KeyValuePair<
- double,IMyTerminalBlock>(џ,å));}public int º(){return Ѡ.Count;}public IMyTerminalBlock ª(int z){return Ѡ[z].Value;}public void
- w(){Ѡ.Clear();}public void Ã(){Ѡ.Sort((Ђ,ѝ)=>(Ђ.Key.CompareTo(ѝ.Key)));}}}class ќ:ŵ{β Ķ;public ќ(){Ɏ=1;ɒ="CmdProp";}
- public override void Ʌ(){Ķ=new β(Ɠ,o.ő);}int Y=0;int Л=0;bool ћ=false;string њ=null;string љ=null;string ў=null;string ѣ=null;
- public override bool Ɨ(bool ë){if(!ë){ћ=ƚ.ʸ.StartsWith("props");њ=љ=ў=ѣ=null;Л=0;Y=0;}if(ƚ.ˋ.Count<1){o.Ǎ(ƚ.ʸ+": "+
- "Missing property name.");return true;}if(Y==0){if(!ë)Ķ.Ŧ();if(!Ķ.μ(ƚ.ʣ,ë))return false;Ѯ();Y++;ë=false;}if(Y==1){int Ľ=Ķ.ϲ();if(Ľ==0){o.Ǎ(ƚ.ʸ+
- ": "+"No blocks found.");return true;}for(;Л<Ľ;Л++){if(!Ɠ.Ȝ(50))return false;IMyTerminalBlock å=Ķ.ί[Л];if(å.GetProperty(њ)!=
- null){if(љ==null){string ϝ=o.ǜ(å.CustomName,o.ɠ*0.7f);o.ƃ(ϝ);}else o.ƃ(љ);o.ƴ(ѭ(å,њ,ў,ѣ));if(!ћ)return true;}}}return true;}
- void Ѯ(){њ=ƚ.ˋ[0].ij;if(ƚ.ˋ.Count>1){if(!ћ)љ=ƚ.ˋ[1].ij;else ў=ƚ.ˋ[1].ij;if(ƚ.ˋ.Count>2){if(!ћ)ў=ƚ.ˋ[2].ij;else ѣ=ƚ.ˋ[2].ij;if(ƚ.ˋ
- .Count>3&&!ћ)ѣ=ƚ.ˋ[3].ij;}}}string ѭ(IMyTerminalBlock å,string Ѭ,string ѫ=null,string Ѫ=null){return(å.GetValue<bool>(Ѭ)?(
- ѫ!=null?ѫ:Ď.ǡ("W9")):(Ѫ!=null?Ѫ:Ď.ǡ("W1")));}}class ѩ:ŵ{public ѩ(){Ɏ=5;ɒ="CmdShipCtrl";}β Ķ;public override void Ʌ(){Ķ=
- new β(Ɠ,o.ő);}public override bool Ɨ(bool ë){if(!ë)Ķ.Ŧ();if(!Ķ.ϼ("shipctrl",ƚ.ʣ,ë))return false;if(Ķ.ϲ()<=0){if(ƚ.ʣ!=""&&ƚ.
- ʣ!="*")o.Ǎ(ƚ.ʸ+": "+Ď.ǡ("SC1")+" ("+ƚ.ʣ+")");else o.Ǎ(ƚ.ʸ+": "+Ď.ǡ("SC1"));return true;}if(ƚ.ʸ.StartsWith("damp")){bool Ѝ
- =(Ķ.ί[0]as IMyShipController).DampenersOverride;o.ƃ(Ď.ǡ("SCD"));o.ƴ(Ѝ?"ON":"OFF");}else{bool Ѝ=(Ķ.ί[0]as
- IMyShipController).IsUnderControl;o.ƃ(Ď.ǡ("SCO"));o.ƴ(Ѝ?"YES":"NO");}return true;}}class Ѩ:ŵ{public Ѩ(){Ɏ=1;ɒ="CmdShipMass";}public
- override bool Ɨ(bool ë){bool ѧ=ƚ.ʸ.EndsWith("base");double ʓ=0;if(ƚ.ʣ!="")double.TryParse(ƚ.ʣ.Trim(),out ʓ);int Ѧ=ƚ.ˋ.Count;if(Ѧ
- >0){string ѥ=ƚ.ˋ[0].ij.Trim();char э=' ';if(ѥ.Length>0)э=Char.ToLower(ѥ[0]);int Ѥ="kmgtpezy".IndexOf(э);if(Ѥ>=0)ʓ*=Math.
- Pow(1000.0,Ѥ);}double ɺ=(ѧ?o.ǀ.ɸ:o.ǀ.ɹ);if(!ѧ)o.ƃ(Ď.ǡ("SM1")+" ");else o.ƃ(Ď.ǡ("SM2")+" ");o.ƴ(o.ȃ(ɺ,true,'k')+" ");if(ʓ>0)
- o.Ư(ɺ/ʓ*100);return true;}}class я:ŵ{public я(){Ɏ=0.5;ɒ="CmdSpeed";}public override bool Ɨ(bool ë){double ʓ=0;double ю=1;
- string э="m/s";if(ƚ.ʸ.Contains("kmh")){ю=3.6;э="km/h";}else if(ƚ.ʸ.Contains("mph")){ю=2.23694;э="mph";}if(ƚ.ʣ!="")double.
- TryParse(ƚ.ʣ.Trim(),out ʓ);o.ƃ(Ď.ǡ("S1")+" ");o.ƴ((o.ǀ.ʃ*ю).ToString("F1")+" "+э+" ");if(ʓ>0)o.Ư(o.ǀ.ʃ/ʓ*100);return true;}}
- class ь:ŵ{public ь(){Ɏ=1;ɒ="CmdStopTask";}public override bool Ɨ(bool ë){double ы=0;if(ƚ.ʸ.Contains("best"))ы=o.ǀ.ʃ/o.ǀ.ɾ;
- else ы=o.ǀ.ʃ/o.ǀ.ɻ;double ъ=o.ǀ.ʃ/2*ы;if(ƚ.ʸ.Contains("time")){o.ƃ(Ď.ǡ("ST"));if(double.IsNaN(ы)){o.ƴ("N/A");return true;}
- string ĸ="";try{TimeSpan ˠ=TimeSpan.FromSeconds(ы);if((int)ˠ.TotalDays>0)ĸ=" > 24h";else{if(ˠ.Hours>0)ĸ=ˠ.Hours+"h ";if(ˠ.
- Minutes>0||ĸ!="")ĸ+=ˠ.Minutes+"m ";ĸ+=ˠ.Seconds+"s";}}catch{ĸ="N/A";}o.ƴ(ĸ);return true;}o.ƃ(Ď.ǡ("SD"));if(!double.IsNaN(ъ)&&!
- double.IsInfinity(ъ))o.ƴ(o.ȅ(ъ)+"m ");else o.ƴ("N/A");return true;}}class щ:ŵ{ȳ ǁ;β Ķ;public щ(){Ɏ=2;ɒ="CmdTanks";}public
- override void Ʌ(){ǁ=o.ǁ;Ķ=new β(Ɠ,o.ő);}int Y=0;char П='n';string ш;double ч=0;double ц=0;double Ʈ;bool ʖ=false;public override
- bool Ɨ(bool ë){List<ˀ>ˋ=ƚ.ˋ;if(ˋ.Count==0){o.Ǎ(Ď.ǡ("T4"));return true;}if(!ë){П=(ƚ.ʸ.EndsWith("x")?'s':(ƚ.ʸ.EndsWith("p")?
- 'p':(ƚ.ʸ.EndsWith("v")?'v':'n')));ʖ=ƚ.ʸ.EndsWith("bar");Y=0;if(ш==null){ш=ˋ[0].ij.Trim();ш=char.ToUpper(ш[0])+ш.Substring(1)
- .ToLower();}Ķ.Ŧ();ч=0;ц=0;}if(Y==0){if(!Ķ.ϼ("oxytank",ƚ.ʣ,ë))return false;ë=false;Y++;}if(Y==1){if(!Ķ.ϼ("hydrogenengine",
- ƚ.ʣ,ë))return false;ë=false;Y++;}if(Y==2){if(!ǁ.ȸ(Ķ.ί,ш,ref ч,ref ц,ë))return false;ë=false;Y++;}if(ц==0){o.Ǎ(String.
- Format(Ď.ǡ("T5"),ш));return true;}Ʈ=ч/ц*100;if(ʖ){o.Ư(Ʈ);return true;}o.ƃ(ш);switch(П){case's':o.ƴ(' '+o.Ǽ(Ʈ)+"%");break;case
- 'v':o.ƴ(o.ȅ(ч)+"L / "+o.ȅ(ц)+"L");break;case'p':o.ƴ(' '+o.Ǽ(Ʈ)+"%");o.Ư(Ʈ);break;default:o.ƴ(o.ȅ(ч)+"L / "+o.ȅ(ц)+"L");o.Ƶ(
- Ʈ,1.0f,o.ə);o.ƴ(' '+Ʈ.ToString("0.0")+"%");break;}return true;}}class ї{ɖ o=null;public string J="Debug";public float і=
- 1.0f;public List<ʌ>lj=new List<ʌ>();public int Ŗ=0;public float ѕ=0;public ї(ɖ Û){o=Û;lj.Add(new ʌ());}public void є(string ĸ)
- {lj[Ŗ].ʆ(ĸ);}public void є(ʌ ƪ){lj[Ŗ].ʆ(ƪ);}public void ѓ(){lj.Add(new ʌ());Ŗ++;ѕ=0;}public void ѓ(string ǎ){lj[Ŗ].ʆ(ǎ);ѓ();}
- public void ђ(List<ʌ>ё){if(lj[Ŗ].ʊ==0)lj.RemoveAt(Ŗ);else Ŗ++;lj.AddList(ё);Ŗ+=ё.Count-1;ѓ();}public List<ʌ>ţ(){if(lj[Ŗ].ʊ==0)
- return lj.GetRange(0,Ŗ);else return lj;}public void ѐ(string Nj,string P=""){string[]lj=Nj.Split('\n');for(int F=0;F<lj.Length;F++)ѓ
- (P+lj[F]);}public void Ƭ(){lj.Clear();ѓ();Ŗ=0;}public int ť(){return Ŗ+(lj[Ŗ].ʊ>0?1:0);}public string Ų(){return String.Join
- ("\n",lj);}public void ţ(List<ʌ>Ţ,int š,int Š){int ş=š+Š;int Ş=ť();if(ş>Ş)ş=Ş;for(int F=š;F<ş;F++)Ţ.Add(lj[F]);}}class ŝ{ɖ
- o=null;public float Ŝ=1.0f;public int ś=17;public int Ś=0;int ř=1;int Ř=1;public List<ї>ŗ=new List<ї>();public int Ŗ=0;
- public ŝ(ɖ Û){o=Û;}public void ŕ(int Ľ){Ř=Ľ;}public void Ŕ(){ś=(int)Math.Floor(ɖ.ɪ*Ŝ*Ř/ɖ.ɨ);}public void Ť(ї ĸ){ŗ.Add(ĸ);}
- public void Ŧ(){ŗ.Clear();}public int ť(){int Ľ=0;foreach(var ĸ in ŗ){Ľ+=ĸ.ť();}return Ľ;}ʌ ų=new ʌ(256);public ʌ Ų(){ų.Ŧ();
- int Ľ=ŗ.Count;for(int F=0;F<Ľ-1;F++){ų.ʆ(ŗ[F].Ų());ų.ʆ("\n");}if(Ľ>0)ų.ʆ(ŗ[Ľ-1].Ų());return ų;}List<ʌ>ű=new List<ʌ>(20);
- public ʌ Ű(int ů=0){ų.Ŧ();ű.Clear();if(Ř<=0)return ų;int Ů=ŗ.Count;int Ŵ=0;int ŭ=(ś/Ř);int ū=(ů*ŭ);int Ū=Ś+ū;int ũ=Ū+ŭ;bool Ũ=
- false;for(int F=0;F<Ů;F++){ї ĸ=ŗ[F];int Ş=ĸ.ť();int ŧ=Ŵ;Ŵ+=Ş;if(!Ũ&&Ŵ>Ū){int š=Ū-ŧ;if(Ŵ>=ũ){ĸ.ţ(ű,š,ũ-ŧ-š);break;}Ũ=true;ĸ.ţ(
- ű,š,Ş);continue;}if(Ũ){if(Ŵ>=ũ){ĸ.ţ(ű,0,ũ-ŧ);break;}ĸ.ţ(ű,0,Ş);}}int Ľ=ű.Count;for(int F=0;F<Ľ-1;F++){ų.ʆ(ű[F]);ų.ʆ("\n")
- ;}if(Ľ>0)ų.ʆ(ű[Ľ-1]);return ų;}public bool Ŭ(int Ľ=-1){if(Ľ<=0)Ľ=o.ɦ;if(Ś-Ľ<=0){Ś=0;return true;}Ś-=Ľ;return false;}
- public bool ň(int Ľ=-1){if(Ľ<=0)Ľ=o.ɦ;int ļ=ť();if(Ś+Ľ+ś>=ļ){Ś=Math.Max(ļ-ś,0);return true;}Ś+=Ľ;return false;}public int Ļ=0;
- public void ĺ(){if(Ļ>0){Ļ--;return;}if(ť()<=ś){Ś=0;ř=1;return;}if(ř>0){if(ň()){ř=-1;Ļ=2;}}else{if(Ŭ()){ř=1;Ļ=2;}}}}class Ĺ:ŵ{
- public Ĺ(){Ɏ=1;ɒ="CmdTextLCD";}public override bool Ɨ(bool ë){string ĸ="";if(ƚ.ʣ!=""&&ƚ.ʣ!="*"){IMyTextPanel ý=o.ƿ.
- GetBlockWithName(ƚ.ʣ)as IMyTextPanel;if(ý==null){o.Ǎ("TextLCD: "+Ď.ǡ("T1")+ƚ.ʣ);return true;}ĸ=ý.GetText();}else{o.Ǎ("TextLCD:"+Ď.ǡ("T2"
- ));return true;}if(ĸ.Length==0)return true;o.nj(ĸ);return true;}}class ķ:ŵ{public ķ(){Ɏ=5;ɒ="CmdWorking";}β Ķ;public
- override void Ʌ(){Ķ=new β(Ɠ,o.ő);}int Y=0;int ĵ=0;bool Ĵ;public override bool Ɨ(bool ë){if(!ë){Y=0;Ĵ=(ƚ.ʸ=="workingx");ĵ=0;}if(ƚ
- .ˋ.Count==0){if(Y==0){if(!ë)Ķ.Ŧ();if(!Ķ.μ(ƚ.ʣ,ë))return false;Y++;ë=false;}if(!Ń(Ķ,Ĵ,"",ë))return false;return true;}for(
- ;ĵ<ƚ.ˋ.Count;ĵ++){ˀ ij=ƚ.ˋ[ĵ];if(!ë)ij.ʻ();if(!Į(ij,ë))return false;ë=false;}return true;}int IJ=0;int ı=0;string[]İ;string į
- ;string ľ;bool Į(ˀ ij,bool ë){if(!ë){IJ=0;ı=0;}for(;ı<ij.ʽ.Count;ı++){if(IJ==0){if(!ë){if(string.IsNullOrEmpty(ij.ʽ[ı]))
- continue;Ķ.Ŧ();İ=ij.ʽ[ı].Split(':');į=İ[0];ľ=(İ.Length>1?İ[1]:"");}if(!string.IsNullOrEmpty(į)){if(!Ķ.ϼ(į,ƚ.ʣ,ë))return false;}
- else{if(!Ķ.μ(ƚ.ʣ,ë))return false;}IJ++;ë=false;}if(!Ń(Ķ,Ĵ,ľ,ë))return false;IJ=0;ë=false;}return true;}string Œ(
- IMyTerminalBlock å){ϵ ő=o.ő;if(!å.IsWorking)return Ď.ǡ("W1");IMyProductionBlock Ő=å as IMyProductionBlock;if(Ő!=null)if(Ő.IsProducing)
- return Ď.ǡ("W2");else return Ď.ǡ("W3");IMyAirVent ŏ=å as IMyAirVent;if(ŏ!=null){if(ŏ.CanPressurize)return(ŏ.GetOxygenLevel()*
- 100).ToString("F1")+"%";else return Ď.ǡ("W4");}IMyGasTank Ŏ=å as IMyGasTank;if(Ŏ!=null)return(Ŏ.FilledRatio*100).ToString(
- "F1")+"%";IMyBatteryBlock ō=å as IMyBatteryBlock;if(ō!=null)return ő.Ϫ(ō);IMyJumpDrive Ō=å as IMyJumpDrive;if(Ō!=null)return
- ő.ϙ(Ō).ToString("0.0")+"%";IMyLandingGear ŋ=å as IMyLandingGear;if(ŋ!=null){switch((int)ŋ.LockMode){case 0:return Ď.ǡ(
- "W8");case 1:return Ď.ǡ("W10");case 2:return Ď.ǡ("W7");}}IMyDoor Ŋ=å as IMyDoor;if(Ŋ!=null){if(Ŋ.Status==DoorStatus.Open)
- return Ď.ǡ("W5");return Ď.ǡ("W6");}IMyShipConnector œ=å as IMyShipConnector;if(œ!=null){if(œ.Status==MyShipConnectorStatus.
- Unconnected)return Ď.ǡ("W8");if(œ.Status==MyShipConnectorStatus.Connected)return Ď.ǡ("W7");else return Ď.ǡ("W10");}IMyLaserAntenna
- ʼn=å as IMyLaserAntenna;if(ʼn!=null)return ő.ϛ(ʼn);IMyRadioAntenna Ň=å as IMyRadioAntenna;if(Ň!=null)return o.ȅ(Ň.Radius)+
- "m";IMyBeacon ņ=å as IMyBeacon;if(ņ!=null)return o.ȅ(ņ.Radius)+"m";IMyThrust Ņ=å as IMyThrust;if(Ņ!=null&&Ņ.ThrustOverride>
- 0)return o.ȅ(Ņ.ThrustOverride)+"N";return Ď.ǡ("W9");}int ń=0;bool Ń(β Ā,bool ł,string Ł,bool ë){if(!ë)ń=0;for(;ń<Ā.ϲ();ń
- ++){if(!Ɠ.Ȝ(20))return false;IMyTerminalBlock å=Ā.ί[ń];string Ŀ=(ł?(å.IsWorking?Ď.ǡ("W9"):Ď.ǡ("W1")):Œ(å));if(!string.
- IsNullOrEmpty(Ł)&&String.Compare(Ŀ,Ł,true)!=0)continue;if(ł)Ŀ=Œ(å);string ŀ=å.CustomName;ŀ=o.ǜ(ŀ,o.ɠ*0.7f);o.ƃ(ŀ);o.ƴ(Ŀ);}return true
- ;}}class ŵ:ɓ{public ї ĸ=null;protected ʤ ƚ;protected ɖ o;protected Ę k;protected ǒ Ď;public ŵ(){Ɏ=3600;ɒ="CommandTask";}
- public void ƙ(Ę j,ʤ Ƙ){k=j;o=k.o;ƚ=Ƙ;Ď=o.Ď;}public virtual bool Ɨ(bool ë){o.Ǎ(Ď.ǡ("UC")+": '"+ƚ.ʺ+"'");return true;}public
- override bool Ʉ(bool ë){ĸ=o.Lj(ĸ,k.E);if(!ë)o.Ƭ();return Ɨ(ë);}}class Ɩ{Dictionary<string,string>Ɣ=new Dictionary<string,string>(
- StringComparer.InvariantCultureIgnoreCase){{"ingot","ingot"},{"ore","ore"},{"component","component"},{"tool","physicalgunobject"},{
- "ammo","ammomagazine"},{"oxygen","oxygencontainerobject"},{"gas","gascontainerobject"}};ȓ Ɠ;ɖ o;ƈ ƒ;ƈ Ƒ;ƈ Ɛ;Ƈ Ə;bool Ǝ;public
- ƈ ƍ;public Ɩ(ȓ ƕ,ɖ Û,int K=20){ƒ=new ƈ();Ƒ=new ƈ();Ɛ=new ƈ();Ǝ=false;ƍ=new ƈ();Ɠ=ƕ;o=Û;Ə=o.Ə;}public void Ŧ(){Ɛ.w();Ƒ.w()
- ;ƒ.w();Ǝ=false;ƍ.w();}public void ơ(string Ơ,bool Ƃ=false,int ŷ=1,int Ŷ=-1){if(string.IsNullOrEmpty(Ơ)){Ǝ=true;return;}
- string[]Ɵ=Ơ.Split(' ');string Ï="";Ÿ ż=new Ÿ(Ƃ,ŷ,Ŷ);if(Ɵ.Length==2){if(!Ɣ.TryGetValue(Ɵ[1],out Ï))Ï=Ɵ[1];}string Ð=Ɵ[0];if(Ɣ.
- TryGetValue(Ð,out ż.Ï)){Ƒ.A(ż.Ï,ż);return;}o.DZ(ref Ð,ref Ï);if(string.IsNullOrEmpty(Ï)){ż.Ð=Ð;ƒ.A(ż.Ð,ż);return;}ż.Ð=Ð;ż.Ï=Ï;Ɛ.A(Ð+
- ' '+Ï,ż);}public Ÿ ƞ(string Ò,string Ð,string Ï){Ÿ ż;ż=Ɛ.µ(Ò);if(ż!=null)return ż;ż=ƒ.µ(Ð);if(ż!=null)return ż;ż=Ƒ.µ(Ï);if(
- ż!=null)return ż;return null;}public bool Ɲ(string Ò,string Ð,string Ï){Ÿ ż;bool Ɯ=false;ż=Ƒ.µ(Ï);if(ż!=null){if(ż.Ƃ)
- return true;Ɯ=true;}ż=ƒ.µ(Ð);if(ż!=null){if(ż.Ƃ)return true;Ɯ=true;}ż=Ɛ.µ(Ò);if(ż!=null){if(ż.Ƃ)return true;Ɯ=true;}return!(Ǝ
- ||Ɯ);}public Ÿ ƛ(string Ò,string Ð,string Ï){Ÿ Ź=new Ÿ();Ÿ ż=ƞ(Ò,Ð,Ï);if(ż!=null){Ź.ŷ=ż.ŷ;Ź.Ŷ=ż.Ŷ;}Ź.Ð=Ð;Ź.Ï=Ï;ƍ.A(Ò,Ź);
- return Ź;}public Ÿ Ɓ(string Ò,string Ð,string Ï){Ÿ Ź=ƍ.µ(Ò);if(Ź==null)Ź=ƛ(Ò,Ð,Ï);return Ź;}int ƀ=0;List<Ÿ>ſ;public List<Ÿ>ž(
- string Ï,bool ë,Func<Ÿ,bool>Ž=null){if(!ë){ſ=new List<Ÿ>();ƀ=0;}for(;ƀ<ƍ.º();ƀ++){if(!Ɠ.Ȝ(5))return null;Ÿ ż=ƍ.ª(ƀ);if(Ɲ(ż.Ð+
- ' '+ż.Ï,ż.Ð,ż.Ï))continue;if((string.Compare(ż.Ï,Ï,true)==0)&&(Ž==null||Ž(ż)))ſ.Add(ż);}return ſ;}int Ż=0;public bool ź(
- bool ë){if(!ë){Ż=0;}for(;Ż<Ə.V.Count;Ż++){if(!Ɠ.Ȝ(10))return false;Î À=Ə.Ɔ[Ə.V[Ż]];if(!À.È)continue;string Ò=À.Í+' '+À.Ì;if(
- Ɲ(Ò,À.Í,À.Ì))continue;Ÿ Ź=Ɓ(Ò,À.Í,À.Ì);if(Ź.Ŷ==-1)Ź.Ŷ=À.Ë;}return true;}}class Ÿ{public int ŷ;public int Ŷ;public string
- Ð="";public string Ï="";public bool Ƃ;public double ƌ;public Ÿ(bool Ƌ=false,int Ɗ=1,int Ɖ=-1){ŷ=Ɗ;Ƃ=Ƌ;Ŷ=Ɖ;}}class ƈ{
- Dictionary<string,Ÿ>ú=new Dictionary<string,Ÿ>(StringComparer.InvariantCultureIgnoreCase);List<string>V=new List<string>();public
- void A(string X,Ÿ À){if(!ú.ContainsKey(X)){V.Add(X);ú.Add(X,À);}}public int º(){return ú.Count;}public Ÿ µ(string X){if(ú.
- ContainsKey(X))return ú[X];return null;}public Ÿ ª(int z){return ú[V[z]];}public void w(){V.Clear();ú.Clear();}public void Ã(){V.
- Sort();}}class Ƈ{public Dictionary<string,Î>Ɔ=new Dictionary<string,Î>(StringComparer.InvariantCultureIgnoreCase);Dictionary
- <string,Î>ƅ=new Dictionary<string,Î>(StringComparer.InvariantCultureIgnoreCase);public List<string>V=new List<string>();
- public Dictionary<string,Î>Ƅ=new Dictionary<string,Î>(StringComparer.InvariantCultureIgnoreCase);public void ƃ(string Ð,string
- Ï,int ć,string Ô,string Ó,bool È){if(Ï=="Ammo")Ï="AmmoMagazine";else if(Ï=="Tool")Ï="PhysicalGunObject";string Ò=Ð+' '+Ï;
- Î À=new Î(Ð,Ï,ć,Ô,Ó,È);Ɔ.Add(Ò,À);if(!ƅ.ContainsKey(Ð))ƅ.Add(Ð,À);if(Ó!="")Ƅ.Add(Ó,À);V.Add(Ò);}public Î Ñ(string Ð="",
- string Ï=""){if(Ɔ.ContainsKey(Ð+" "+Ï))return Ɔ[Ð+" "+Ï];if(string.IsNullOrEmpty(Ï)){Î À=null;ƅ.TryGetValue(Ð,out À);return À;
- }if(string.IsNullOrEmpty(Ð))for(int F=0;F<Ɔ.Count;F++){Î À=Ɔ[V[F]];if(string.Compare(Ï,À.Ì,true)==0)return À;}return null
- ;}}class Î{public string Í;public string Ì;public int Ë;public string Ê;public string É;public bool È;public Î(string Ç,
- string Æ,int Õ=0,string Å="",string Ö="",bool ê=true){Í=Ç;Ì=Æ;Ë=Õ;Ê=Å;É=Ö;È=ê;}}class è{ɖ o=null;public D ç=new D();public ŝ æ
- ;public IMyTerminalBlock å;public IMyTextSurface ä;public int ã=0;public int â=0;public string á="";public string à="";
- public bool é=true;public IMyTextSurface ß=>(Ü?ä:å as IMyTextSurface);public int Ý=>(Ü?(o.LJ(å)?0:1):ç.º());public bool Ü=false
- ;public è(ɖ Û,string Ú){o=Û;à=Ú;}public è(ɖ Û,string Ú,IMyTerminalBlock Ù,IMyTextSurface G,int Ø){o=Û;à=Ú;å=Ù;ä=G;ã=Ø;Ü=
- true;}public bool Þ(){return æ.ť()>æ.ś||æ.Ś!=0;}float Ä=1.0f;bool r=false;public float U(){if(r)return Ä;r=true;if(å.
- BlockDefinition.SubtypeId.Contains("Corner_LCD")){Ä=0.15f;if(å.BlockDefinition.SubtypeId.Contains("Flat"))Ä=0.1765f;if(å.
- BlockDefinition.SubtypeId.Contains("Small"))Ä*=1.8f;}return Ä;}bool S=false;public void R(){if(S)return;if(!Ü){ç.Ã();å=ç.ª(0);}int Q=å.
- CustomName.IndexOf("!MARGIN:");if(Q<0||Q+8>=å.CustomName.Length){â=1;á=" ";}else{string P=å.CustomName.Substring(Q+8);int O=P.
- IndexOf(" ");if(O>=0)P=P.Substring(0,O);if(!int.TryParse(P,out â))â=1;á=new String(' ',â);}if(å.CustomName.Contains("!NOSCROLL"
- ))é=false;else é=true;S=true;}public void N(ŝ L=null){if(æ==null||å==null)return;if(L==null)L=æ;if(!Ü){IMyTextSurface G=å
- as IMyTextSurface;if(G!=null){float K=G.FontSize;string J=G.Font;for(int F=0;F<ç.º();F++){IMyTextSurface E=ç.ª(F)as
- IMyTextSurface;if(E==null)continue;E.Alignment=VRage.Game.GUI.TextPanel.TextAlignment.LEFT;E.FontSize=K;E.Font=J;string I=L.Ű(F).ɕ();E
- .ContentType=VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE;E.WriteText(I);}}}else{ä.Alignment=VRage.Game.GUI.
- TextPanel.TextAlignment.LEFT;ä.ContentType=VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE;ä.WriteText(L.Ű().ɕ());}S=false;}
- public void H(){if(å==null)return;if(Ü){ä.WriteText("");return;}IMyTextSurface G=å as IMyTextSurface;if(G==null)return;for(int
- F=0;F<ç.º();F++){IMyTextSurface E=ç.ª(F)as IMyTextSurface;if(E==null)continue;E.WriteText("");}}}class D{Dictionary<
- string,IMyTerminalBlock>C=new Dictionary<string,IMyTerminalBlock>();Dictionary<IMyTerminalBlock,string>B=new Dictionary<
- IMyTerminalBlock,string>();List<string>V=new List<string>();public void A(string X,IMyTerminalBlock À){if(!V.Contains(X)){V.Add(X);C.Add
- (X,À);B.Add(À,X);}}public void Â(string X){if(V.Contains(X)){V.Remove(X);B.Remove(C[X]);C.Remove(X);}}public void Á(
- IMyTerminalBlock À){if(B.ContainsKey(À)){V.Remove(B[À]);C.Remove(B[À]);B.Remove(À);}}public int º(){return C.Count;}public
- IMyTerminalBlock µ(string X){if(V.Contains(X))return C[X];return null;}public IMyTerminalBlock ª(int z){return C[V[z]];}public void w(){
- V.Clear();C.Clear();B.Clear();}public void Ã(){V.Sort();}}class v:ɓ{public ɖ o;public è n;Ę k;public v(Ę j){k=j;o=k.o;n=k
- .E;Ɏ=0.5;ɒ="PanelDisplay";}double f=0;public void e(){f=0;}int b=0;int a=0;bool Z=true;double W=double.MaxValue;int Y=0;
- public override bool Ʉ(bool ë){ŵ Ě;if(!ë&&(k.Ē==false||k.Ĕ==null||k.Ĕ.Count<=0))return true;if(k.ē.Ġ>3)return Ɉ(0);if(!ë){a=0;
- Z=false;W=double.MaxValue;Y=0;}if(Y==0){while(a<k.Ĕ.Count){if(!Ɠ.Ȝ(5))return false;if(k.ĕ.TryGetValue(k.Ĕ[a],out Ě)){if(!
- Ě.ɋ)return Ɉ(Ě.ɑ-Ɠ.ȏ+0.001);if(Ě.ɐ>f)Z=true;if(Ě.ɑ<W)W=Ě.ɑ;}a++;}Y++;ë=false;}double ę=W-Ɠ.ȏ+0.001;if(!Z&&!n.Þ())return Ɉ
- (ę);o.Ǐ(n.æ,n);if(Z){if(!ë){f=Ɠ.ȏ;n.æ.Ŧ();b=0;}while(b<k.Ĕ.Count){if(!Ɠ.Ȝ(7))return false;if(!k.ĕ.TryGetValue(k.Ĕ[b],out
- Ě)){n.æ.ŗ.Add(o.Lj(null,n));o.Ƭ();o.Ǎ("ERR: No cmd task ("+k.Ĕ[b]+")");b++;continue;}n.æ.Ť(Ě.ĸ);b++;}}o.Ǒ(n);k.ē.Ġ++;if(Ɏ<
- ę&&!n.Þ())return Ɉ(ę);return true;}}class Ę:ɓ{public ɖ o;public è E;public v ė=null;string Ė="N/A";public Dictionary<
- string,ŵ>ĕ=new Dictionary<string,ŵ>();public List<string>Ĕ=null;public Ģ ē;public bool Ē{get{return ē.Ć;}}public Ę(Ģ đ,è ď){Ɏ=
- 5;E=ď;ē=đ;o=đ.o;ɒ="PanelProcess";}ǒ Ď;public override void Ʌ(){Ď=o.Ď;}ʤ č=null;ŵ Č(string ċ,bool ë){if(!ë)č=new ʤ(Ɠ);if(!
- č.ʻ(ċ,ë))return null;ŵ Ċ=č.ˌ();Ċ.ƙ(this,č);Ɠ.Ȉ(Ċ,0);return Ċ;}string ĉ="";void Ĉ(){try{ĉ=E.å.ǧ(E.ã,o.ɧ);}catch{ĉ="";
- return;}ĉ=ĉ?.Replace("\\\n","");}int b=0;int Đ=0;List<string>ě=null;HashSet<string>Ĥ=new HashSet<string>();int ĭ=0;bool ī(bool
- ë){if(!ë){char[]Ī={';','\n'};string ĩ=ĉ.Replace("\\;","\f");if(ĩ.StartsWith("@")){int Ĩ=ĩ.IndexOf("\n");if(Ĩ<0){ĩ="";}
- else{ĩ=ĩ.Substring(Ĩ+1);}}ě=new List<string>(ĩ.Split(Ī,StringSplitOptions.RemoveEmptyEntries));Ĥ.Clear();b=0;Đ=0;ĭ=0;}while(
- b<ě.Count){if(!Ɠ.Ȝ(500))return false;if(ě[b].StartsWith("//")){ě.RemoveAt(b);continue;}ě[b]=ě[b].Replace('\f',';');if(!ĕ.
- ContainsKey(ě[b])){if(ĭ!=1)ë=false;ĭ=1;ŵ Ě=Č(ě[b],ë);if(Ě==null)return false;ë=false;ĕ.Add(ě[b],Ě);ĭ=0;}if(!Ĥ.Contains(ě[b]))Ĥ.Add(
- ě[b]);b++;}if(Ĕ!=null){ŵ Ċ;while(Đ<Ĕ.Count){if(!Ɠ.Ȝ(7))return false;if(!Ĥ.Contains(Ĕ[Đ]))if(ĕ.TryGetValue(Ĕ[Đ],out Ċ)){Ċ.
- Ɇ();ĕ.Remove(Ĕ[Đ]);}Đ++;}}Ĕ=ě;return true;}public override void Ƀ(){if(Ĕ!=null){ŵ Ċ;for(int ħ=0;ħ<Ĕ.Count;ħ++){if(ĕ.
- TryGetValue(Ĕ[ħ],out Ċ))Ċ.Ɇ();}Ĕ=null;}if(ė!=null){ė.Ɇ();ė=null;}else{}}ŝ Ħ=null;string Ĭ="";bool ĥ=false;public override bool Ʉ(
- bool ë){if(E.Ý<=0){Ɇ();return true;}if(!ë){E.æ=o.Ǐ(E.æ,E);Ħ=o.Ǐ(Ħ,E);Ĉ();if(ĉ==null){if(E.Ü){ē.ò(E.ä,E.å as IMyTextPanel);}
- else{Ɇ();}return true;}if(E.å.CustomName!=Ĭ){ĥ=true;}else{ĥ=false;}Ĭ=E.å.CustomName;}if(ĉ!=Ė){if(!ī(ë))return false;if(ĉ==""
- ){Ė="";if(ē.Ć){if(Ħ.ŗ.Count<=0)Ħ.ŗ.Add(o.Lj(null,E));else o.Lj(Ħ.ŗ[0],E);o.Ƭ();o.Ǎ(Ď.ǡ("H1"));bool ģ=E.é;E.é=false;o.Ǒ(E,Ħ)
- ;E.é=ģ;return true;}return this.Ɉ(2);}ĥ=true;}Ė=ĉ;if(ė!=null&&ĥ){Ɠ.Ȩ(ė);ė.e();Ɠ.Ȉ(ė,0);}else if(ė==null){ė=new v(this);Ɠ.
- Ȉ(ė,0);}return true;}}class Ģ:ɓ{const string ġ="T:!LCD!";public int Ġ=0;public ɖ o;public û ç=new û();β ğ;β Ğ;Dictionary<
- è,Ę>ĝ=new Dictionary<è,Ę>();public Dictionary<IMyTextSurface,è>Ĝ=new Dictionary<IMyTextSurface,è>();public bool Ć=false;Ϙ
- ù=null;public Ģ(ɖ Û){Ɏ=5;o=Û;ɒ="ProcessPanels";}public override void Ʌ(){ğ=new β(Ɠ,o.ő);Ğ=new β(Ɠ,o.ő);ù=new Ϙ(o,this);}
- int ö=0;bool õ(bool ë){if(!ë)ö=0;if(ö==0){if(!ğ.μ(o.ɧ,ë))return false;ö++;ë=false;}if(ö==1){if(o.ɧ=="T:[LCD]"&&ġ!="")if(!ğ.
- μ(ġ,ë))return false;ö++;ë=false;}return true;}string ô(IMyTerminalBlock å){int ó=å.CustomName.IndexOf("!LINK:");if(ó>=0&&
- å.CustomName.Length>ó+6){return å.CustomName.Substring(ó+6)+' '+å.Position.ToString();}return å.EntityId.ToString();}
- public void ò(IMyTextSurface G,IMyTextPanel E){è n;if(G==null)return;if(!Ĝ.TryGetValue(G,out n))return;if(E!=null){n.ç.Á(E);}Ĝ
- .Remove(G);if(n.Ý<=0||n.Ü){Ę ñ;if(ĝ.TryGetValue(n,out ñ)){ç.Á(n.à);ĝ.Remove(n);ñ.Ɇ();}}}void ð(IMyTerminalBlock å){
- IMyTextSurfaceProvider ï=å as IMyTextSurfaceProvider;IMyTextSurface G=å as IMyTextSurface;if(G!=null){ò(G,å as IMyTextPanel);return;}if(ï==
- null)return;for(int F=0;F<ï.SurfaceCount;F++){G=ï.GetSurface(F);ò(G,null);}}string Ú;string î;bool í;int ì=0;int ø=0;public
- override bool Ʉ(bool ë){if(!ë){ğ.Ŧ();ì=0;ø=0;}if(!õ(ë))return false;while(ì<ğ.ϲ()){if(!Ɠ.Ȝ(20))return false;IMyTerminalBlock å=(
- ğ.ί[ì]as IMyTerminalBlock);if(å==null||!å.IsWorking){ğ.ί.RemoveAt(ì);continue;}IMyTextSurfaceProvider ï=å as
- IMyTextSurfaceProvider;IMyTextSurface G=å as IMyTextSurface;IMyTextPanel E=å as IMyTextPanel;è n;Ú=ô(å);string[]Ą=Ú.Split(' ');î=Ą[0];í=Ą.
- Length>1;if(E!=null){if(Ĝ.ContainsKey(G)){n=Ĝ[G];if(n.à==Ú+"@0"||(í&&n.à==î)){ì++;continue;}ð(å);}if(!í){n=new è(o,Ú+"@0",å,G,
- 0);Ę ñ=new Ę(this,n);Ɠ.Ȉ(ñ,0);ĝ.Add(n,ñ);ç.A(n.à,n);Ĝ.Add(G,n);ì++;continue;}n=ç.µ(î);if(n==null){n=new è(o,î);ç.A(î,n);Ę
- ñ=new Ę(this,n);Ɠ.Ȉ(ñ,0);ĝ.Add(n,ñ);}n.ç.A(Ú,å);Ĝ.Add(G,n);}else{if(ï==null){ì++;continue;}for(int F=0;F<ï.SurfaceCount;F
- ++){G=ï.GetSurface(F);if(Ĝ.ContainsKey(G)){n=Ĝ[G];if(n.à==Ú+'@'+F.ToString()){continue;}ò(G,null);}if(å.ǧ(F,o.ɧ)==null)
- continue;n=new è(o,Ú+"@"+F.ToString(),å,G,F);Ę ñ=new Ę(this,n);Ɠ.Ȉ(ñ,0);ĝ.Add(n,ñ);ç.A(n.à,n);Ĝ.Add(G,n);}}ì++;}while(ø<Ğ.ϲ()){
- if(!Ɠ.Ȝ(300))return false;IMyTerminalBlock å=Ğ.ί[ø];if(å==null)continue;if(!ğ.ί.Contains(å)){ð(å);}ø++;}Ğ.Ŧ();Ğ.ϴ(ğ);if(!ù
- .Ɍ&&ù.ϫ())Ɠ.Ȉ(ù,0);return true;}public bool ă(string ą){if(string.Compare(ą,"clear",true)==0){ù.ϖ();if(!ù.Ɍ)Ɠ.Ȉ(ù,0);
- return true;}if(string.Compare(ą,"boot",true)==0){ù.ϗ=0;if(!ù.Ɍ)Ɠ.Ȉ(ù,0);return true;}if(ą.ǭ("scroll")){ζ Ă=new ζ(o,this,ą);Ɠ.
- Ȉ(Ă,0);return true;}if(string.Compare(ą,"props",true)==0){ϵ ā=o.ő;List<IMyTerminalBlock>Ā=new List<IMyTerminalBlock>();
- List<ITerminalAction>ÿ=new List<ITerminalAction>();List<ITerminalProperty>þ=new List<ITerminalProperty>();IMyTextPanel ý=Ɠ.ǂ
- .GridTerminalSystem.GetBlockWithName("DEBUG")as IMyTextPanel;if(ý==null){return true;}ý.WriteText("Properties: ");foreach
- (var À in ā.І){ý.WriteText(À.Key+" =============="+"\n",true);À.Value(Ā,null);if(Ā.Count<=0){ý.WriteText("No blocks\n",
- true);continue;}Ā[0].GetProperties(þ,(n)=>{return n.Id!="Name"&&n.Id!="OnOff"&&!n.Id.StartsWith("Show");});foreach(var ü in
- þ){ý.WriteText("P "+ü.Id+" "+ü.TypeName+"\n",true);}þ.Clear();Ā.Clear();}}return false;}}class û{Dictionary<string,è>ú=
- new Dictionary<string,è>();List<string>V=new List<string>();public void A(string X,è À){if(!ú.ContainsKey(X)){V.Add(X);ú.
- Add(X,À);}}public int º(){return ú.Count;}public è µ(string X){if(ú.ContainsKey(X))return ú[X];return null;}public è ª(int
- z){return ú[V[z]];}public void Á(string X){ú.Remove(X);V.Remove(X);}public void w(){V.Clear();ú.Clear();}public void Ã(){
- V.Sort();}}class ȳ{ȓ Ɠ;ɖ o;public MyDefinitionId ȱ=new MyDefinitionId(typeof(VRage.Game.ObjectBuilders.Definitions.
- MyObjectBuilder_GasProperties),"Electricity");public MyDefinitionId Ȱ=new MyDefinitionId(typeof(VRage.Game.ObjectBuilders.Definitions.
- MyObjectBuilder_GasProperties),"Oxygen");public MyDefinitionId ȯ=new MyDefinitionId(typeof(VRage.Game.ObjectBuilders.Definitions.
- MyObjectBuilder_GasProperties),"Hydrogen");public ȳ(ȓ ƕ,ɖ Û){Ɠ=ƕ;o=Û;}int Ȯ=0;public bool ȭ(List<IMyTerminalBlock>Ā,ref double Ȭ,ref double Ȳ,ref
- double ȴ,ref double Ȼ,ref double Ɂ,ref double ɀ,bool ë){if(!ë)Ȯ=0;MyResourceSinkComponent Ȫ;MyResourceSourceComponent Ⱥ;for(;Ȯ
- <Ā.Count;Ȯ++){if(!Ɠ.Ȝ(8))return false;if(Ā[Ȯ].Components.TryGet<MyResourceSinkComponent>(out Ȫ)){Ȭ+=Ȫ.CurrentInputByType(
- ȱ);Ȳ+=Ȫ.MaxRequiredInputByType(ȱ);}if(Ā[Ȯ].Components.TryGet<MyResourceSourceComponent>(out Ⱥ)){ȴ+=Ⱥ.CurrentOutputByType(
- ȱ);Ȼ+=Ⱥ.MaxOutputByType(ȱ);}IMyBatteryBlock ȿ=(Ā[Ȯ]as IMyBatteryBlock);Ɂ+=ȿ.CurrentStoredPower;ɀ+=ȿ.MaxStoredPower;}
- return true;}int Ⱦ=0;public bool Ƚ(List<IMyTerminalBlock>Ā,MyDefinitionId ȼ,ref double Ȭ,ref double Ȳ,ref double ȴ,ref double
- Ȼ,bool ë){if(!ë)Ⱦ=0;MyResourceSinkComponent Ȫ;MyResourceSourceComponent Ⱥ;for(;Ⱦ<Ā.Count;Ⱦ++){if(!Ɠ.Ȝ(6))return false;if(
- Ā[Ⱦ].Components.TryGet<MyResourceSinkComponent>(out Ȫ)){Ȭ+=Ȫ.CurrentInputByType(ȼ);Ȳ+=Ȫ.MaxRequiredInputByType(ȼ);}if(Ā[Ⱦ
- ].Components.TryGet<MyResourceSourceComponent>(out Ⱥ)){ȴ+=Ⱥ.CurrentOutputByType(ȼ);Ȼ+=Ⱥ.MaxOutputByType(ȼ);}}return true;
- }int ȹ=0;public bool ȸ(List<IMyTerminalBlock>Ā,string ȷ,ref double ȶ,ref double ȵ,bool ë){if(!ë){ȹ=0;ȵ=0;ȶ=0;}
- MyResourceSinkComponent Ȫ;for(;ȹ<Ā.Count;ȹ++){if(!Ɠ.Ȝ(30))return false;IMyGasTank Ŏ=Ā[ȹ]as IMyGasTank;if(Ŏ==null)continue;double ȡ=0;if(Ŏ.
- Components.TryGet<MyResourceSinkComponent>(out Ȫ)){ListReader<MyDefinitionId>Ȗ=Ȫ.AcceptedResources;int F=0;for(;F<Ȗ.Count;F++){if(
- string.Compare(Ȗ[F].SubtypeId.ToString(),ȷ,true)==0){ȡ=Ŏ.Capacity;ȵ+=ȡ;ȶ+=ȡ*Ŏ.FilledRatio;break;}}}}return true;}public string
- ȕ(TimeSpan Ȕ){string ĸ="";if(Ȕ.Ticks<=0)return"-";if((int)Ȕ.TotalDays>0)ĸ+=(long)Ȕ.TotalDays+" "+o.Ď.ǡ("C5")+" ";if(Ȕ.
- Hours>0||ĸ!="")ĸ+=Ȕ.Hours+"h ";if(Ȕ.Minutes>0||ĸ!="")ĸ+=Ȕ.Minutes+"m ";return ĸ+Ȕ.Seconds+"s";}}class ȓ{public const double Ȓ
- =0.05;public const int ȑ=1000;public const int Ȑ=10000;public double ȏ{get{return ȍ;}}int Ȏ=ȑ;double ȍ=0;List<ɓ>Ȍ=new
- List<ɓ>(100);public MyGridProgram ǂ;public bool ȋ=false;int Ȋ=0;public ȓ(MyGridProgram Ƽ,int ƻ=1,bool ȉ=false){ǂ=Ƽ;Ȋ=ƻ;ȋ=ȉ;}
- public void Ȉ(ɓ ñ,double ȇ,bool ȗ=false){ñ.Ɍ=true;ñ.ɉ(this);if(ȗ){ñ.ɑ=ȏ;Ȍ.Insert(0,ñ);return;}if(ȇ<=0)ȇ=0.001;ñ.ɑ=ȏ+ȇ;for(int
- F=0;F<Ȍ.Count;F++){if(Ȍ[F].ɑ>ñ.ɑ){Ȍ.Insert(F,ñ);return;}if(ñ.ɑ-Ȍ[F].ɑ<Ȓ)ñ.ɑ=Ȍ[F].ɑ+Ȓ;}Ȍ.Add(ñ);}public void Ȩ(ɓ ñ){if(Ȍ.
- Contains(ñ)){Ȍ.Remove(ñ);ñ.Ɍ=false;}}public void Ȧ(ʌ ȧ,int Ȥ=1){if(Ȋ==Ȥ)ǂ.Echo(ȧ.ɕ());}public void Ȧ(string ȥ,int Ȥ=1){if(Ȋ==Ȥ)ǂ
- .Echo(ȥ);}const double ȣ=(16.66666666/16);double Ȣ=0;public void ȩ(){Ȣ+=ǂ.Runtime.TimeSinceLastRun.TotalSeconds*ȣ;}ʌ ƫ=
- new ʌ();public void Ƞ(){double ȟ=ǂ.Runtime.TimeSinceLastRun.TotalSeconds*ȣ+Ȣ;Ȣ=0;ȍ+=ȟ;Ȏ=(int)Math.Min((ȟ*60)*ȑ/(ȋ?5:1),Ȑ-
- 1000);while(Ȍ.Count>=1){ɓ ñ=Ȍ[0];if(Ȏ-ǂ.Runtime.CurrentInstructionCount<=0)break;if(ñ.ɑ>ȍ){int Ȟ=(int)(60*(ñ.ɑ-ȍ));if(Ȟ>=100
- ){ǂ.Runtime.UpdateFrequency=UpdateFrequency.Update100;}else{if(Ȟ>=10||ȋ)ǂ.Runtime.UpdateFrequency=UpdateFrequency.
- Update10;else ǂ.Runtime.UpdateFrequency=UpdateFrequency.Update1;}break;}Ȍ.Remove(ñ);if(!ñ.ɇ())break;}}public int ȝ(){return(Ȑ-ǂ.
- Runtime.CurrentInstructionCount);}public bool Ȝ(int ț){return((Ȏ-ǂ.Runtime.CurrentInstructionCount)>=ț);}public void Ț(){Ȧ(ƫ.Ŧ(
- ).ʆ("Remaining Instr: ").ʆ(ȝ()));}}class ș:ɓ{MyShipVelocities Ș;public Vector3D ȫ{get{return Ș.LinearVelocity;}}public
- Vector3D ɂ{get{return Ș.AngularVelocity;}}double ɮ=0;public double ʃ{get{if(ɴ!=null)return ɴ.GetShipSpeed();else return ɮ;}}
- double ʁ=0;public double ʀ{get{return ʁ;}}double ɿ=0;public double ɾ{get{return ɿ;}}double ɽ=0;double ɼ=0;public double ɻ{get{
- return ɽ;}}MyShipMass ɺ;public double ɹ{get{return ɺ.TotalMass;}}public double ɸ{get{return ɺ.BaseMass;}}double ʂ=double.NaN;
- public double ɷ{get{return ʂ;}}double ɶ=double.NaN;public double ɵ{get{return ɶ;}}IMyShipController ɴ=null;IMySlimBlock ɳ=null
- ;public IMyShipController ɲ{get{return ɴ;}}Vector3D ɱ;public ș(ȓ ƕ){ɒ="ShipMgr";Ɠ=ƕ;ɱ=Ɠ.ǂ.Me.GetPosition();Ɏ=0.5;}List<
- IMyTerminalBlock>ɰ=new List<IMyTerminalBlock>();int ɯ=0;public override bool Ʉ(bool ë){if(!ë){ɰ.Clear();Ɠ.ǂ.GridTerminalSystem.
- GetBlocksOfType<IMyShipController>(ɰ);ɯ=0;if(ɴ!=null&&ɴ.CubeGrid.GetCubeBlock(ɴ.Position)!=ɳ)ɴ=null;}if(ɰ.Count>0){for(;ɯ<ɰ.Count;ɯ++){
- if(!Ɠ.Ȝ(20))return false;IMyShipController ʄ=ɰ[ɯ]as IMyShipController;if(ʄ.IsMainCockpit||ʄ.IsUnderControl){ɴ=ʄ;ɳ=ʄ.
- CubeGrid.GetCubeBlock(ʄ.Position);if(ʄ.IsMainCockpit){ɯ=ɰ.Count;break;}}}if(ɴ==null){ɴ=ɰ[0]as IMyShipController;ɳ=ɴ.CubeGrid.
- GetCubeBlock(ɴ.Position);}ɺ=ɴ.CalculateShipMass();if(!ɴ.TryGetPlanetElevation(MyPlanetElevation.Sealevel,out ʂ))ʂ=double.NaN;if(!ɴ.
- TryGetPlanetElevation(MyPlanetElevation.Surface,out ɶ))ɶ=double.NaN;Ș=ɴ.GetShipVelocities();}double ʈ=ɮ;ɮ=ȫ.Length();ʁ=(ɮ-ʈ)/ɏ;if(-ʁ>ɿ)ɿ=-ʁ;
- if(-ʁ>ɽ){ɽ=-ʁ;ɼ=Ɠ.ȏ;}if(Ɠ.ȏ-ɼ>5&&-ʁ>0.1)ɽ-=(ɽ+ʁ)*0.3f;return true;}}class ʌ{public StringBuilder ƫ;public ʌ(int ʋ=0){ƫ=new
- StringBuilder(ʋ);}public int ʊ{get{return ƫ.Length;}}public ʌ Ŧ(){ƫ.Clear();return this;}public ʌ ʆ(string ĩ){ƫ.Append(ĩ);return this
- ;}public ʌ ʆ(double ʉ){ƫ.Append(ʉ);return this;}public ʌ ʆ(char ǰ){ƫ.Append(ǰ);return this;}public ʌ ʆ(ʌ ʇ){ƫ.Append(ʇ.ƫ)
- ;return this;}public ʌ ʆ(string ĩ,int Ǿ,int ɔ){ƫ.Append(ĩ,Ǿ,ɔ);return this;}public ʌ ʆ(char ǰ,int Š){ƫ.Append(ǰ,Š);return
- this;}public ʌ ʅ(int Ǿ,int ɔ){ƫ.Remove(Ǿ,ɔ);return this;}public string ɕ(){return ƫ.ToString();}public string ɕ(int Ǿ,int ɔ)
- {return ƫ.ToString(Ǿ,ɔ);}public char this[int X]{get{return ƫ[X];}}}class ɓ{public string ɒ="MMTask";public double ɑ=0;
- public double ɐ=0;public double ɏ=0;public double Ɏ=-1;double ɍ=-1;public bool Ɍ=false;public bool ɋ=false;double Ɋ=0;
- protected ȓ Ɠ;public void ɉ(ȓ ƕ){Ɠ=ƕ;if(Ɠ.ȋ){if(ɍ==-1){ɍ=Ɏ;Ɏ*=2;}else{Ɏ=ɍ*2;}}else{if(ɍ!=-1){Ɏ=ɍ;ɍ=-1;}}}protected bool Ɉ(double
- ȇ){Ɋ=Math.Max(ȇ,0.0001);return true;}public bool ɇ(){if(ɐ>0){ɏ=Ɠ.ȏ-ɐ;Ɠ.Ȧ((ɋ?"Running":"Resuming")+" task: "+ɒ);ɋ=Ʉ(!ɋ);}
- else{ɏ=0;Ɠ.Ȧ("Init task: "+ɒ);Ʌ();Ɠ.Ȧ("Running..");ɋ=Ʉ(false);if(!ɋ)ɐ=0.001;}if(ɋ){ɐ=Ɠ.ȏ;if((Ɏ>=0||Ɋ>0)&&Ɍ)Ɠ.Ȉ(this,(Ɋ>0?Ɋ:Ɏ
- ));else{Ɍ=false;ɐ=0;}}else{if(Ɍ)Ɠ.Ȉ(this,0,true);}Ɠ.Ȧ("Task "+(ɋ?"":"NOT ")+"finished. "+(Ɍ?(Ɋ>0?"Postponed by "+Ɋ.
- ToString("F1")+"s":"Scheduled after "+Ɏ.ToString("F1")+"s"):"Stopped."));Ɋ=0;return ɋ;}public void Ɇ(){Ɠ.Ȩ(this);Ƀ();Ɍ=false;ɋ=
- false;ɐ=0;}public virtual void Ʌ(){}public virtual bool Ʉ(bool ë){return true;}public virtual void Ƀ(){}}class ɖ{public const
- float ɭ=512;public const float ɫ=ɭ/0.7783784f;public const float ɪ=ɭ/0.7783784f;public const float ɩ=ɫ;public const float ɨ=
- 37;public string ɧ="T:[LCD]";public int ɦ=1;public bool ɥ=true;public List<string>ɤ=null;public bool ɣ=true;public int Ȋ=0
- ;public float ɬ=1.0f;public float ɢ=1.0f;public float ɡ{get{return ɩ*ƺ.і;}}public float ɠ{get{return(float)ɡ-2*ɘ[ƹ]*â;}}
- string ɟ;string ɞ;float ɝ=-1;Dictionary<string,float>ɜ=new Dictionary<string,float>(2);Dictionary<string,float>ɛ=new
- Dictionary<string,float>(2);Dictionary<string,float>ɚ=new Dictionary<string,float>(2);public float ə{get{return ɚ[ƹ];}}Dictionary<
- string,float>ɘ=new Dictionary<string,float>(2);Dictionary<string,float>ɗ=new Dictionary<string,float>(2);Dictionary<string,
- float>Ȇ=new Dictionary<string,float>(2);int â=0;string á="";Dictionary<string,char>dž=new Dictionary<string,char>(2);
- Dictionary<string,char>Dž=new Dictionary<string,char>(2);Dictionary<string,char>DŽ=new Dictionary<string,char>(2);Dictionary<string,
- char>ǃ=new Dictionary<string,char>(2);public ȓ Ɠ;public MyGridProgram ǂ;public ȳ ǁ;public ϵ ő;public ș ǀ;public Ƈ Ə;public ǒ
- Ď;public IMyGridTerminalSystem ƿ{get{return ǂ.GridTerminalSystem;}}public IMyProgrammableBlock ƾ{get{return ǂ.Me;}}public
- Action<string>ƽ{get{return ǂ.Echo;}}public ɖ(MyGridProgram Ƽ,int ƻ,ȓ ƕ){Ɠ=ƕ;Ȋ=ƻ;ǂ=Ƽ;Ď=new ǒ();ǁ=new ȳ(ƕ,this);ő=new ϵ(ƕ,this);
- ő.Ѕ();ǀ=new ș(Ɠ);Ɠ.Ȉ(ǀ,0);}ї ƺ=null;public string ƹ{get{return ƺ.J;}}public bool Ƹ{get{return(ƺ.ť()==0);}}public bool LJ(
- IMyTerminalBlock å){if(å==null||å.WorldMatrix==MatrixD.Identity)return true;return ƿ.GetBlockWithId(å.EntityId)==null;}public ї Lj(ї ǐ,è
- n){n.R();IMyTextSurface G=n.ß;if(ǐ==null)ǐ=new ї(this);ǐ.J=G.Font;if(!ɘ.ContainsKey(ǐ.J))ǐ.J=ɟ;ǐ.і=(G.SurfaceSize.X/G.
- TextureSize.X)*(G.TextureSize.X/G.TextureSize.Y)*ɬ/G.FontSize*(100f-G.TextPadding*2)/100;á=n.á;â=n.â;ƺ=ǐ;return ǐ;}public ŝ Ǐ(ŝ æ,è
- n){n.R();IMyTextSurface G=n.ß;if(æ==null)æ=new ŝ(this);æ.ŕ(n.Ý);æ.Ŝ=n.U()*(G.SurfaceSize.Y/G.TextureSize.Y)*ɢ/G.FontSize*
- (100f-G.TextPadding*2)/100;æ.Ŕ();á=n.á;â=n.â;return æ;}public void Ǎ(){ƺ.ѓ();}public void Ǎ(ʌ ǎ){if(ƺ.ѕ<=0)ƺ.є(á);ƺ.є(ǎ);
- ƺ.ѓ();}public void Ǎ(string ǎ){if(ƺ.ѕ<=0)ƺ.є(á);ƺ.ѓ(ǎ);}public void nj(string Nj){ƺ.ѐ(Nj,á);}public void NJ(List<ʌ>lj){ƺ.ђ(lj);
- }public void ƃ(ʌ ƪ,bool Ƴ=true){if(ƺ.ѕ<=0)ƺ.є(á);ƺ.є(ƪ);if(Ƴ)ƺ.ѕ+=Ǟ(ƪ,ƺ.J);}public void ƃ(string ĸ,bool Ƴ=true){if(ƺ.ѕ<=0
- )ƺ.є(á);ƺ.є(ĸ);if(Ƴ)ƺ.ѕ+=Ǟ(ĸ,ƺ.J);}public void ƴ(ʌ ƪ,float ƨ=1.0f,float Ƨ=0f){Ʃ(ƪ,ƨ,Ƨ);ƺ.ѓ();}public void ƴ(string ĸ,
- float ƨ=1.0f,float Ƨ=0f){Ʃ(ĸ,ƨ,Ƨ);ƺ.ѓ();}ʌ ƫ=new ʌ();public void Ʃ(ʌ ƪ,float ƨ=1.0f,float Ƨ=0f){float Ʀ=Ǟ(ƪ,ƺ.J);float ƥ=ƨ*ɩ*
- ƺ.і-ƺ.ѕ-Ƨ;if(â>0)ƥ-=2*ɘ[ƺ.J]*â;if(ƥ<Ʀ){ƺ.є(ƪ);ƺ.ѕ+=Ʀ;return;}ƥ-=Ʀ;int Ƥ=(int)Math.Floor(ƥ/ɘ[ƺ.J]);float ƣ=Ƥ*ɘ[ƺ.J];ƫ.Ŧ().
- ʆ(' ',Ƥ).ʆ(ƪ);ƺ.є(ƫ);ƺ.ѕ+=ƣ+Ʀ;}public void Ʃ(string ĸ,float ƨ=1.0f,float Ƨ=0f){float Ʀ=Ǟ(ĸ,ƺ.J);float ƥ=ƨ*ɩ*ƺ.і-ƺ.ѕ-Ƨ;if(
- â>0)ƥ-=2*ɘ[ƺ.J]*â;if(ƥ<Ʀ){ƺ.є(ĸ);ƺ.ѕ+=Ʀ;return;}ƥ-=Ʀ;int Ƥ=(int)Math.Floor(ƥ/ɘ[ƺ.J]);float ƣ=Ƥ*ɘ[ƺ.J];ƫ.Ŧ().ʆ(' ',Ƥ).ʆ(ĸ)
- ;ƺ.є(ƫ);ƺ.ѕ+=ƣ+Ʀ;}public void Ƣ(ʌ ƪ){Ʒ(ƪ);ƺ.ѓ();}public void Ƣ(string ĸ){Ʒ(ĸ);ƺ.ѓ();}public void Ʒ(ʌ ƪ){float Ʀ=Ǟ(ƪ,ƺ.J);
- float ƶ=ɩ/2*ƺ.і-ƺ.ѕ;if(ƶ<Ʀ/2){ƺ.є(ƪ);ƺ.ѕ+=Ʀ;return;}ƶ-=Ʀ/2;int Ƥ=(int)Math.Round(ƶ/ɘ[ƺ.J],MidpointRounding.AwayFromZero);
- float ƣ=Ƥ*ɘ[ƺ.J];ƫ.Ŧ().ʆ(' ',Ƥ).ʆ(ƪ);ƺ.є(ƫ);ƺ.ѕ+=ƣ+Ʀ;}public void Ʒ(string ĸ){float Ʀ=Ǟ(ĸ,ƺ.J);float ƶ=ɩ/2*ƺ.і-ƺ.ѕ;if(ƶ<Ʀ/2){
- ƺ.є(ĸ);ƺ.ѕ+=Ʀ;return;}ƶ-=Ʀ/2;int Ƥ=(int)Math.Round(ƶ/ɘ[ƺ.J],MidpointRounding.AwayFromZero);float ƣ=Ƥ*ɘ[ƺ.J];ƫ.Ŧ().ʆ(' ',Ƥ
- ).ʆ(ĸ);ƺ.є(ƫ);ƺ.ѕ+=ƣ+Ʀ;}public void Ƶ(double Ʈ,float ƭ=1.0f,float Ƨ=0f,bool Ƴ=true){if(â>0)Ƨ+=2*â*ɘ[ƺ.J];float Ʋ=ɩ*ƭ*ƺ.і-
- ƺ.ѕ-Ƨ;if(Double.IsNaN(Ʈ))Ʈ=0;int Ʊ=(int)(Ʋ/ɗ[ƺ.J])-2;if(Ʊ<=0)Ʊ=2;int ư=Math.Min((int)(Ʈ*Ʊ)/100,Ʊ);if(ư<0)ư=0;if(ƺ.ѕ<=0)ƺ.
- є(á);ƫ.Ŧ().ʆ(dž[ƺ.J]).ʆ(ǃ[ƺ.J],ư).ʆ(DŽ[ƺ.J],Ʊ-ư).ʆ(Dž[ƺ.J]);ƺ.є(ƫ);if(Ƴ)ƺ.ѕ+=ɗ[ƺ.J]*Ʊ+2*Ȇ[ƺ.J];}public void Ư(double Ʈ,float
- ƭ=1.0f,float Ƨ=0f){Ƶ(Ʈ,ƭ,Ƨ,false);ƺ.ѓ();}public void Ƭ(){ƺ.Ƭ();}public void Ǒ(è E,ŝ L=null){E.N(L);if(E.é)E.æ.ĺ();}public
- void Ƿ(string Ƕ,string ĸ){IMyTextPanel E=ǂ.GridTerminalSystem.GetBlockWithName(Ƕ)as IMyTextPanel;if(E==null)return;E.
- WriteText(ĸ+"\n",true);}public string ǵ(MyInventoryItem À){string Ǵ=À.Type.TypeId.ToString();Ǵ=Ǵ.Substring(Ǵ.LastIndexOf('_')+1);
- return À.Type.SubtypeId+" "+Ǵ;}public void dz(string Ò,out string Ð,out string Ï){int š=Ò.LastIndexOf(' ');if(š>=0){Ð=Ò.
- Substring(0,š);Ï=Ò.Substring(š+1);return;}Ð=Ò;Ï="";}public string Dz(string Ò){string Ð,Ï;dz(Ò,out Ð,out Ï);return Dz(Ð,Ï);}public
- string Dz(string Ð,string Ï){Î À=Ə.Ñ(Ð,Ï);if(À!=null){if(À.Ê.Length>0)return À.Ê;return À.Í;}return System.Text.
- RegularExpressions.Regex.Replace(Ð,"([a-z])([A-Z])","$1 $2");}public void DZ(ref string Ð,ref string Ï){Î À;if(Ə.Ƅ.TryGetValue(Ð,out À)){Ð=
- À.Í;Ï=À.Ì;return;}À=Ə.Ñ(Ð,Ï);if(À!=null){Ð=À.Í;if((string.Compare(Ï,"Ore",true)==0)||(string.Compare(Ï,"Ingot",true)==0))
- return;Ï=À.Ì;}}public string ȅ(double Ȃ,bool ȁ=true,char Ȅ=' '){if(!ȁ)return Ȃ.ToString(
- "#,###,###,###,###,###,###,###,###,###");string Ȁ=" kMGTPEZY";double ǿ=Ȃ;int Ǿ=Ȁ.IndexOf(Ȅ);var ǽ=(Ǿ<0?0:Ǿ);while(ǿ>=1000&&ǽ+1<Ȁ.Length){ǿ/=1000;ǽ++;}ƫ.Ŧ().ʆ(
- Math.Round(ǿ,1,MidpointRounding.AwayFromZero));if(ǽ>0)ƫ.ʆ(" ").ʆ(Ȁ[ǽ]);return ƫ.ɕ();}public string ȃ(double Ȃ,bool ȁ=true,
- char Ȅ=' '){if(!ȁ)return Ȃ.ToString("#,###,###,###,###,###,###,###,###,###");string Ȁ=" ktkMGTPEZY";double ǿ=Ȃ;int Ǿ=Ȁ.
- IndexOf(Ȅ);var ǽ=(Ǿ<0?0:Ǿ);while(ǿ>=1000&&ǽ+1<Ȁ.Length){ǿ/=1000;ǽ++;}ƫ.Ŧ().ʆ(Math.Round(ǿ,1,MidpointRounding.AwayFromZero));if(
- ǽ==1)ƫ.ʆ(" kg");else if(ǽ==2)ƫ.ʆ(" t");else if(ǽ>2)ƫ.ʆ(" ").ʆ(Ȁ[ǽ]).ʆ("t");return ƫ.ɕ();}public string Ǽ(double Ʈ){return
- (Math.Floor(Ʈ*10)/10).ToString("F1");}Dictionary<char,float>ǻ=new Dictionary<char,float>();void Ǻ(string ǹ,float K){K+=1;
- for(int F=0;F<ǹ.Length;F++){if(K>ɜ[ɟ])ɜ[ɟ]=K;ǻ.Add(ǹ[F],K);}}public float Ǹ(char ǰ,string J){float Ʋ;if(J==ɞ||!ǻ.
- TryGetValue(ǰ,out Ʋ))return ɜ[J];return Ʋ;}public float Ǟ(ʌ ǟ,string J){if(J==ɞ)return ǟ.ʊ*ɜ[J];float ǝ=0;for(int F=0;F<ǟ.ʊ;F++)ǝ+=
- Ǹ(ǟ[F],J);return ǝ;}public float Ǟ(string ĩ,string J){if(J==ɞ)return ĩ.Length*ɜ[J];float ǝ=0;for(int F=0;F<ĩ.Length;F++)ǝ
- +=Ǹ(ĩ[F],J);return ǝ;}public string ǜ(string ĸ,float Ǜ){if(Ǜ/ɜ[ƺ.J]>=ĸ.Length)return ĸ;float ǚ=Ǟ(ĸ,ƺ.J);if(ǚ<=Ǜ)return ĸ;
- float Ǚ=ǚ/ĸ.Length;Ǜ-=ɛ[ƺ.J];int ǘ=(int)Math.Max(Ǜ/Ǚ,1);if(ǘ<ĸ.Length/2){ƫ.Ŧ().ʆ(ĸ,0,ǘ);ǚ=Ǟ(ƫ,ƺ.J);}else{ƫ.Ŧ().ʆ(ĸ);ǘ=ĸ.
- Length;}while(ǚ>Ǜ&&ǘ>1){ǘ--;ǚ-=Ǹ(ĸ[ǘ],ƺ.J);}if(ƫ.ʊ>ǘ)ƫ.ʅ(ǘ,ƫ.ʊ-ǘ);return ƫ.ʆ("..").ɕ();}void Ǘ(string ǖ){ɟ=ǖ;dž[ɟ]=MMStyle.
- BAR_START;Dž[ɟ]=MMStyle.BAR_END;DŽ[ɟ]=MMStyle.BAR_EMPTY;ǃ[ɟ]=MMStyle.BAR_FILL;ɜ[ɟ]=0f;}void Ǖ(string ǔ,float Ǔ){ɞ=ǔ;ɝ=Ǔ;ɜ[ɞ]=ɝ+1;ɛ[
- ɞ]=2*(ɝ+1);dž[ɞ]=MMStyle.BAR_MONO_START;Dž[ɞ]=MMStyle.BAR_MONO_END;DŽ[ɞ]=MMStyle.BAR_MONO_EMPTY;ǃ[ɞ]=MMStyle.BAR_MONO_FILL;ɘ
- [ɞ]=Ǹ(' ',ɞ);ɗ[ɞ]=Ǹ(DŽ[ɞ],ɞ);Ȇ[ɞ]=Ǹ(dž[ɞ],ɞ);ɚ[ɞ]=Ǟ(" 100.0%",ɞ);}public void Ǡ(){if(ǻ.Count>0)return;
- // Monospace font name, width of single character
- // Change this if you want to use different (modded) monospace font
- Ǖ("Monospace", 24f);
- // Classic/Debug font name (uses widths of characters below)
- // Change this if you want to use different font name (non-monospace)
- Ǘ("Debug");
- // Font characters width (font "aw" values here)
- Ǻ("3FKTabdeghknopqsuy£µÝàáâãäåèéêëðñòóôõöøùúûüýþÿāăąďđēĕėęěĝğġģĥħĶķńņňʼnōŏőśŝşšŢŤŦũūŭůűųŶŷŸșȚЎЗКЛбдекруцяёђћўџ", 17f);
- Ǻ("ABDNOQRSÀÁÂÃÄÅÐÑÒÓÔÕÖØĂĄĎĐŃŅŇŌŎŐŔŖŘŚŜŞŠȘЅЊЖф□", 21f);
- Ǻ("#0245689CXZ¤¥ÇßĆĈĊČŹŻŽƒЁЌАБВДИЙПРСТУХЬ€", 19f);
- Ǻ("¥$&GHPUVY§ÙÚÛÜÞĀĜĞĠĢĤĦŨŪŬŮŰŲОФЦЪЯжы†‡", 20f);
- Ǻ("! !I`ijl ¡¨¯´¸ÌÍÎÏìíîïĨĩĪīĮįİıĵĺļľłˆˇ˘˙˚˛˜˝ІЇії‹›∙", 8f);
- Ǻ("?7?Jcz¢¿çćĉċčĴźżžЃЈЧавийнопсъьѓѕќ", 16f);
- Ǻ("():《》,。、;【】(),.1:;[]ft{}·ţťŧț", 9f);
- Ǻ("+<=>E^~¬±¶ÈÉÊË×÷ĒĔĖĘĚЄЏЕНЭ−", 18f);
- Ǻ("L_vx«»ĹĻĽĿŁГгзлхчҐ–•", 15f);
- Ǻ("\"-rªºŀŕŗř", 10f);
- Ǻ("WÆŒŴ—…‰", 31f);
- Ǻ("'|¦ˉ‘’‚", 6f);
- Ǻ("@©®мшњ", 25f);
- Ǻ("mw¼ŵЮщ", 27f);
- Ǻ("/ijтэє", 14f);
- Ǻ("\\°“”„", 12f);
- Ǻ("*²³¹", 11f);
- Ǻ("¾æœЉ", 28f);
- Ǻ("%IJЫ", 24f);
- Ǻ("MМШ", 26f);
- Ǻ("½Щ", 29f);
- Ǻ("ю", 23f);
- Ǻ("ј", 7f);
- Ǻ("љ", 22f);
- Ǻ("ґ", 13f);
- Ǻ("™", 30f);
- // End of font characters width
- ɘ[ɟ]=Ǹ(' ',ɟ);ɗ[ɟ]=Ǹ(DŽ[ɟ],ɟ);Ȇ[ɟ]=Ǹ(dž[ɟ],ɟ);ɚ[ɟ]=Ǟ(" 100.0%",ɟ);ɛ[ɟ]=Ǹ('.',ɟ)*2;}}class ǒ{public string ǡ(string
- ǯ){return TT[ǯ];}
- readonly Dictionary<string, string> TT = new Dictionary<string, string>
- {
- // TRANSLATION STRINGS
- // msg id, text
- { "AC1", "Acceleration:" },
- // amount
- { "A1", "EMPTY" },
- { "ALT1", "Altitude:"},
- { "ALT2", "Ground:"},
- { "B1", "Booting up..." },
- { "C1", "count:" },
- { "C2", "Cargo Used:" },
- { "C3", "Invalid countdown format, use:" },
- { "C4", "EXPIRED" },
- { "C5", "days" },
- // customdata
- { "CD1", "Block not found: " },
- { "CD2", "Missing block name" },
- { "D1", "You need to enter name." },
- { "D2", "No blocks found." },
- { "D3", "No damaged blocks found." },
- { "DO1", "No connectors found." }, // NEW
- { "DTU", "Invalid GPS format" },
- { "GA", "Artif."}, // (not more than 5 characters)
- { "GN", "Natur."}, // (not more than 5 characters)
- { "GT", "Total"}, // (not more than 5 characters)
- { "G1", "Total Gravity:"},
- { "G2", "Natur. Gravity:"},
- { "G3", "Artif. Gravity:"},
- { "GNC", "No cockpit!"},
- { "H1", "Write commands to Custom Data of this panel." },
- // inventory
- { "I1", "ore" },
- { "I2", "summary" },
- { "I3", "Ores" },
- { "I4", "Ingots" },
- { "I5", "Components" },
- { "I6", "Gas" },
- { "I7", "Ammo" },
- { "I8", "Tools" },
- { "M1", "Cargo Mass:" },
- // oxygen
- { "O1", "Leaking" },
- { "O2", "Oxygen Farms" },
- { "O3", "No oxygen blocks found." },
- { "O4", "Oxygen Tanks" },
- // position
- { "P1", "Block not found" },
- { "P2", "Location" },
- // power
- { "P3", "Stored" },
- { "P4", "Output" },
- { "P5", "Input" },
- { "P6", "No power source found!" },
- { "P7", "Batteries" },
- { "P8", "Total Output" },
- { "P9", "Reactors" },
- { "P10", "Solars" },
- { "P11", "Power" },
- { "P12", "Engines" }, // NEW!
- { "P13", "Turbines" }, // NEW!
- { "PT1", "Power Time:" },
- { "PT2", "Charge Time:" },
- { "PU1", "Power Used:" },
- { "S1", "Speed:" },
- { "SM1", "Ship Mass:" },
- { "SM2", "Ship Base Mass:" },
- { "SD", "Stop Distance:" },
- { "ST", "Stop Time:" },
- // text
- { "T1", "Source LCD not found: " },
- { "T2", "Missing source LCD name" },
- // tanks
- { "T4", "Missing tank type. eg: 'Tanks * Hydrogen'" },
- { "T5", "No {0} tanks found." }, // {0} is tank type
- { "UC", "Unknown command" },
- // occupied & dampeners
- { "SC1", "Cannot find control block." },
- { "SCD", "Dampeners: " },
- { "SCO", "Occupied: " },
- // working
- { "W1", "OFF" },
- { "W2", "WORK" },
- { "W3", "IDLE" },
- { "W4", "LEAK" },
- { "W5", "OPEN" },
- { "W6", "CLOSED" },
- { "W7", "LOCK" },
- { "W8", "UNLOCK" },
- { "W9", "ON" },
- { "W10", "READY" }
- };
- }
- }static class Ǯ{public static bool ǭ(this string ĩ,string ǫ){return ĩ.StartsWith(ǫ,StringComparison.
- InvariantCultureIgnoreCase);}public static bool Ǭ(this string ĩ,string ǫ){if(ĩ==null)return false;return ĩ.IndexOf(ǫ,StringComparison.
- InvariantCultureIgnoreCase)>=0;}public static bool Ǫ(this string ĩ,string ǫ){return ĩ.EndsWith(ǫ,StringComparison.InvariantCultureIgnoreCase);}}
- static class ǩ{public static string Ǩ(this IMyTerminalBlock å){int Ū=å.CustomData.IndexOf("\n---\n");if(Ū<0){if(å.CustomData.
- StartsWith("---\n"))return å.CustomData.Substring(4);return å.CustomData;}return å.CustomData.Substring(Ū+5);}public static string
- ǧ(this IMyTerminalBlock å,int š,string Ǧ){string ǥ=å.Ǩ();string Ǥ="@"+š.ToString()+" AutoLCD";string ǣ='\n'+Ǥ;int Ū=0;if(
- !ǥ.StartsWith(Ǥ,StringComparison.InvariantCultureIgnoreCase)){Ū=ǥ.IndexOf(ǣ,StringComparison.InvariantCultureIgnoreCase);
- }if(Ū<0){if(š==0){if(ǥ.Length==0)return"";if(ǥ[0]=='@')return null;Ū=ǥ.IndexOf("\n@");if(Ū<0)return ǥ;return ǥ.Substring(
- 0,Ū);}else return null;}int Ǣ=ǥ.IndexOf("\n@",Ū+1);if(Ǣ<0){if(Ū==0)return ǥ;return ǥ.Substring(Ū+1);}if(Ū==0)return ǥ.
- Substring(0,Ǣ);return ǥ.Substring(Ū+1,Ǣ-Ū);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement