Advertisement
NickNDS

NDS Inventory Manager Temporary Text Fix

Nov 16th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 105.54 KB | None | 0 0
  1. IMyGridTerminalSystem ʻ;SortedList<string,string>ʺ=new SortedList<string,string>(),ʹ=new SortedList<string,string>(){{
  2. "exclusionKeyword","exclude"},{"manualKeyword","manual"},{"itemIngotKeyword","ingot"},{"itemOreKeyword","ore"},{"itemComponentKeyword",
  3. "component"},{"itemToolKeyword","tool"},{"itemAmmoKeyword","ammo"},{"storageKeyword","cargo"},{"preventCountingKeyword","discount"}
  4. ,{"itemPanelKeyword","item"},{"outputPanelKeyword","inventory"},{"thousandsSuffix","K"},{"millionsSuffix","M"},{
  5. "billionsSuffix","B"},{"assemblyOnlyKeyword","<assemblyOnly>"},{"disassemblyOnlyKeyword","<disassemblyOnly>"},{"belowQuotaOnlyKeyword",
  6. "<belowQuota>"},{"ascendingAmountKeyword","<ascendingAmount>"},{"descendingAmountKeyword","<descendingAmount>"},{
  7. "ascendingPercentKeyword","<ascendingPercent>"},{"descendingPercentKeyword","<descendingPercent>"},{"priorityTag","<priority="},{
  8. "detailedKeyword","<detailed>"},{"compactPercentKeyword","<compactPercent>"},{"compactAmountKeyword","<compactAmount>"},{
  9. "backgroundColorKeyword","<backColor="},{"nameColorKeyword","<nameColor="},{"amountColorKeyword","<amountColor="},{"nameLengthKeyword",
  10. "<nameLength="},{"amountLengthKeyword","<amountLength="},{"panelRowCountKeyword","<rows="},{"panelColumnCountKeyword","<columns="},{
  11. "fontKeyword","<font="},{"scrollTickDelayKeyword","<scroll="},{"totalCapacityKeyword","<total>"},{"statusPanelKeyword","status"},{
  12. "includeGridKeyword","includeGrid"},{"crossGridControlKeyword","crossGrid"},{"autoConveyorKeyword","autoConveyor"},{"displayTextKeyword",
  13. "<text>"}};SortedList<string,double>ʸ=new SortedList<string,double>(){{"actionLimiterMultiplier",0.35},{"runTimeLimiter",0.45},{
  14. "scanDelay",30},{"loopLimiter",0.5},{"icePerO2/H2Generator",5000},{"overheatAverage",0.6},{"balanceRange",0.05},{
  15. "delayProcessLimits",10},{"delaySortItems",10},{"delayDistributeItems",15},{"delaySpreadItems",15},{"delayQueueAssembly",5},{
  16. "delayQueueDisassembly",10},{"delayRemoveExcessAssembly",10},{"delayRemoveExcessDisassembly",15},{"delaySortBlueprints",10},{
  17. "delaySortCargoPriority",20},{"delaySpreadBlueprints",20},{"delayLoadouts",15},{"delayFillingBottles",20},{"delayTimerLogic",10},{
  18. "delayCheckIdleAssemblers",7.5},{"delayResetIdleAssembler",15},{"delayFindModItems",5},{"fuelPerReactor",500},{"allowedExcessPercent",0.1},{
  19. "dynamicQuotaPercentageIncrement",0.05},{"dynamicQuotaMaxMultiplier",5},{"delaySortRefinery",7.5},{"multiplayerPanelFixDelay",10}};SortedList<string,bool
  20. >ʷ=new SortedList<string,bool>(){{"useConveyorRefineries",false},{"useConveyorReactors",false},{"useConveyorH2/O2Gens",
  21. false},{"useConveyorGuns",false},{"autoKeyCargoContainers",true},{"countItems",true},{"countBlueprints",true},{
  22. "processLimits",true},{"sortItems",true},{"spreadRefineries",true},{"spreadReactors",true},{"spreadGuns",true},{"spreadH2/O2Gens",true}
  23. ,{"spreadGravelSifters",true},{"spreadParachutes",true},{"queueAssembly",true},{"queueDisassembly",true},{
  24. "removeExcessAssembly",true},{"removeExcessDisassembly",true},{"sortBlueprints",true},{"sortCargoPriority",true},{"spreadBlueprints",true},{
  25. "doLoadouts",true},{"distributeItems",true},{"triggerLogic",true},{"resetIdleAssemblers",true},{"findModItems",true},{
  26. "autoLoadSettings",true},{"dynamicQuota",true},{"dynamicQuotaIncreaseWhenLow",true},{"sameGridOnly",false},{"sortRefineries",true},{
  27. "setPanelsToSprite",true}};SortedList<string,int>ʶ=new SortedList<string,int>(){{"updateFrequency",1},{"averageTicks",30},{"outputLimit",15
  28. },{"dynamicQuotaNegativeThreshold",3},{"dynamicQuotaPositiveThreshold",9},{"ammoPerGun",40},{"canvasPerParachute",4}};
  29. SortedList<string,List<string>>ʵ=new SortedList<string,List<string>>(){{"excludedDefinitions",new List<string>(){
  30. "Refinery/SmallShipSmallShieldGeneratorBase","CryoChamber/LargeBlockBed","Refinery/LargeShipLargeShieldGeneratorBase","CargoContainer/LargeBlockLockerRoom",
  31. "CargoContainer/LargeBlockLockerRoomCorner","CargoContainer/LargeBlockLockers","Cockpit/PassengerSeatSmall","Cockpit/PassengerSeatLarge",
  32. "InteriorTurret/LargeInteriorTurret","Cockpit/CockpitOpen","Cockpit/OpenCockpitSmall","Cockpit/LargeBlockCockpit","Cockpit/CockpitOpen",
  33. "InteriorTurret/LargeInteriorTurret"}},{"basicRefineryTypes",new List<string>(){"Stone","Scrap","Iron","Nickel","Cobalt","Silicon","Magnesium"}},{
  34. "gravelSifterKeys",new List<string>(){"gravelrefinery","gravelseparator"}}};SortedList<string,ű>ʴ=new SortedList<string,ű>();SortedList<
  35. string,Ǒ>ʳ=new SortedList<string,Ǒ>(),ʲ=new SortedList<string,Ǒ>(),ʱ=new SortedList<string,Ǒ>(),ʰ=new SortedList<string,Ǒ>(),ʯ
  36. =new SortedList<string,Ǒ>(),ʮ=new SortedList<string,Ǒ>();List<IMyTerminalBlock>ʭ=new List<IMyTerminalBlock>(),ʬ=new List<
  37. IMyTerminalBlock>();List<ǂ>ʫ=new List<ǂ>(),ʪ=new List<ǂ>(),ʩ=new List<ǂ>();Dictionary<string,ƀ>ʨ=new Dictionary<string,ƀ>();Dictionary<
  38. string,string>ʧ=new Dictionary<string,string>();HashSet<string>ʼ=new HashSet<string>();List<Ƅ>ʽ=new List<Ƅ>();List<int>ˮ=new
  39. List<int>(),Ͱ=new List<int>(),ˬ=new List<int>(),ˤ=new List<int>(),ˣ=new List<int>(),ˢ=new List<int>(),ˡ=new List<int>(),ˠ=
  40. new List<int>(),ˑ=new List<int>(),ː=new List<int>(),ˏ=new List<int>(),ˎ=new List<int>(),ˍ=new List<int>(),ˌ=new List<int>()
  41. ,ˋ=new List<int>();List<string>ˊ=new List<string>(),ˉ=new List<string>();TimeSpan ˈ=TimeSpan.FromSeconds(0),ˇ=new
  42. TimeSpan(0,0,0),ˆ=new TimeSpan(0,0,0),ˁ=new TimeSpan(0,0,0);SortedList<string,TimeSpan>ˀ=new SortedList<string,TimeSpan>(),ʿ=new
  43. SortedList<string,TimeSpan>();SortedList<string,int>ʾ=new SortedList<string,int>();SortedList<string,string>ʥ=new SortedList<
  44. string,string>();SortedList<long,int>ʋ=new SortedList<long,int>(),ʣ=new SortedList<long,int>();SortedList<long,TimeSpan>ʉ=new
  45. SortedList<long,TimeSpan>();DateTime ʈ=DateTime.Now;string ʇ="Program",ʆ="MyObjectBuilder_Component",ʅ="MyObjectBuilder_Ore",ʄ=
  46. "MyObjectBuilder_Ingot",ʃ="MyObjectBuilder_PhysicalGunObject",ʂ="MyObjectBuilder_GasContainerObject",ʁ="MyObjectBuilder_OxygenContainerObject",
  47. ʊ="MyObjectBuilder_AmmoMagazine",ʀ="MyObjectBuilder_Datapad",ɾ="MyObjectBuilder_ConsumableItem",ɽ=
  48. "MyObjectBuilder_PhysicalObject",ɼ="MyObjectBuilder_BlueprintDefinition",ɻ="Blast Furnace",ɺ="NDS Inventory Manager",ɹ,ɸ,ɷ,ɶ,ɿ,ɵ,ʌ="",ʤ="",ʢ="false",ʡ=
  49. "true",ʠ=Χ[21];const bool ʟ=true,ʞ=false;int ʝ=10,ʜ=10,ʛ=0,ʚ=0,ʙ=0,ʘ=0,ʗ=0,ʖ=0,ʕ=0,ʔ=0;bool ʓ=false,ʒ=false,ʑ=true,ʐ=false,ʏ=
  50. false,ʎ=false,ʦ=false,ʍ=true,ͱ=false,ΰ=false,ή=false,έ=false,ά=false,Ϋ=false,Ϊ=true,Ω=false,Ψ=false;static string[]Χ=new
  51. string[]{"Main Loop","Main Control Loop","Main Output Loop","Adding Status Item","Painting Output Panel",
  52. "Painting Cargo Panel","Measuring Capacities","Painting Item Panel","Counting Listed Items","Distribution Loop","Distributing Item",
  53. "Counting Item In Inventory","Measuring Excess","Sort Loop","Storing Item","Blueprint Count Loop","Count Loop","Scanning","Processing",
  54. "Converting Collection","Converting List","Filling Dictionary","Processing Tags","Transferring Item","Spreading Items","Balancing Items",
  55. "Distributing Blueprint","Removing Excess Assembly","Drawing Item","Setting Block Quotas","Save","Queue Assembly","Queue Disassembly",
  56. "Inserting Blueprint","Count Blueprints In Assmbler","Removing Blueprint","Removing Excess Disassembly","Sort Cargo","Cargo Priority Loop",
  57. "Sorting Cargo Priority","Sort Blueprints","Spread Blueprints","Load","Loadouts","Sort Refineries","Timer Logic","Matching Items",
  58. "Process Timer","Checking Idle Assemblers","Find Mod Items","Process Setting","Panel Painter","Getting Items For Panel",
  59. "Processing Item Setting",};double[]Φ;double Υ=0,Τ=0,Σ=0,Ρ=5.03,Π=0,Ο=0,Ξ,Ν=0,Μ=0,Λ=0,Κ=0,Ι=0,ί=0;Random α=new Random();StringBuilder λ=new
  60. StringBuilder();Dictionary<string,IEnumerator<bool>>μ=new Dictionary<string,IEnumerator<bool>>();const TextAlignment κ=TextAlignment.
  61. LEFT,ι=TextAlignment.CENTER;Program(){ʻ=GridTerminalSystem;θ();Me.GetSurface(1).ContentType=ContentType.SCRIPT;}void θ(){Ȉ()
  62. ;ɹ=ё("exclusionKeyword");ɸ=ё("itemIngotKeyword");ɷ=ё("itemOreKeyword");ɶ=ё("itemComponentKeyword");ɿ=ё("itemAmmoKeyword")
  63. ;ɵ=ё("itemToolKeyword");ʍ=ʷ["autoLoadSettings"];}void Main(string δ){if(!ʦ){try{ʈ=DateTime.Now;ˁ+=Runtime.
  64. TimeSinceLastRun;Ŵ();Ɖ();Ǩ();ʏ=false;ʎ=false;if(ʍ){ʔ++;if(ʔ>=120){if(Me.CustomData.Length!=ʌ.Length||string.Compare(Me.CustomData,ʌ,
  65. false)!=0)ʑ=true;ʔ=0;}}try{if(δ.Length!=0)ε(δ);}catch{ƃ($"Error running command: {δ}");}double η=ʸ["overheatAverage"];if(η<=
  66. 0.0||Σ<=η){ʙ=0;if(!ʓ){ž();Ï();}else{if(ʑ){ž();if(ό())ʑ=false;}else if(ʒ){ž();if(π())ʒ=false;}else Ί();}}else ʙ++;ζ();}catch
  67. {ƃ("Error in main");}}else Echo("Please recompile!");}void ζ(){if(ʜ>=6){ʜ=0;if(ͱ){int Ĩ=0;if(ʤ.Length==0){Echo(
  68. "Choose Item");for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].ß.Length!=0){Echo($"{E+1} : {ʮ.Keys[E]}");Ĩ++;}}if(Ĩ==0)ͱ=false;}else{Echo(
  69. $"Choose Blueprint For {ʤ}");for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].á.Length!=0){Echo($"{E+1} : {ʮ.Keys[E]}");Ĩ++;}}if(Ĩ==0){ͱ=false;ʤ="";}}}
  70. else if(έ){if(ʮ.Count==0)έ=false;for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].á.Length>0)Echo($"BPT: {ʮ.Values[E].á}");else
  71. Echo($"ITM: {ʮ.Values[E].ß}");}}else if(ά){foreach(KeyValuePair<string,IEnumerator<bool>>Ħ in μ){Echo(Ħ.Key);}}else{Echo(
  72. $"Main: {ʠ}");Echo($"Current: {ʇ}");Echo($"Last: {Ǫ(Runtime.LastRunTimeMs,4)}");Echo($"Avg: {Ǫ(Σ,4)}");Echo(
  73. $"Managed Blocks: {ʫ.Count}");Echo($"Panels: {ʪ.Count}");Echo($"Active Functions: {μ.Count}");if(ʘ!=0||ʗ!=0){Echo($"Mod Items: {ʘ}");Echo(
  74. $"Mod Blueprints: {ʗ}");}if(ʕ>0){Echo($"Current Error Count: {ʖ}");Echo($"Total Error Count: {ʕ}");}if(ʙ>0)Echo($"Overheat Ticks: {ʙ}");}}}
  75. void ε(string δ){string γ=δ.ToLower(),û,Ģ,r,Ȍ;û=γ.Replace(" ","");if(γ.Contains(" ")){Ģ=γ.Substring(0,γ.IndexOf(" "));Ȍ=γ.
  76. Substring(γ.IndexOf(" ")+1);}else{Ģ="";Ȍ="";}bool β=ͱ;if(û=="merge"){ʤ="";ͱ=!ͱ;if(ʘ==0||ʗ==0)ͱ=false;return;}if(ͱ){int ö;if(int.
  77. TryParse(δ,out ö)){ö--;if(ö<ʮ.Count){if(ʤ.Length==0){if(ʮ.Values[ö].ß.Length!=0)ʤ=ʮ.Keys[ö];}else{if(ʮ.Values[ö].á.Length!=0){Ǒ
  78. Θ=ʮ.Values[ö],Η=ʮ[ʤ];Ÿ(Η.ß,Η.ß,Η.ª,Θ.á);ʮ.Remove(Θ.á);ʮ.Remove(ʤ);ˊ.Remove(Η.ß);ˉ.Remove(Θ.á);ʘ--;ʗ--;ʤ="";ͱ=false;ʒ=true
  79. ;}}}}}if(!β){β=true;switch(û){case"ping":ƃ("Pong!");break;case"save":if(!ʑ)ʒ=true;else ƃ(
  80. "Currently loading! Please wait to save");break;case"load":if(!ʒ)ʑ=true;else ƃ("Currently saving! Please wait to load");break;case"clearqueue":for(int E=0;E<Ͱ.
  81. Count;E++){try{((IMyAssembler)ʫ[Ͱ[E]].B).ClearQueue();}catch{}}break;case"reset":Me.CustomData="";Storage="";ʦ=true;break;
  82. case"clearfunctions":Ό();break;case"merge?":έ=!έ;if(ʮ.Count==0)έ=false;break;case"functions?":ά=!ά;break;case"scan":ˈ=
  83. TimeSpan.FromSeconds(0);Ό();break;case"echo":Ϊ=!Ϊ;Echo($"Echo Allowed: {Ϊ}");break;default:β=false;break;}}if(!β&&Ģ.Length!=0)
  84. switch(Ģ){case"setgroup":r=Ȍ.Substring(0,Ȍ.IndexOf(" "));Ȍ=Ȍ.Substring(Ȍ.IndexOf(" ")+1);ɮ(r,double.Parse(Ȍ));ʒ=true;break;
  85. case"set":r=Ȍ.Substring(0,Ȍ.IndexOf(" "));Ȍ=Ȍ.Substring(Ȍ.LastIndexOf(" ")+1);ɳ(r,double.Parse(Ȍ));ʒ=true;break;}}void Ό(){
  86. for(int E=0;E<Χ.Length;E++)if(μ.ContainsKey(Χ[E]))ƈ(Χ[E]);}void Ί(){if(!μ.ContainsKey(Χ[0]))Ȋ(Ή(),Χ[0]);else ǯ(Χ[0]);}
  87. IEnumerator<bool>Ή(){double Έ=ʸ["loopLimiter"];while(true){Ά();if(!DZ(Έ))yield return true;ї();if(!DZ(Έ))yield return true;Έ=ʸ[
  88. "loopLimiter"];}}void Ά(){ž();if(!μ.ContainsKey(Χ[1]))Ȋ(ͽ(),Χ[1]);else ǯ(Χ[1]);}IEnumerator<bool>ͽ(){string Ģ;while(true){if(ʖ>=10){ʖ
  89. =0;for(int E=2;E<Χ.Length;E++){if(!DZ())yield return true;if(μ.ContainsKey(Χ[E]))ƈ(Χ[E]);}}if(ˈ.TotalSeconds<=0.0){Ϋ=true;
  90. ʠ=Χ[17];while(!Ŋ(ʠ))yield return true;ʠ=Χ[18];while(!к(ʠ))yield return true;ʠ="Idle";Ϋ=false;ˈ=TimeSpan.FromSeconds(ʸ[
  91. "scanDelay"]);}if(ʷ["countItems"]){ʠ=Χ[16];while(!ŀ(ʠ))yield return true;ʠ="Idle";}if(ʷ["countBlueprints"]){ʠ=Χ[15];while(!Ĺ(Χ[15])
  92. )yield return true;ʠ="Idle";}if(ʛ>0&&ʷ["sortRefineries"]){Ģ=Χ[44];if(Ý(Ģ)){ʠ=Ģ;while(!Ζ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ
  93. ]=Û(ʸ["delaySortRefinery"]);}}if(ʷ["processLimits"]){Ģ=Χ[12];if(Ý(Ģ)){ʠ=Ģ;while(!Œ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ
  94. ["delayProcessLimits"]);}}if(ʷ["sortItems"]){Ģ=Χ[13];if(Ý(Ģ)){ʠ=Ģ;while(!ŏ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
  95. "delaySortItems"]);}}if(ʷ["distributeItems"]){Ģ=Χ[9];if(Ý(Ģ)){if(ʸ["delayFillingBottles"]>0.0&&ˆ.TotalMilliseconds<=0.0)ʐ=true;else ʐ=
  96. false;ʠ=Ģ;while(!ij(Ģ))yield return true;ʠ="Idle";if(ʐ)ˆ=Û(ʸ["delayFillingBottles"]);ʿ[Ģ]=Û(ʸ["delayDistributeItems"]);}}Ģ=Χ[
  97. 24];if(Ý(Ģ)){if(ˮ.Count>1&&ʷ["spreadRefineries"]){ʠ="Spreading Refineries";while(!Ȯ(ˮ,Ģ))yield return true;}if(ˬ.Count>1&&
  98. ʷ["spreadReactors"]){ʠ="Spreading Reactors";while(!Ȯ(ˬ,Ģ))yield return true;}if(ˤ.Count>1&&ʷ["spreadGuns"]){ʠ=
  99. "Spreading Weapons";while(!Ȯ(ˤ,Ģ))yield return true;}if(ˣ.Count>1&&ʷ["spreadH2/O2Gens"]){ʠ="Spreading O2/H2 Gens";while(!Ȯ(ˣ,Ģ))yield
  100. return true;}if(ˏ.Count>1&&ʷ["spreadGravelSifters"]){ʠ="Spreading Gravel Sifters";while(!Ȯ(ˏ,Ģ))yield return true;}if(ˍ.Count>
  101. 1&&ʷ["spreadParachutes"]){ʠ="Spreading Parachutes";while(!Ȯ(ˍ,Ģ))yield return true;}ʠ="Idle";ʿ[Ģ]=Û(ʸ["delaySpreadItems"]
  102. );}if(ʷ["queueAssembly"]){Ģ=Χ[31];if(Ý(Ģ)){ʠ=Ģ;while(!ψ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayQueueAssembly"]);}}
  103. if(ʷ["queueDisassembly"]){Ģ=Χ[32];if(Ý(Ģ)){ʠ=Ģ;while(!φ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayQueueDisassembly"]);}
  104. }if(ʷ["removeExcessAssembly"]){Ģ=Χ[27];if(Ý(Ģ)){ʠ=Ģ;while(!Ϻ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
  105. "delayRemoveExcessAssembly"]);}}if(ʷ["removeExcessDisassembly"]){Ģ=Χ[36];if(Ý(Ģ)){ʠ=Ģ;while(!ϯ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
  106. "delayRemoveExcessDisassembly"]);}}if(ʷ["sortBlueprints"]){Ģ=Χ[40];if(Ý(Ģ)){ʠ=Ģ;while(!Ϟ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delaySortBlueprints"]
  107. );}}if(ʷ["sortCargoPriority"]){Ģ=Χ[38];if(Ý(Ģ)){ʠ=Ģ;while(!Ϣ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
  108. "delaySortCargoPriority"]);}}if(ʷ["spreadBlueprints"]){Ģ=Χ[41];if(Ý(Ģ)){ʠ=Ģ;while(!Ϯ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
  109. "delaySpreadBlueprints"]);}}if(ʷ["doLoadouts"]){Ģ=Χ[43];if(Ý(Ģ)){ʠ=Ģ;while(!ͼ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayLoadouts"]);}}if(ʷ[
  110. "triggerLogic"]){Ģ=Χ[45];if(Ý(Ģ)){ʠ=Ģ;while(!ȸ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayTimerLogic"]);}}if(ʷ["resetIdleAssemblers"
  111. ]){Ģ=Χ[48];if(Ý(Ģ)){ʠ=Ģ;while(!Ȱ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayCheckIdleAssemblers"]);}}if(ʷ[
  112. "findModItems"]){Ģ=Χ[49];if(Ý(Ģ)){ʠ=Ģ;while(!Ȼ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayFindModItems"]);}}yield return true;}}bool
  113. ͼ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ͻ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ͻ(){ǂ Ì,ͺ;IMyInventory ͷ,Ͷ
  114. ;int ʹ,ͳ;List<MyInventoryItem>ō=new List<MyInventoryItem>();ű Ã=Ñ(),Ͳ;Ǒ Þ;double Ύ;for(int E=0;E<ʫ.Count;E++){if(!DZ())
  115. yield return true;if(!ø(E))continue;try{Ì=ʫ[E];}catch{continue;}ʹ=Ì.ƿ.š();if(ʹ!=0){ͷ=Ì.B.GetInventory(0);Ã.Ŧ();Ͳ=new ű(Ì.ƿ);
  116. if(Ì.B is IMyAssembler&&!((IMyAssembler)Ì.B).IsQueueEmpty&&Ì.ƽ!=null)Ͳ.Ţ(Ì.ƽ);while(!ĵ(Ã,new List<int>{E}))yield return
  117. true;ͳ=Ã.š();for(int ĥ=0;ĥ<ͳ;ĥ++){if(!DZ())yield return true;Þ=Ã.Š(ĥ);if(Þ.ß.Length!=0)Ͳ.ū(Þ.ª,Þ.ß,-Þ.Ǐ);}for(int ĥ=0;ĥ<ͳ;ĥ++
  118. ){if(!DZ())yield return true;try{Þ=Ͳ.Š(ĥ);if(Þ.Ǐ<0.0)ʫ[E].Ĥ.ū(Þ.ª,Þ.ß,-Þ.Ǐ);}catch{}}for(int ĥ=0;ĥ<ˎ.Count&&ȱ(Ͳ);ĥ++){if(!
  119. DZ())yield return true;ō.Clear();if(!ø(ˎ[ĥ]))continue;try{ͺ=ʫ[ˎ[ĥ]];}catch{continue;}Ͷ=ͺ.B.GetInventory(0);Ͷ.GetItems(ō);
  120. for(int D=0;D<ō.Count&&ȱ(Ͳ);D++){if(!DZ())yield return true;if(Ͳ.ŭ(ō[D])>0.0&&(double)ō[D].Amount>ͺ.ƿ.ŭ(ō[D])){try{Ύ=Ͳ.ŭ(ō[D
  121. ]);if(Ύ>(double)ō[D].Amount)Ύ=(double)ō[D].Amount;Ύ-=ͺ.ƿ.ŭ(ō[D]);if(!Ǵ(ō[D]))Ύ=Math.Floor(Ύ);if(Ύ>0.0){if(ͷ.
  122. TransferItemFrom(Ͷ,ō[D],(MyFixedPoint)Ύ))Ͳ.ū(ō[D].Type.TypeId,ō[D].Type.SubtypeId,-Ύ);}}catch{}}}}}}yield return false;}bool Ζ(string Į)
  123. {if(!μ.ContainsKey(Į)){Ȋ(Ε(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ε(){ǂ Ì;List<MyInventoryItem>ō=new
  124. List<MyInventoryItem>(),Δ=new List<MyInventoryItem>();List<Ƃ>Γ=new List<Ƃ>();IMyInventory ı;double Β=0,Α=0,ΐ;for(int E=0;E<ˮ
  125. .Count;E++){if(!DZ())yield return true;if(!ø(ˮ[E]))continue;try{Ì=ʫ[ˮ[E]];}catch{continue;}ı=Ì.B.GetInventory(0);ō.Clear()
  126. ;Γ.Clear();ı.GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;try{Γ.Add(new Ƃ{J=ɖ(ō[ĥ]),Ɓ=ĥ});if(ĥ==0){Β=
  127. Γ[Γ.Count-1].J;Α=Γ[Γ.Count-1].J;}else{Β=Math.Min(Β,Γ[Γ.Count-1].J);Α=Math.Max(Α,Γ[Γ.Count-1].J);}}catch{}}if(Ì.B.
  128. CustomData.Length==0)Ì.ǀ=Ñ();if(Β!=Α){Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();Δ.Clear();ΐ=Math.Max(ʛ,Γ.Count);double Ώ=0,Ē=(double)ı.
  129. MaxVolume/Ǿ(ō[0]);for(int ĥ=0;ĥ<Γ.Count;ĥ++){if(!DZ())yield return true;Δ.Add(ō[Γ[ĥ].Ɓ]);}if(Δ.Count>1)for(int F=1;F<=ΐ;F++)Ώ+=F;
  130. for(int ĥ=0;ĥ<Δ.Count;ĥ++){if(!DZ())yield return true;if(Ì.B.CustomData.Length==0)Ì.ǀ.ū(Δ[ĥ].Type.TypeId,Δ[ĥ].Type.SubtypeId
  131. ,(((double)Δ.Count-(double)ĥ)/Ώ)*Ē,false);for(int F=0;F<ı.ItemCount;F++){if(!DZ())yield return true;try{MyInventoryItem Ö=
  132. (MyInventoryItem)ı.GetItemAt(F);if(Ö.Type.ToString()==Δ[ĥ].Type.ToString()){ı.TransferItemFrom(ı,F,ĥ,false,Δ[ĥ].Amount);
  133. break;}}catch{}}}}}yield return false;}bool ȸ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ɇ(),Į);if(!DZ())return false;}return ǯ(Į);}
  134. IEnumerator<bool>Ɇ(){bool Ǚ,Ʌ=true;ǂ Ì;Ǒ Þ;for(int E=0;E<ʩ.Count;E++){if(E>0&&!DZ())yield return true;Ì=ʩ[E];if(((IMyFunctionalBlock
  135. )Ì.B).Enabled){Ǚ=Ì.Ǚ;for(int ĥ=0;ĥ<Ì.Ƽ.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;if(õ(out Þ,Ì.Ƽ[ĥ].ª))Ʌ=Ʉ(Þ,Ì.Ƽ[ĥ].DŽ,Ì.Ƽ[
  136. ĥ].ǃ);if((!Ʌ&&Ǚ)||(Ʌ&&!Ǚ))break;}if(Ʌ)((IMyTimerBlock)Ì.B).Trigger();}}yield return false;}bool Ʉ(Ǒ Þ,string DŽ,string ǃ){
  137. double Ƀ=0;if(ǃ=="quota"){Ƀ=Þ.Ƭ();}else if(ǃ.Contains("/")){Ǒ ɂ;if(õ(out ɂ,ǃ))Ƀ=ɂ.Ǐ;}else double.TryParse(ǃ,out Ƀ);if(DŽ.
  138. Contains("=")&&ǃ=="quota"&&Ƀ<0.0)return false;if(DŽ==">="){return Þ.Ǐ>=Ƀ;}else if(DŽ=="<="){return Þ.Ǐ<=Ƀ;}else if(DŽ==">"){return
  139. Þ.Ǐ>Ƀ;}else if(DŽ=="<"){return Þ.Ǐ<Ƀ;}else if(DŽ=="="){return Þ.Ǐ==Ƀ;}return true;}bool Ɂ(IMyTerminalBlock B){string q=Ȁ(B)
  140. ;return q.Contains("[logic&")||q.Contains("[logic|");}bool ɀ(ű Ã,string ª,string r,bool ů=true,double J=0){if(Ǡ(ª))return
  141. Ɏ(Ã,ʳ,r,ů,J);if(ǜ(ª))return Ɏ(Ã,ʯ,r,ů,J);if(Ǟ(ª))return Ɏ(Ã,ʱ,r,ů,J);if(ǟ(ª))return Ɏ(Ã,ʲ,r,ů,J);if(ǝ(ª))return Ɏ(Ã,ʰ,r,ů
  142. ,J);return true;}bool Ɏ(ű Ã,SortedList<string,Ǒ>ō,string r,bool ů=true,double J=0){if(!μ.ContainsKey(Χ[46])){Ȋ(ɍ(Ã,ō,r,ů,
  143. J),Χ[46]);if(!DZ())return false;}return ǯ(Χ[46]);}IEnumerator<bool>ɍ(ű Ã,SortedList<string,Ǒ>ō,string r,bool ů,double J){Ǒ
  144. Þ;bool Ɍ=false;if(r.Length>0)for(int E=0;E<ō.Count;E++){if(E>0&&!DZ())yield return true;Þ=ō.Values[E];if(r.Length>2)Ɍ=r.
  145. StartsWith("'")&&r.EndsWith("'");if(r=="*"||(Ɍ&&ɣ(Þ.ǐ.Replace(" ",""),r.Substring(1,r.Length-2)))||(!Ɍ&&Þ.ǐ.ToLower().Replace(" ",
  146. "").StartsWith(r)))Ã.ū(Þ.ª,Þ.ß,J,ů);}yield return false;}bool ɋ(ǂ Ì){if(!μ.ContainsKey(Χ[47])){Ȋ(Ɋ(Ì),Χ[47]);if(!DZ())
  147. return false;}return ǯ(Χ[47]);}IEnumerator<bool>Ɋ(ǂ Ì){Ì.Ƽ=new List<dž>();List<string>ɉ=new List<string>();string q,Ɉ,ɇ=
  148. "[logic",ª="",ß="",DŽ=">",ȿ="";string[]ȶ;char Æ='&';bool ȵ=false,ȴ=false;int ö,ȳ,Ȳ;q=Ì.Ǔ().Replace(" ","");while(q.Contains(ɇ)){
  149. if(!DZ())yield return true;q=q.Substring(q.IndexOf(ɇ)+ɇ.Length);ö=q.IndexOf("]");Ɉ=q.Substring(0,ö);q=q.Substring(ö+1);if(Ɉ
  150. .StartsWith("&")){if(!ȵ&&!ȴ)ȵ=true;Ɉ=Ɉ.Substring(1);Æ='&';}else if(Ɉ.StartsWith("|")){if(!ȵ&&!ȴ)ȴ=true;Ɉ=Ɉ.Substring(1);Æ
  151. ='|';}if(Ɉ.Contains(Æ.ToString()))ȶ=Ɉ.Split(Æ);else ȶ=new string[]{Ɉ};for(int ĥ=0;ĥ<ȶ.Length;ĥ++){if(!DZ())yield return
  152. true;ɉ.Add(ȶ[ĥ]);}}Ì.Ǚ=Æ=='&';if(ɉ.Count>0){ű Ã,ȷ;for(int ĥ=0;ĥ<ɉ.Count;ĥ++){if(!DZ())yield return true;try{ȿ=ɉ[ĥ];ö=ȿ.
  153. IndexOf(":");ª=ȿ.Substring(0,ö);ȿ=ȿ.Substring(ö+1);if(ȿ.Contains(">="))DŽ=">=";else if(ȿ.Contains("<="))DŽ="<=";else if(ȿ.
  154. Contains(">"))DŽ=">";else if(ȿ.Contains("<"))DŽ="<";else if(ȿ.Contains("="))DŽ="=";ö=ȿ.IndexOf(DŽ);ß=ȿ.Substring(0,ö);ȿ=ȿ.Substring(
  155. ö+DŽ.Length);}catch{}Ã=Ñ();while(!ɀ(Ã,ª,ß))yield return true;ȳ=Ã.š();ö=ȿ.IndexOf(":");if(ö>0){ȷ=Ñ();ª=ȿ.Substring(0,ö);ß=ȿ
  156. .Substring(ö+1);while(!ɀ(ȷ,ª,ß))yield return true;Ȳ=ȷ.š();for(int E=0;E<ȳ;E++){for(int D=0;D<Ȳ;D++){if(!DZ())yield return
  157. true;Ì.Ƽ.Add(new dž{ª=Ã.ţ(E),ǃ=ȷ.ţ(D),DŽ=DŽ});}}}else{for(int E=0;E<ȳ;E++){if(!DZ())yield return true;Ì.Ƽ.Add(new dž{ª=Ã.ţ(E),ǃ=ȿ
  158. ,DŽ=DŽ});}}}}yield return false;}bool ȱ(ű Ã){return ȱ(Ã.V)||ȱ(Ã.Ũ)||ȱ(Ã.Ű)||ȱ(Ã.ũ)||ȱ(Ã.ŧ);}bool ȱ(SortedList<string,double
  159. >µ){for(int E=0;E<µ.Count;E++)if(µ.Values[E]>0.0)return true;return false;}bool Ȱ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ȯ(),Į
  160. );if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ȯ(){ǂ Ì;IMyAssembler ă;Ƈ ǁ;double Ⱦ=ʸ["delayResetIdleAssembler"];
  161. List<MyProductionItem>ķ=new List<MyProductionItem>();List<MyInventoryItem>ō=new List<MyInventoryItem>();int Ƚ;bool ȼ;for(int
  162. E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;Ì=ʫ[Ͱ[E]];ǁ=Ì.ǁ;if(DateTime.Now>=ǁ.ƅ){ă=(IMyAssembler)Ì.B;if(!ă.IsQueueEmpty
  163. ){ķ.Clear();ă.GetQueue(ķ);ʫ[Ͱ[E]].ǁ.ƅ=DateTime.Now.AddSeconds(Ⱦ);if(ǁ.Ą==ă.Mode&&ǁ.Ɔ==ă.CurrentProgress){if(ķ.Count==ǁ.ķ.
  164. Count){Ƚ=0;ȼ=false;for(int ĥ=0;ĥ<ķ.Count&&!ȼ;ĥ++){for(int D=0;D<ǁ.ķ.Count&&!ȼ;D++){if(!DZ())yield return true;if(ķ[ĥ].
  165. BlueprintId.SubtypeName==ǁ.ķ[D].BlueprintId.SubtypeName&&(double)ķ[ĥ].Amount>=(double)ǁ.ķ[D].Amount){Ƚ++;break;}else ȼ=true;}}if(Ƚ
  166. ==ķ.Count){ă.ClearQueue();ō.Clear();ă.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++)while(!ŗ(ō[ĥ],Ͱ[E],0))yield
  167. return true;ō.Clear();ă.GetInventory(1).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++)while(!ŗ(ō[ĥ],Ͱ[E],1))yield return true;}}}try{ʫ
  168. [Ͱ[E]].ǁ.ķ.Clear();ʫ[Ͱ[E]].ǁ.ķ.AddRange(ķ);}catch{}}else try{ʫ[Ͱ[E]].ǁ.ķ.Clear();}catch{}try{ʫ[Ͱ[E]].ǁ.Ɔ=ă.
  169. CurrentProgress;ʫ[Ͱ[E]].ǁ.Ą=ă.Mode;}catch{}}}yield return false;}bool Ȼ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ⱥ(),Į);if(!DZ())return false;}
  170. return ǯ(Į);}IEnumerator<bool>Ⱥ(){List<MyProductionItem>ķ=new List<MyProductionItem>();List<MyInventoryItem>ō=new List<
  171. MyInventoryItem>();for(int E=0;E<Ͱ.Count;E++){if(E>0&&!DZ())yield return true;ķ.Clear();if(!ø(Ͱ[E]))continue;try{((IMyAssembler)ʫ[Ͱ[E]].
  172. B).GetQueue(ķ);}catch{continue;}for(int D=0;D<ķ.Count;D++){if(D>0&&!DZ())yield return true;if(ɫ(ķ[D]))ɭ(ķ[D]);}}for(int E=
  173. 0;E<ʫ.Count;E++){if(E>0&&!DZ())yield return true;ō.Clear();if(!ø(E))continue;try{ʫ[E].B.GetInventory(0).GetItems(ō);}catch
  174. {continue;}for(int D=0;D<ō.Count;D++){if(D>0&&!DZ())yield return true;if(ɬ(ō[D]))ɏ(ō[D]);}}yield return false;}void ȹ(){ʘ=
  175. 0;ʗ=0;for(int E=0;E<ʮ.Count;E++)if(ʮ.Values[E].á.Length!=0)ʗ++;else ʘ++;}void ɏ(MyInventoryItem Ö){string ß=Ö.Type.
  176. SubtypeId;if(Ǡ(Ö)||ǟ(Ö)){Ÿ(ß,ß,Ö.Type.TypeId);ʒ=true;return;}if(!ʮ.ContainsKey(ß)){ʮ[ß]=new Ǒ{ª=Ö.Type.TypeId,ß=ß,ǐ=ß};ˊ.Add(ß);}
  177. else{Ǒ Þ=ʮ[ß];if(Þ.á.Length!=0){Ÿ(ß,ß,Ö.Type.TypeId,Þ.á);ʮ.Remove(ß);ˊ.Remove(ß);ʒ=true;}}ȹ();}void ɭ(MyProductionItem ë){
  178. string ß=ë.BlueprintId.SubtypeName;if(!ʮ.ContainsKey(ß)){ʮ[ß]=new Ǒ{á=ß};ˉ.Add(ß);}else{Ǒ Þ=ʮ[ß];if(Þ.ß.Length!=0){Ÿ(Þ.ǐ,Þ.ß,Þ
  179. .ª,ß);ʮ.Remove(ß);ˉ.Remove(ß);ʒ=true;}}ȹ();}bool ɬ(MyInventoryItem Ö){return!ˊ.Contains(Ö.Type.SubtypeId)&&õ(Ö.Type.
  180. ToString())==null;}bool ɫ(MyProductionItem ë){if(ë.BlueprintId.SubtypeName=="StoneOreToIngotBasic")return false;return!ˉ.
  181. Contains(ë.BlueprintId.SubtypeName)&&!ʨ.ContainsKey(ë.BlueprintId.SubtypeName);}bool ɪ(string ȧ){if(!μ.ContainsKey(Χ[50])){Ȋ(ɩ(ȧ
  182. ),Χ[50]);if(!DZ())return false;}return ǯ(Χ[50]);}IEnumerator<bool>ɩ(string ȧ){int ö=ȧ.IndexOf("=");string ɨ,ɧ;if(ö!=-1){
  183. string Ģ=ȧ.Substring(0,ö).Trim();ɨ=ȧ.Substring(ö+1).Trim();if(ɣ(Ģ,"name")){while(!ȩ(ȧ))yield return true;}else if(Ģ=="group"){
  184. ö=ɨ.IndexOf("=");ɧ=ɨ.Substring(0,ö).ToLower();ɨ=ɨ.Substring(ö+1).Trim();ű Ã=Ñ();while(!É(Ã,ɨ,'[',']','|',false))yield
  185. return true;if(ɧ.Length!=0&&Ã.š()!=0)ʴ[ɧ]=Ã;}else{ɨ=ȧ.Substring(ö+1).Trim();double ɦ;bool ɥ=!ɣ(ɨ,ʢ);if(!double.TryParse(ɨ,out
  186. ɦ))ɦ=0;if(Ģ=="script"){if(ɨ==ɺ)ΰ=true;}else if(Ģ=="version"){if(ɦ==Ρ)ή=true;}else if(ʹ.ContainsKey(Ģ))ʹ[Ģ]=ɨ;else if(ʸ.
  187. ContainsKey(Ģ))ʸ[Ģ]=ɦ;else if(ʷ.ContainsKey(Ģ))ʷ[Ģ]=ɥ;else if(ʶ.ContainsKey(Ģ))ʶ[Ģ]=(int)ɦ;else{if(ʵ.ContainsKey(Ģ)&&ɨ.StartsWith(
  188. "[")&&ɨ.EndsWith("]")){ɨ=ɨ.Substring(1,ɨ.Length-2);string[]ɤ=ɨ.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries)
  189. ;ʵ[Ģ].Clear();for(int E=0;E<ɤ.Length;E++){if(!DZ())yield return true;ʵ[Ģ].Add(ɤ[E]);}}}}}yield return false;}void ɮ(string
  190. r,double J){ű Ã;if(ʴ.TryGetValue(r.ToLower(),out Ã)){int Ĩ=Ã.š();for(int E=0;E<Ĩ;E++)ɴ(Ã.ţ(E),J);}}void ɴ(string ô,double
  191. J){int ö=ô.IndexOf("/");ɴ(ô.Substring(0,ö),ô.Substring(ö+1),J);}void ɴ(string ª,string ß,double J){Ǒ Þ;if(õ(out Þ,
  192. $"{ª}/{ß}")){Þ.Ç=J;if(Þ.Ɯ<J)Þ.Ɯ=J;}}void ɳ(string r,double J){if(r.Length>0){if(ǜ(r))ɲ(ʯ,J);else if(Ǟ(r))ɲ(ʱ,J);else if(Ǡ(r))ɲ(ʳ,J
  193. );else if(ǟ(r))ɲ(ʲ,J);else if(ǝ(r))ɲ(ʰ,J);else{ɲ(ʯ,J,r);ɲ(ʱ,J,r);ɲ(ʳ,J,r);ɲ(ʲ,J,r);ɲ(ʰ,J,r);}}}void ɲ(SortedList<string,Ǒ
  194. >µ,double J,string ɱ=""){string ɰ=ɱ.Replace(" ","");bool ɯ=false;if(ɰ.Length>2){if(ɰ.StartsWith("'")&&ɰ.EndsWith("'")){ɯ=
  195. true;ɰ=ɰ.Substring(1,ɰ.Length-2);}}for(int E=0;E<µ.Count;E++)if(ɰ.Length==0||(!ɯ&&µ.Values[E].ǐ.Replace(" ","").ToLower().
  196. StartsWith(ɰ))||(ɯ&&ɣ(µ.Values[E].ǐ.Replace(" ",""),ɰ))){µ.Values[E].Ç=J;if(µ.Values[E].Ɯ<J)µ.Values[E].Ɯ=J;}}bool ɣ(string ļ,
  197. string Ê){return string.Compare(ļ,Ê,true)==0;}double ɖ(MyInventoryItem Ö){double ɕ=-1,ɔ;Ǒ Þ;for(int E=0;E<ʳ.Count;E++){try{Þ=ʳ
  198. .Values[E];ɔ=Þ.Ŷ.IndexOf(Ö.Type.SubtypeId);if(ɔ!=-1){if(ɕ==-1)ɕ=Þ.ơ()+(ɔ*0.00001);else ɕ=Math.Min(ɕ,Þ.ơ()+(ɔ*0.00001));}}
  199. catch{}}return ɕ;}ƀ ɓ(Ǒ Þ){return new ƀ{á=Þ.á,ß=Þ.ß,ª=Þ.ª,ſ=Ñ()};}bool ɒ(ǂ Ì){if(!μ.ContainsKey(Χ[51])){Ȋ(ɑ(Ì),Χ[51]);if(!DZ()
  200. )return false;}return ǯ(Χ[51]);}IEnumerator<bool>ɑ(ǂ Ì){IMyTextSurface h=Ì.ǒ();long Ģ=Ì.B.EntityId;double ɐ,Ȝ=0;Vector2 e
  201. =h.SurfaceSize,l=h.TextureSize-h.SurfaceSize,Ƞ,Ȣ,ț,Ț,Ș,ȗ,ȟ,ș,ɢ=э(0f,0f),ɡ=э(0f,0f);if(Ì.ǘ||Ì.ǖ||Ì.B.BlockDefinition.
  202. ToString()=="MyObjectBuilder_TextPanel/LargeTextPanel")l/=2f;string ɠ=Ì.Ǔ(),g="",Z="Monospace";StringBuilder ɟ=new StringBuilder
  203. ();bool ɞ=Ì.ƾ.š()>0||Ì.Ƴ||Ì.LJ||Ì.Ƶ||Ì.ƴ||Ì.Dž,Ǜ=Ì.Ǜ,ǚ=Ì.ǚ,Ǘ=Ì.Ǘ,ɝ=Ϗ("ascendingAmountKeyword",ɠ),ɜ=false,ɛ=false,ɚ=false,ə=
  204. false,ɘ=false,ɗ=false,ȡ=true;List<MySprite>Ð=new List<MySprite>();if(Ϗ("displayTextKeyword",ɠ))ȡ=false;Color c=Color.DarkGray
  205. ,ȝ=Color.Black,Ȟ=Color.OrangeRed,Љ=h.ScriptForegroundColor,Ϝ;if(!ɝ){if(Ϗ("descendingAmountKeyword",ɠ))ɜ=true;else if(Ϗ(
  206. "ascendingPercentKeyword",ɠ))ɛ=true;else if(Ϗ("descendingPercentKeyword",ɠ))ɚ=true;}if(!ʋ.ContainsKey(Ģ)){ʋ[Ģ]=0;ʣ[Ģ]=0;}int О=5,Н=1,М=18,Л=6,К=ʋ
  207. [Ģ],Й=0,И=300,З=19;if(e.X<512)М=10;if(!DZ())yield return true;if(Ϗ(ref О,"panelRowCountKeyword",ɠ))ə=true;if(Ϗ(ref Н,
  208. "panelColumnCountKeyword",ɠ))ɘ=true;Ϗ(ref М,"nameLengthKeyword",ɠ);Ϗ(ref Л,"amountLengthKeyword",ɠ);Ϗ(ref c,"backgroundColorKeyword",ɠ);if(Ϗ(ref
  209. ȝ,"nameColorKeyword",ɠ))ɗ=true;Ϗ(ref Ȟ,"amountColorKeyword",ɠ);Ϗ(ref Љ,"detailColorKeyword",ɠ);Ϗ(ref И,
  210. "scrollTickDelayKeyword",ɠ);if(Ϗ(ref g,"fontKeyword",ɠ))Z=ϒ(h,g);if(!DZ())yield return true;if(ɞ){List<string>Ж=new List<string>();bool Е=Ϗ(
  211. "detailedKeyword",ɠ),Д=false,Г=false,В=Ϗ("belowQuotaOnlyKeyword",ɠ),Б=false;int А;if(!Е){if(Ϗ("compactPercentKeyword",ɠ))Д=true;else if(Ϗ
  212. ("compactAmountKeyword",ɠ))Г=true;if(!ə)О=Ľ(e.Y,30f);}if(!ɘ&&(Д||Г))Н=Ľ(e.X,256f);if(!ə&&Е)О=Ľ(e.Y,90f);if(!Е&&!ɗ)ȝ=Љ;if(
  213. Ì.ƾ.š()>0)while(!ь(Ж,Ì.ƾ))yield return true;else{SortedList<string,Ǒ>Џ=new SortedList<string,Ǒ>();if(Ì.LJ)Џ=ʯ;else if(Ì.Ƴ)
  214. Џ=ʱ;else if(Ì.Ƶ)Џ=ʳ;else if(Ì.ƴ)Џ=ʲ;else if(Ì.Dž)Џ=ʰ;while(!ь(Ж,null,Џ))yield return true;}А=Ж.Count;Ǒ Þ;for(int E=0;E<Ж.
  215. Count;E+=0){if(!DZ())yield return true;if(õ(out Þ,Ж[E])&&(!Þ.ŷ||(В&&Þ.Ǐ>=Þ.Ƭ()))){Ж.RemoveAt(E);if(!Þ.ŷ)А--;}else E++;}List<Ƃ>
  216. Γ=new List<Ƃ>();for(int E=0;E<Ж.Count;E++){if(!DZ())yield return true;if(õ(out Þ,Ж[E])){Ƃ П=new Ƃ{Ģ=Ж[E]};if(ɝ||ɜ)П.J=Þ.Ǐ;
  217. else if(ɛ||ɚ)П.J=Þ.Ǐ/Þ.Ƭ();else П.g=Þ.ǐ;Γ.Add(П);}}if(ɝ||ɛ)Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();else if(ɜ||ɚ)Γ=Γ.OrderByDescending(ĥ
  218. =>ĥ.J).ToList();else Γ=Γ.OrderBy(ĥ=>ĥ.g).ToList();Ж.Clear();for(int E=0;E<Γ.Count;E++){if(E>0&&!DZ())yield return true;Ж.
  219. Add(Γ[E].Ģ);}if(ə&&О==0){int Ы,Ъ;Ы=Math.DivRem(Ж.Count,Н,out Ъ);if(Ъ>0)Ы++;О=Ы;}Ƞ=э(e.X/(float)Н,e.Y/(float)О);ȟ=Ƞ;Ƞ=э(Ƞ.X*
  220. 0.98f,Ƞ.Y*0.94f);for(int Щ=0;Щ<О&&Й<Ж.Count;Щ++){for(int Ш=0;Ш<Н&&Й<Ж.Count;Ш++){Ȣ=l+э((float)Ш*ȟ.X,(float)Щ*ȟ.Y)+э(ȟ.X*0.01f
  221. ,ȟ.Y*0.03f);if(К>=Ж.Count)К=0;if(õ(out Þ,Ж[К])){if(Þ.Ƭ()>0)ɐ=Þ.Ǐ/Þ.Ƭ();else ɐ=1;if(Е){ș=э(Ƞ.X,Ƞ.Y/3f);List<string>Ч=new
  222. List<string>();h.GetSprites(Ч);Б=Ч.Contains(Ж[К]);if(Б&&ȡ){ɡ=э(ș.Y*2f,ș.Y*2f);ɢ=э(ɡ.X,0f);Ð.Add(new MySprite(SpriteType.
  223. TEXTURE,"SquareSimple",Ȣ+э(0f,ɡ.Y*0.5f),ɡ,Color.Gray,null,κ));Ð.Add(new MySprite(SpriteType.TEXTURE,Ж[К],Ȣ+э(0f,ɡ.Y*0.5f),ɡ,
  224. null,null,κ));}ț=ș-ɢ;Ț=э(ț.X*((float)М/((float)М+(float)Л)),ț.Y);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.Add(p(h,g,Ȣ+ɢ,Ț,ȝ,Z));else ɟ.
  225. Append(g);Ș=э(Ț.X,0f);Ț=э(ț.X*((float)Л/((float)М+(float)Л)),ț.Y);g=ð(Þ.Ǐ).PadLeft(Л);if(ȡ)Ð.Add(p(h,g,Ȣ+Ș+ɢ,Ț,Ȟ,Z));else ɟ.
  226. Append($" {g}");ȗ=э(0f,ș.Y);Ț=э(ț.X*0.45f,ț.Y);g=$"Quota: {ð(Þ.Ƭ()).PadRight(Л)}";if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ+ɢ,Ț,Љ,Z));else ɟ.
  227. AppendLine($" {g}");Ș=э(Ț.X,0f);Ț=э(ț.X*0.55f,ț.Y);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș+ȗ+ɢ,Ț,ɐ,false,h,Z));ț=ș;ȗ=э(0f,ș.Y*2f);Ț=э(ș.X*(22f/31f),
  228. ș.Y);Ș=э(Ț.X,0f);if(Þ.ǎ>0)g=$"Assembling: {ð(Þ.ǎ).PadRight(Л)}";else if(Þ.Ǎ>0)g=$"Disassembling: {ð(Þ.Ǎ).PadRight(Л)}";
  229. else if(ǟ(Þ.ª)){if(Þ.Ƙ)g="Enabled";else g="Disabled";}else g="";if(g.Length>0){if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ,Ț,Љ,Z));else ɟ.Append(
  230. $" {g}");}Ț=э(ș.X*(9f/31f),ș.Y);if(Þ.lj>=0)g="+";else g="";g+=$"{ð(Þ.lj)}/s";if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ+Ș,Ț,Љ,Z));else ɟ.AppendLine(
  231. $" {g}");}else if(Г){ț=э(Ƞ.X,Ƞ.Y*0.999f);Ț=э(ț.X*((float)М/((float)М+(float)Л)),ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.
  232. Add(p(h,g,Ȣ,Ț,ȝ,Z));else ɟ.Append(g);Ț=э(ț.X*((float)Л/((float)М+(float)Л)),ț.Y);g=ð(Þ.Ǐ).PadLeft(Л);if(ȡ)Ð.Add(p(h,g,Ȣ+Ș,Ț
  233. ,Ȟ,Z));else ɟ.AppendLine($" {g}");}else if(Д){ț=э(Ƞ.X*0.3f,Ƞ.Y*0.999f);Ț=э(Ƞ.X*0.7f,ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(
  234. М);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,ȝ,Z));else ɟ.AppendLine(g);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș,ț,ɐ,false,h,Z));}else{ț=э(Ƞ.X*0.75f,Ƞ.Y*0.999f);
  235. Ț=э(ț.X*((float)М/((float)М+(((float)Л*2f)+1f))),ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,ȝ,Z));else
  236. ɟ.Append(g);Ț=э(ț.X*((((float)Л*2f)+1f)/((float)М+(((float)Л*2f)+1f))),ț.Y);g=
  237. $"{ð(Þ.Ǐ).PadLeft(Л)}/{ð(Þ.Ƭ()).PadRight(Л)}";if(ȡ)Ð.Add(p(h,g,Ȣ+Ș,Ț,Ȟ,Z));else ɟ.AppendLine($" {g}");Ș=э(ț.X,0f);ț=э(Ƞ.X*0.25f,Ƞ.Y*0.999f);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș,ț,ɐ
  238. ,false,h,Z));}}К++;Й++;}}if(Й<Ж.Count&&И>=0){if(ʣ[Ģ]>=И){ʣ[Ģ]=0;К=ʋ[Ģ];for(int E=0;E<Н;E++){if(К>=Ж.Count)К=0;К++;}ʋ[Ģ]=К
  239. ;}}else{ʣ[Ģ]=0;ʋ[Ģ]=0;}if(В&&Ж.Count==0){if(ȡ)Ð.AddRange(j(h,$"All {А} Items Meet Set Quotas",l,Ƞ,Љ,c,Z));else ɟ.
  240. AppendLine($"All {А} Items Meet Set Quotas");}}else if(Ǜ){bool Ц=Ϗ("totalCapacityKeyword",ɠ);if(!ɗ)ȝ=Љ;if(Ì.ǘ){З=10;ȟ=э(e.X,e.Y/5f
  241. );}else ȟ=э(e.X,e.Y/5f);if(Ц)ȟ=e;Ƞ=э(ȟ.X*0.98f,ȟ.Y*0.94f);Ȣ=l+э(ȟ.X*0.01f,ȟ.Y*0.03f);ț=э(Ƞ.X*0.7f,Ƞ.Y);Ț=э(ț.X*((float)З/
  242. ((float)З+(float)Л)),Ƞ.Y);ș=э(ț.X*((float)Л/((float)З+(float)Л)),Ƞ.Y);Ș=э(ț.X,0f);ȗ=э(Ț.X,0f);ț=э(Ƞ.X*0.3f,Ƞ.Y);if(Ц){g=
  243. "Total";if(!Ì.ǘ)g+=" Capacity";if(!Ω){while(!є(ref Ȝ,ˎ))yield return true;Ν=Ȝ;}else Ȝ=Ν;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,
  244. Ȝ,h,g,ț,Ț,ș,Ș,ȗ));}else{g="Ammo";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ː))yield return true;Μ=Ȝ;}else Ȝ=Μ;Ð.
  245. AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Component";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˠ))yield
  246. return true;Λ=Ȝ;}else Ȝ=Λ;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Ingot";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){
  247. while(!є(ref Ȝ,ˢ))yield return true;Κ=Ȝ;}else Ȝ=Κ;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Ore";if(!Ì.ǘ)g
  248. +=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˡ))yield return true;Ι=Ȝ;}else Ȝ=Ι;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,
  249. Ș,ȗ));g="Tool";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˑ))yield return true;ί=Ȝ;}else Ȝ=ί;Ψ=true;Ð.AddRange(ȣ(ref ɟ,
  250. ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));}}else if(ǚ){if(Ì.ǘ||Ì.ǖ){Н=1;О=5;}else{Н=2;О=15;}Ƞ=э(e.X/(float)Н,e.Y/(float)О);ȟ=Ƞ;
  251. Ƞ=э(ȟ.X*0.8f,ȟ.Y);Ȣ=l;if(Н==2){ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,"NDS Inventory Manager 5",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,ʠ,Ƞ,Љ
  252. ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Managed Blocks: {ʫ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
  253. $"Runtime: {Ǫ(Σ,4).ToString().PadRight(6)}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Assemblers: {Ͱ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"H2/O2 Gens: {ˣ.Count}"
  254. ,Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Storages: {ˎ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Weapons: {ˤ.Count}",Ƞ,Љ,c
  255. ,Z,М);if(!DZ())yield return true;ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Refineries: {ˮ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
  256. $"Reactors: {ˬ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Hydrogen Tanks: {ˌ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
  257. $"Oxygen Tanks: {ˋ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Mod Items: {ʘ}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Mod Blueprints: {ʗ}",Ƞ,Љ,c,Z,
  258. М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Errors: {ʖ}",Ƞ,Љ,c,Z,М);Ȣ=l+э(Ƞ.X,0f);}Ƞ=э(ȟ.X*1.2f,ȟ.Y);int ȅ=ʶ["outputLimit"];for(int E=0;
  259. E<ʽ.Count;E++){if(!DZ())yield return true;g=ʽ[E].ƃ();if(g.StartsWith("Error"))Ϝ=Color.Red;else Ϝ=Љ;if(ȡ&&E<О){Ð.AddRange(j
  260. (h,g,Ȣ,Ƞ,Ϝ,c,Z,ι));Ȣ+=э(0f,Ƞ.Y);}if(!ȡ)ɟ.AppendLine(g);}}else if(Ǘ){Ƞ=э(e.X/2f,e.Y/5f);Ȣ=l;if(ȡ)Ð.Add(new MySprite(
  261. SpriteType.TEXTURE,"SquareTapered",Ȣ+(Ƞ/2f),Ƞ,c));while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,Ͱ,"Assemblers","Active","Idle",h,ȝ,Љ,c,Z,Ð))yield return
  262. true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˮ,"Refineries","Active","Idle",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(
  263. Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˣ,"H2/O2 Gens","Filled","Empty",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˬ,
  264. "Reactors","Filled","Empty",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˤ,"Weapons","Filled","Empty",h,ȝ,Љ,c
  265. ,Z,Ð))yield return true;Ǒ Þ;List<Ƃ>Х=new List<Ƃ>();foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;Þ=õ(Ħ.
  266. Value.ª+"/"+Ħ.Value.ß);if(Þ!=null){if(Þ.ǎ>0)Х.Add(new Ƃ{g=$"Assembling {ð(Þ.ǎ)} {î(Þ.ǐ,12)}",J=Þ.ǎ});if(Þ.Ǎ>0)Х.Add(new Ƃ{g=
  267. $"Disassembling {ð(Þ.Ǎ)} {î(Þ.ǐ,12)}",J=Þ.Ǎ});}}Х=Х.OrderBy(ĥ=>ĥ.J).ToList();if(Х.Count==0)Х.Add(new Ƃ{g="Nothing Queued"});Ȣ=l+э(Ƞ.X,0f);ț=э(Ƞ.X,e.Y/15f);
  268. for(int E=0;E<15&&E<Х.Count;E++){if(!DZ())yield return true;if(К>=Х.Count)К=0;if(ȡ)Ð.AddRange(j(h,Х[К].g,Ȣ,ț,Љ,c,Z,ι));else
  269. ɟ.AppendLine(Х[К].g);Ȣ+=э(0f,ț.Y);К++;}if(Х.Count>15){if(ʣ[Ģ]>=И){ʣ[Ģ]=0;К=ʋ[Ģ];К++;if(К>=Х.Count)К=0;ʋ[Ģ]=К;}}else{ʣ[Ģ]=
  270. 0;ʋ[Ģ]=0;}}if(!DZ())yield return true;bool Ф=false;if(Ξ>0.0){if(!ʉ.ContainsKey(Ģ))ʉ[Ģ]=TimeSpan.FromSeconds(Ξ);else if(ʉ[Ģ
  271. ].TotalSeconds<=0.0)Ф=true;if(Ф)ʉ[Ģ]=TimeSpan.FromSeconds(Ξ);}MySpriteDrawFrame У=h.DrawFrame();if(Ф){for(int E=0;E<Ð.
  272. Count;E++){if(!DZ())yield return true;MySprite Т=new MySprite{Alignment=Ð[E].Alignment,Color=Ѕ((Color)Ð[E].Color),Data=Ð[E].
  273. Data,FontId=Ð[E].FontId,Position=Ð[E].Position,Size=Ð[E].Size,Type=Ð[E].Type};Ð.RemoveAt(E);Ð.Insert(E,Т);}Ð.Insert(0,new
  274. MySprite());}if(ȡ)У.AddRange(Ð);У.Dispose();if(!ȡ){string С=ɟ.ToString().Trim();string[]Р=С.Split(new[]{"\r\n","\r","\n"},
  275. StringSplitOptions.RemoveEmptyEntries);Vector2 m=new Vector2(0,0),Ѝ=new Vector2(0,0);Vector2 Ј=h.SurfaceSize;Ѓ(ref Ј,Ì.B);for(int E=0;E<Р.
  276. Length;E++){if(!DZ())yield return true;Ѝ=Me.GetSurface(1).MeasureStringInPixels(new StringBuilder(Р[E]),h.Font,1f);m=new
  277. Vector2(Math.Max(Ѝ.X,m.X),Ѝ.Y*(float)Р.Length);}float І=((100f-h.TextPadding)/100f);float k=Math.Min((Ј.X*І)/m.X,(Ј.Y*І)/m.Y);
  278. if(k<0.1)k=0.1f;else if(k>10.0)k=10f;h.FontSize=k;h.WriteText(С);}yield return false;}Color Ѕ(Color o){Vector4 Є=o.
  279. ToVector4();if(Є.X>125)Є.X-=1;else Є.X+=1;if(Є.Y>125)Є.Y-=1;else Є.Y+=1;if(Є.Z>125)Є.Z-=1;else Є.Z+=1;return new Color(Є);}void Ѓ
  280. (ref Vector2 e,IMyTerminalBlock B){try{string é=B.BlockDefinition.ToString(),Ї;Ї=é.ToLower();if(Ї.Contains(
  281. "blockcorner_lcd_")){if(Ї.Contains("small")){if(Ї.Contains("flat"))e.Y*=0.31f;else e.Y*=0.26f;}else{if(Ї.Contains("flat"))e.Y*=0.170745F;
  282. else e.Y*=0.147193F;}}}catch{}}bool Ђ(string Į,StringBuilder Ć,bool ȡ,Vector2 e,Vector2 f,List<int>Ī,string Ё,string Ѐ,
  283. string Ͽ,IMyTextSurface h,Color ȝ,Color Љ,Color c,string Z,List<MySprite>Ð){if(!μ.ContainsKey(Į)){Ȋ(Ќ(Ć,ȡ,e,f,Ī,Ё,Ѐ,Ͽ,h,ȝ,Љ,c,
  284. Z,Ð),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ќ(StringBuilder Ć,bool ȡ,Vector2 e,Vector2 f,List<int>Ī,
  285. string Ё,string Ѐ,string Ͽ,IMyTextSurface h,Color ȝ,Color Љ,Color c,string Z,List<MySprite>Ð){Vector2 ț=э(e.X,e.Y/3f),Ț,Ȣ=f;Ț=
  286. э(ț.X/2f,ț.Y);int Ћ=0,Ў=0,Њ,Ь=0;string g;for(int E=0;E<Ī.Count;E++){if(!DZ())yield return true;Њ=Í(ʫ[Ī[E]]);switch(Њ){case
  287. -1:Ь++;break;case 0:Ћ++;break;case 1:Ў++;break;}}if(ȡ)Ð.Add(new MySprite(SpriteType.TEXTURE,"SquareTapered",Ȣ+(e/2f),e,c)
  288. );g=Ё;if(ȡ)Ð.Add(p(h,g.PadRight(10),Ȣ,ț,ȝ,Z,ι));else Ć.Append(g.PadRight(10));Ȣ+=э(0f,Ț.Y);g=$"{Ѐ}: {Ў}".PadRight(11);if(
  289. ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.Append(g);Ȣ+=э(Ț.X,0f);g=$"{Ͽ}: {Ћ}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.
  290. Append(g);Ȣ+=э(-Ț.X,Ț.Y);g=$"Enabled {Ў+Ћ}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.Append(g);Ȣ+=э(Ț.X,0f);g=
  291. $"Disabled {Ь}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.AppendLine(g);yield return false;}void ю(ref StringBuilder Ć,ref List<
  292. MySprite>Ð,ref Vector2 Ȣ,bool ȡ,IMyTextSurface h,string g,Vector2 e,Color Љ,Color c,string Z,int М){Ȣ+=э(0f,e.Y);if(ȡ)Ð.AddRange
  293. (j(h,g.PadRight(М),Ȣ,e,Љ,c,Z));else Ć.AppendLine(g);}Vector2 э(float ĥ,float D){return new Vector2(ĥ,D);}bool ь(List<
  294. string>Ж,ű Ã=null,SortedList<string,Ǒ>ы=null){if(!μ.ContainsKey(Χ[52])){Ȋ(ъ(Ж,Ã,ы),Χ[52]);if(!DZ())return false;}return ǯ(Χ[52]
  295. );}IEnumerator<bool>ъ(List<string>Ж,ű Ã,SortedList<string,Ǒ>ы){if(Ã!=null){int ȳ=Ã.š();for(int E=0;E<ȳ;E++){if(E>0&&!DZ())
  296. yield return true;Ж.Add(Ã.ţ(E));}}if(ы!=null){for(int E=0;E<ы.Count;E++){if(E>0&&!DZ())yield return true;Ж.Add(ы.Values[E].ƕ()
  297. );}}yield return false;}void ї(){if(!μ.ContainsKey(Χ[2])){Ȋ(і(),Χ[2]);if(!DZ())return;}ǯ(Χ[2]);}IEnumerator<bool>і(){ǂ Ì;
  298. List<ǂ>ѕ=new List<ǂ>(ʪ);Ξ=ʸ["multiplayerPanelFixDelay"];Ω=false;Ψ=false;for(int E=0;E<ѕ.Count;E++){if(E>0&&!DZ())yield return
  299. true;Ì=ѕ[E];while(!ɒ(Ì)){do{yield return true;}while(Ϋ);}}yield return false;}bool є(ref double Ȭ,List<int>Ī){if(!μ.
  300. ContainsKey(Χ[6])){Ȋ(ѓ(Ī),Χ[6]);if(!DZ())return false;}bool Ş=ǯ(Χ[6]);if(Ş)Ȭ=Π;return Ş;}IEnumerator<bool>ѓ(List<int>Ī){double ђ=0,Ž
  301. =0;IMyInventory ı;for(int E=0;E<Ī.Count;E++){if(E>0&&!DZ())yield return true;if(ø(Ī[E])){try{ı=ʫ[Ī[E]].B.GetInventory(0);ђ
  302. +=(double)ı.MaxVolume;Ž+=(double)ı.CurrentVolume;}catch{}}}Π=Ž/ђ;yield return false;}string ё(string Ģ){return ʹ[Ģ].
  303. Replace(" ","").ToLower();}bool ѐ(string Ģ){return ʷ[Ģ];}int я(string Ģ){return ʶ[Ģ];}double щ(string Ģ){return ʸ[Ģ];}bool к(
  304. string Į){if(!μ.ContainsKey(Į)){Ȋ(й(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>й(){IMyTerminalBlock B;string и=ё
  305. ("manualKeyword"),з,ж,q,r,X,A,е,д,г,в;ж=ё("storageKeyword");if(!DZ())yield return true;X=ё("outputPanelKeyword");A=ё(
  306. "storageKeyword");д=ё("statusPanelKeyword");з=$"{ж} {ɸ} {ɷ} {ɶ} {ɵ} {ɿ}";bool б=ʷ["autoKeyCargoContainers"],а,Я=false;int ö;if(!DZ())
  307. yield return true;List<long>Ю=new List<long>();List<MyInventoryItem>Э=new List<MyInventoryItem>();ű л=Ñ();bool н;for(int E=0;
  308. E<ʭ.Count;E++){if(E>0&&!DZ())yield return true;B=ʭ[E];if(!(B is IMyProgrammableBlock))н=Dz(B);else н=false;ǂ ȃ=new ǂ{B=B,ǀ=
  309. Ñ(),ƿ=Ñ(),Ĥ=Ñ(),ƾ=Ñ(),ƽ=Ñ(),ǘ=B is IMyCockpit||B is IMyProgrammableBlock};if(!DZ(0.5))yield return true;q=B.CustomData.
  310. ToLower();г=р(q,out в);if(!DZ())yield return true;r=B.CustomName.Replace(" ","").ToLower();if(!н&&B.InventoryCount>0){ö=ʫ.Count;
  311. а=г.Contains(ж)||B is IMyCargoContainer;ż(B);if(!DZ())yield return true;if(!q.Contains(и)){if(Ȅ(B)){ȃ.ƶ=true;ˏ.Add(ö);}
  312. else if(B is IMyAssembler){Ͱ.Add(ö);ȃ.ǁ=new Ƈ{Ɔ=((IMyAssembler)B).CurrentProgress,Ą=((IMyAssembler)B).Mode};}else if(B is
  313. IMyRefinery){string Ů=B.BlockDefinition.SubtypeId;if(Ů!="DeuteriumProcessor"&&!Ů.EndsWith("PowerTransmitter")&&!Ů.EndsWith(
  314. "PowerConverter"))ˮ.Add(ö);}else if(B is IMyReactor)ˬ.Add(ö);else if(B is IMyUserControllableGun)ˤ.Add(ö);else if(B is IMyGasGenerator){
  315. ˣ.Add(ö);((IMyGasGenerator)B).AutoRefill=true;}else if(B is IMyParachute)ˍ.Add(ö);else if(B is IMyGasTank){if(B.
  316. BlockDefinition.SubtypeName.ToLower().Contains("hydrogen"))ˌ.Add(ö);else ˋ.Add(ö);((IMyGasTank)B).AutoRefillBottles=true;}}if(а){if(б&&
  317. (q.Length==0||q==ж)){B.CustomData=з;q=B.CustomData.ToLower();г=q;}if(г.Contains(ɸ)){ȃ.ƺ=true;Я=true;ˢ.Add(ö);}if(г.
  318. Contains(ɷ)){ȃ.ƹ=true;Я=true;ˡ.Add(ö);}if(г.Contains(ɶ)){ȃ.Ʒ=true;Я=true;ˠ.Add(ö);}if(г.Contains(ɵ)){ȃ.Ƹ=true;Я=true;ˑ.Add(ö);}
  319. if(г.Contains(ɿ)){ȃ.ƻ=true;Я=true;ː.Add(ö);}if(Я){ˎ.Add(ö);ȃ.Ǖ=ý(B);}Я=false;}if(!DZ())yield return true;while(!É(ȃ.ƿ,q,'{'
  320. ,'}'))yield return true;while(!É(ȃ.ǀ,q))yield return true;if(B is IMyUserControllableGun&&!ȱ(ȃ.ƿ)){е=B.BlockDefinition.
  321. ToString();if(!ʧ.ContainsKey(е)){if(B.GetInventory(0).ItemCount>0){Э.Clear();B.GetInventory(0).GetItems(Э);ʧ[е]=Э[0].Type.
  322. SubtypeId;}}if(ʧ.ContainsKey(е))ȃ.ƿ.V[ʧ[е]]=ʶ["ammoPerGun"];}if(B is IMyParachute&&!ȱ(ȃ.ƿ))ȃ.ƿ.Ũ["Canvas"]=ʶ["canvasPerParachute"
  323. ];if(!DZ(0.5))yield return true;л.Ţ(ȃ.ƿ);ʫ.Add(ȃ);}if(B.InventoryCount==0||B is IMyCockpit||B is IMyProgrammableBlock){if(
  324. B is IMyCockpit||B is IMyProgrammableBlock){int ш=((IMyTextSurfaceProvider)B).SurfaceCount;IMyTextSurface h;StringBuilder
  325. Ć=new StringBuilder();for(int ч=0;ч<ш;ч++){if(ч>0&&!DZ())yield return true;h=((IMyTextSurfaceProvider)B).GetSurface(ч);
  326. string ц=h.GetText().ToLower();if(!ц.Contains("<panel>")){string х=$"[panel:{ч}";if(q.Contains(х)){ц=q.Substring(q.IndexOf(х)+
  327. х.Length);if(ц.Contains("]"))ц=$"{ц.Substring(0,ц.IndexOf("]"))}";}}else{Ć.AppendLine($"[panel:{ч} {ц}]");}if(ц.Contains(
  328. "<panel>")){ǂ ф=new ǂ{B=B,ǘ=B is IMyCockpit||B is IMyProgrammableBlock,ǀ=Ñ(),ƿ=Ñ(),Ĥ=Ñ(),ƾ=Ñ(),ƽ=Ñ(),ǔ=ч,LJ=ц.Contains(ɿ),Ƶ=ц.
  329. Contains(ɸ),ƴ=ц.Contains(ɷ),Dž=ц.Contains(ɵ),Ƴ=ц.Contains(ɶ),ǚ=ц.Contains(X),Ǜ=ц.Contains(A),Ǘ=ц.Contains(д)};if(!DZ())yield
  330. return true;while(!É(ф.ƾ,ц,'[',']','|',false))yield return true;if(ф.ǚ||ф.Ǜ||ф.LJ||ф.Ƶ||ф.ƴ||ф.Dž||ф.Ƴ||ф.Ǘ||ф.ƾ.š()>0){Ϙ(ф);Ю.
  331. Add(ф.B.EntityId);ʪ.Add(ф);}}}if(Ć.Length>0&&Ξ>0.0)B.CustomData=Ć.ToString();}else if(B is IMyTextPanel){ȃ.LJ=r.Contains(ɿ);
  332. ȃ.Ƶ=r.Contains(ɸ);ȃ.ƴ=r.Contains(ɷ);ȃ.Dž=r.Contains(ɵ);ȃ.Ƴ=r.Contains(ɶ);ȃ.ǚ=r.Contains(X);ȃ.Ǜ=r.Contains(A);ȃ.Ǘ=r.
  333. Contains(д);ȃ.ǖ=B.BlockDefinition.ToString().ToLower().Contains("corner_lcd");if(!DZ())yield return true;while(!É(ȃ.ƾ,q,'[',']',
  334. '|',false))yield return true;if(ȃ.ǚ||ȃ.Ǜ||ȃ.LJ||ȃ.Ƶ||ȃ.ƴ||ȃ.Dž||ȃ.Ƴ||ȃ.Ǘ||ȃ.ƾ.š()>0){Ϙ(ȃ);Ю.Add(ȃ.B.EntityId);ʪ.Add(ȃ);}}else
  335. if(B is IMyTimerBlock){while(!ɋ(ȃ))yield return true;ʩ.Add(ȃ);}}if(!DZ())yield return true;}ʭ.Clear();if(ː.Count>0)while(!ϖ
  336. (ː))yield return true;if(ˠ.Count>0)while(!ϖ(ˠ))yield return true;if(ˢ.Count>0)while(!ϖ(ˢ))yield return true;if(ˡ.Count>0)
  337. while(!ϖ(ˡ))yield return true;if(ˑ.Count>0)while(!ϖ(ˑ))yield return true;while(!ϔ(ʯ,л))yield return true;while(!ϔ(ʱ,л))yield
  338. return true;while(!ϔ(ʳ,л))yield return true;while(!ϔ(ʲ,л))yield return true;while(!ϔ(ʰ,л))yield return true;long Ģ;for(int E=0
  339. ;E<ʣ.Count;E++){if(!DZ())yield return true;Ģ=ʣ.Keys[E];if(!Ю.Contains(Ģ)){try{if(ʣ.ContainsKey(Ģ))ʣ.Remove(Ģ);if(ʋ.
  340. ContainsKey(Ģ))ʋ.Remove(Ģ);}catch{}}}}bool у(ǂ Ì,ref double т,MyInventoryItem Ö){bool с=false;double ğ=Ì.ǀ.ŭ(ref с,Ö);if(!с)ğ=Ì.ƿ.ŭ
  341. (ref с,Ö);if(с){т=ğ;return true;}return false;}string р(string g,out string в){string v=g,п="",о="{",м="}";в="";int Ͼ,ϥ;
  342. for(int E=1;E<=2;E++){Ͼ=v.IndexOf(о);ϥ=v.IndexOf(м);while(Ͼ!=-1&&ϥ!=-1&&ϥ>Ͼ){if(Ͼ>0)п+=v.Substring(0,Ͼ);в+=v.Substring(0,ϥ+
  343. 1);v=v.Substring(ϥ+1);Ͼ=v.IndexOf("{");ϥ=v.IndexOf("}");}п+=v;if(о=="{"){v=п;п="";о="[";м="]";}}return п;}string ϒ(
  344. IMyTextSurface h,string ϑ){List<string>ϐ=new List<string>();h.GetFonts(ϐ);for(int E=0;E<ϐ.Count;E++){if(ɣ(ϑ,ϐ[E]))return ϐ[E];}return
  345. "Monospace";}bool Ϗ(string Ģ,string ɠ){return ɠ.Contains(ё(Ģ));}bool Ϗ(ref string g,string Ģ,string ɠ){try{string ώ=ё(Ģ),ȿ;if(ɠ.
  346. Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.Substring(0,ȿ.IndexOf(">"));g=ȿ;return ȿ.Length>0;}}catch{}return false;}
  347. bool Ϗ(ref int ï,string Ģ,string ɠ){try{string ώ=ё(Ģ),ȿ;int ϓ;if(ɠ.Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.
  348. Substring(0,ȿ.IndexOf(">"));if(int.TryParse(ȿ,out ϓ)){ï=ϓ;return true;}}}catch{}return false;}bool Ϗ(ref Color o,string Ģ,string
  349. ɠ){try{string ώ=ё(Ģ),ȿ;Color Ϝ;if(ɠ.Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.Substring(0,ȿ.IndexOf(">"));if(
  350. ϛ(out Ϝ,ȿ)){o=new Color(Ϝ.ToVector4());return true;}}}catch{}return false;}bool ϛ(out Color o,string Ϛ){o=Color.White;try
  351. {string[]ϙ=Ϛ.Split(':');if(ϙ.Length==4)o=new Color(int.Parse(ϙ[0]),int.Parse(ϙ[1]),int.Parse(ϙ[2]),int.Parse(ϙ[3]));else
  352. if(ϙ.Length==3)o=new Color(int.Parse(ϙ[0]),int.Parse(ϙ[1]),int.Parse(ϙ[2]));else return false;return true;}catch{}return
  353. false;}void Ϙ(ǂ ȃ){string ϗ=ȃ.B.EntityId.ToString();if(ȃ.ǘ)ϗ+=$":{ȃ.ǔ}";else ϗ+=$":0";if(!ʼ.Contains(ϗ)){ʼ.Add(ϗ);
  354. IMyTextSurface h=ȃ.ǒ();if(ʷ["setPanelsToSprite"]){if(h.ContentType!=ContentType.SCRIPT)h.ContentType=ContentType.SCRIPT;if(h.Script!=
  355. "None")h.Script="None";h.ScriptBackgroundColor=h.ScriptBackgroundColor;h.ScriptForegroundColor=h.ScriptForegroundColor;}}}bool
  356. ϖ(List<int>Ī){if(!μ.ContainsKey(Χ[37])){Ȋ(ϕ(Ī),Χ[37]);if(!DZ())return false;}return ǯ(Χ[37]);}IEnumerator<bool>ϕ(List<int>
  357. Ī){List<Ƃ>Γ=new List<Ƃ>();for(int E=0;E<Ī.Count;E++){if(!DZ())yield return true;try{Γ.Add(new Ƃ{J=ʫ[Ī[E]].Ǖ,Ɓ=Ī[E]});}
  358. catch{}}Ī.Clear();Γ=Γ.OrderByDescending(ĥ=>ĥ.J).ToList();for(int E=0;E<Γ.Count;E++){if(!DZ())yield return true;Ī.Add(Γ[E].Ɓ);}
  359. yield return false;}bool ϔ(SortedList<string,Ǒ>ō,ű Ã){if(!μ.ContainsKey(Χ[29])){Ȋ(ρ(ō,Ã),Χ[29]);if(!DZ())return false;}return
  360. ǯ(Χ[29]);}IEnumerator<bool>ρ(SortedList<string,Ǒ>ō,ű Ã){for(int E=0;E<ō.Count;E++){if(E>0&&!DZ())yield return true;ō.
  361. Values[E].Lj=Ã.ŭ(ō.Values[E].ª,ō.Values[E].ß);}yield return false;}bool π(){if(!μ.ContainsKey(Χ[30])){Ȋ(ο(),Χ[30]);if(!DZ())
  362. return false;}return ǯ(Χ[30]);}IEnumerator<bool>ο(){StringBuilder Ć=new StringBuilder(),ξ=new StringBuilder();string Y=
  363. "//////////",w=@"\\\\\\\\\\",ν="",Ů;ƀ ë;Ć.AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Components {w}");Ć.AppendLine(
  364. $"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʱ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʱ.Values[E]);if(ʨ.TryGetValue(ʱ.Values[E].
  365. á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.
  366. AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Ingots {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʳ.Count;E
  367. ++){if(!DZ())yield return true;Ĉ(ref Ć,ʳ.Values[E]);if(ʨ.TryGetValue(ʳ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,
  368. '{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine(
  369. $"{Y} Ammos {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʯ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʯ.Values[E]
  370. );if(ʨ.TryGetValue(ʯ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append(
  371. $"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Tools {w}");Ć.AppendLine($"{w} {Y}");Ć.
  372. AppendLine();for(int E=0;E<ʰ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʰ.Values[E]);if(ʨ.TryGetValue(ʰ.Values[E].á,out ë)&&ȱ(ë.
  373. ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine(
  374. $"{Y} {w}");Ć.AppendLine($"{Y} Ores {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʲ.Count;E++){if(!DZ())yield
  375. return true;Ĉ(ref Ć,ʲ.Values[E]);if(ʨ.TryGetValue(ʲ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield
  376. return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine(
  377. $"{Y} Item Groups {w}");Ć.AppendLine($"{w} {Y}");foreach(KeyValuePair<string,ű>Ħ in ʴ){if(!DZ())yield return true;Ć.Append(
  378. $"group={Ħ.Key}=");while(!ł(ref ν,Ħ.Value,'[',']',false,0))yield return true;Ć.AppendLine(ν);}Ć.AppendLine();Ć.AppendLine(
  379. $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Switches {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(
  380. KeyValuePair<string,bool>Ħ in ʷ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine(
  381. $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Numbers {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(
  382. KeyValuePair<string,double>Ħ in ʸ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}foreach(KeyValuePair<string,int>Ħ
  383. in ʶ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine($"{Y} {w}"
  384. );Ć.AppendLine($"{Y} Settings : Text {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(KeyValuePair<
  385. string,string>Ħ in ʹ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine(
  386. $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Lists {w}");Ć.AppendLine($"{w} {Y}");foreach(KeyValuePair<string,List<
  387. string>>Ħ in ʵ){if(!DZ())yield return true;Ć.Append($"{Ħ.Key}=[");for(int E=0;E<Ħ.Value.Count;E++){if(E>0){Ć.Append("|");if(!DZ(
  388. ))yield return true;}Ć.Append(Ħ.Value[E]);}Ć.AppendLine("]");Ć.AppendLine();}Ć.AppendLine();Ć.AppendLine();Ć.AppendLine(
  389. $"script={ɺ}");Ć.AppendLine($"version={Ρ}");Me.CustomData=Ć.ToString().Trim();Storage=Me.CustomData;ʌ=Me.CustomData;ΰ=true;ή=true;
  390. yield return false;}bool ό(){if(!μ.ContainsKey(Χ[42])){Ȋ(ϋ(),Χ[42]);if(!DZ())return false;}return ǯ(Χ[42]);}IEnumerator<bool>ϋ
  391. (){if(Me.CustomData.Length!=0&&Storage!=Me.CustomData)Storage=Me.CustomData;if(Storage.Length>0){ΰ=false;ή=false;string[]
  392. ϊ=Storage.Split(new[]{"\r\n","\r","\n"},StringSplitOptions.RemoveEmptyEntries);List<string>ω=new List<string>();for(int E
  393. =0;E<ϊ.Length;E++){if(!DZ())yield return true;if(ϊ[E].StartsWith("^")&&ω.Count>0)ω[ω.Count-1]+=
  394. $"||{ϊ[E].Substring(1).Trim()}";else ω.Add(ϊ[E].Trim());}for(int E=0;E<ω.Count;E++){if(!DZ())yield return true;while(!ɪ(ω[E]))yield return true;}if(!ή||
  395. !ΰ)ʒ=true;}else ʒ=true;if(!DZ())yield return true;θ();ʌ=Me.CustomData;yield return false;}bool ψ(string Į){if(!μ.
  396. ContainsKey(Į)){Ȋ(χ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>χ(){double τ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(
  397. !DZ())yield return true;τ=ÿ(Ħ.Value);if(τ>0)while(!σ(Ħ.Value,τ,Ͱ))yield return true;}yield return false;}bool φ(string Į){
  398. if(!μ.ContainsKey(Į)){Ȋ(υ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>υ(){double τ;foreach(KeyValuePair<
  399. string,ƀ>Ħ in ʨ){if(!DZ())yield return true;τ=ÿ(Ħ.Value,true);if(τ>0)while(!σ(Ħ.Value,τ,Ͱ,MyAssemblerMode.Disassembly))yield
  400. return true;}yield return false;}bool σ(ƀ ë,double J,List<int>ς,MyAssemblerMode Ą=MyAssemblerMode.Assembly,bool Ĩ=true){if(!μ.
  401. ContainsKey(Χ[26])){Ȋ(ύ(ë,J,ς,Ą,Ĩ),Χ[26]);if(!DZ())return false;}return ǯ(Χ[26]);}IEnumerator<bool>ύ(ƀ ë,double J,List<int>ς,
  402. MyAssemblerMode Ą,bool Ĩ){MyDefinitionId á=MyDefinitionId.Parse(Ā(ë));List<int>Ī=new List<int>();for(int E=0;E<ς.Count;E++){if(E>0&&!DZ(
  403. ))yield return true;if(ą(ʫ[ς[E]],á,Ą)){if(Ī.Count>0&&((IMyAssembler)ʫ[ς[E]].B).IsQueueEmpty)Ī.Insert(0,ς[E]);else Ī.Add(ς
  404. [E]);}}if(Ο>0&&Ą==MyAssemblerMode.Disassembly)Ī.RemoveRange(0,(int)Math.Min(Ο,Math.Ceiling((double)Ī.Count/2.0)));if(Ī.
  405. Count>0){int č,Ƨ,ϲ;č=Math.DivRem((int)J,Ī.Count,out Ƨ);for(int E=0;E<Ī.Count&&E<J;E++){ϲ=č;if(E<Ƨ)ϲ++;if(ϲ>0)while(!ϱ(á,ϲ,(
  406. IMyAssembler)ʫ[Ī[E]].B,Ą,Ĩ))yield return true;}}yield return false;}bool ϱ(MyDefinitionId á,double J,IMyAssembler ă,MyAssemblerMode
  407. Ą,bool Ĩ=true){if(!μ.ContainsKey(Χ[33])){Ȋ(ϰ(á,J,ă,Ą,Ĩ),Χ[33]);if(!DZ())return false;}return ǯ(Χ[33]);}IEnumerator<bool>ϰ(
  408. MyDefinitionId á,double J,IMyAssembler ă,MyAssemblerMode Ą,bool Ĩ){bool ϳ;ă.Mode=Ą;if(ă.Mode!=Ą)ă.Mode=Ą;if(ă.Mode==Ą){if(ă.
  409. IsQueueEmpty)ă.AddQueueItem(á,J);else{List<MyProductionItem>ķ=new List<MyProductionItem>();bool ϼ=false;double Ͻ=0,ϻ=0;if(Ą==
  410. MyAssemblerMode.Assembly)Ͻ=í(á);ă.GetQueue(ķ);ϳ=false;for(int E=0;!ϳ&&E<ķ.Count;E++){if(E>0&&!DZ())yield return true;if(ķ[E].BlueprintId
  411. .SubtypeName==á.SubtypeName)ϳ=true;}if(ϳ||Ą==MyAssemblerMode.Assembly)for(int E=0;E<ķ.Count;E++){if(E>0&&!DZ())yield
  412. return true;if(!ϳ&&Ą==MyAssemblerMode.Assembly)ϻ=í(ķ[E].BlueprintId);if((!ϳ&&Ͻ<=ϻ)||ķ[E].BlueprintId.SubtypeName==á.
  413. SubtypeName){ă.InsertQueueItem(E,á,J);ϼ=true;break;}}if(!ϼ)ă.AddQueueItem(á,J);}if(Ĩ)ȇ(á.SubtypeName,Ą==MyAssemblerMode.Assembly,J,
  414. true);}yield return false;}bool Ϻ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ϲ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<
  415. bool>Ϲ(){Ǒ Þ;double ϣ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;if(õ(out Þ,$"{Ħ.Value.ª}/{Ħ.Value.ß}")
  416. ){ϣ=Math.Floor(Þ.ƣ());if(ϣ>0)while(!ϸ(Ħ.Value,ϣ))yield return true;}}yield return false;}bool ϸ(ƀ ë,double J,
  417. MyAssemblerMode Ą=MyAssemblerMode.Assembly){if(!μ.ContainsKey(Χ[35])){Ȋ(Ϸ(ë,J,Ą),Χ[35]);if(!DZ())return false;}return ǯ(Χ[35]);}
  418. IEnumerator<bool>Ϸ(ƀ ë,double J,MyAssemblerMode Ą){double ϵ,ϴ=J;List<MyProductionItem>ķ=new List<MyProductionItem>();for(int E=0;E<
  419. Ͱ.Count&&ϴ>0;E++){IMyAssembler ă;try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch{continue;}if(!DZ())yield return true;if(ă.Mode==Ą&&!
  420. ă.IsQueueEmpty){ķ.Clear();ă.GetQueue(ķ);for(int ĥ=ķ.Count-1;ĥ>=0&&ϴ>0;ĥ--){if(!DZ())yield return true;if(ķ[ĥ].BlueprintId.
  421. SubtypeName==ë.á){ϵ=(double)ķ[ĥ].Amount;if(ϵ>ϴ)ϵ=ϴ;ă.RemoveQueueItem(ĥ,(MyFixedPoint)ϵ);ȇ(ë.á,Ą==MyAssemblerMode.Assembly,-ϵ,true);
  422. ϴ-=ϵ;}}}}yield return false;}bool ϯ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ϥ(),Į);if(!DZ())return false;}return ǯ(Į);}
  423. IEnumerator<bool>Ϥ(){Ǒ Þ;double ϣ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;if(õ(out Þ,
  424. $"{Ħ.Value.ª}/{Ħ.Value.ß}")){ϣ=Math.Floor(Þ.Ƣ());if(ϣ>0)while(!ϸ(Ħ.Value,ϣ,MyAssemblerMode.Disassembly))yield return true;}}yield return false;}
  425. bool Ϣ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϡ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ϡ(){if(ː.Count>1)while(!
  426. Ϡ(ː))yield return true;if(ˠ.Count>1)while(!Ϡ(ˠ))yield return true;if(ˢ.Count>1)while(!Ϡ(ˢ))yield return true;if(ˡ.Count>1
  427. )while(!Ϡ(ˡ))yield return true;if(ˑ.Count>1)while(!Ϡ(ˑ))yield return true;yield return false;}bool Ϡ(List<int>Ī){if(!μ.
  428. ContainsKey(Χ[39])){Ȋ(ϟ(Ī),Χ[39]);if(!DZ())return false;}return ǯ(Χ[39]);}IEnumerator<bool>ϟ(List<int>Ī){List<MyInventoryItem>ō=new
  429. List<MyInventoryItem>();ǂ Ì;for(int E=1;E<Ī.Count;E++){if(!DZ())yield return true;ō.Clear();try{Ì=ʫ[Ī[E]];}catch{continue;}Ì.
  430. B.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ì.ƿ.ŭ(ō[ĥ])<=0.0)while(!ŗ(ō[ĥ],Ī[E]
  431. ,0,false,E))yield return true;}}yield return false;}bool Ϟ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϝ(),Į);if(!DZ())return false;
  432. }return ǯ(Į);}IEnumerator<bool>ϝ(){List<Ƃ>Γ=new List<Ƃ>();List<MyProductionItem>ķ=new List<MyProductionItem>();
  433. IMyAssembler ă;MyAssemblerMode Ą;for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;ķ.Clear();try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch
  434. {continue;}if(!ă.IsQueueEmpty&&ă.Mode!=MyAssemblerMode.Disassembly){ă.GetQueue(ķ);if(ķ.Count>1){Ą=ă.Mode;Γ.Clear();for(
  435. int ĥ=0;ĥ<ķ.Count;ĥ++){if(!DZ())yield return true;Γ.Add(new Ƃ{J=í(ķ[ĥ].BlueprintId),Ɓ=(int)ķ[ĥ].Amount,Ģ=ķ[ĥ].BlueprintId.
  436. SubtypeName});}if(Ą==MyAssemblerMode.Assembly)Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();else Γ=Γ.OrderByDescending(ĥ=>ĥ.J).ToList();if(Γ[0].Ģ==ķ
  437. [0].BlueprintId.SubtypeName){Γ.RemoveAt(0);for(int ĥ=ķ.Count-1;ĥ>=1;ĥ--){if(!DZ())yield return true;ă.RemoveQueueItem(ĥ,ķ[
  438. ĥ].Amount);}}else if(ă.CurrentProgress>0){for(int ĥ=ķ.Count-1;ĥ>=0;ĥ--){if(!DZ())yield return true;if(ĥ!=0)ă.
  439. RemoveQueueItem(ĥ,ķ[ĥ].Amount);else if((double)ķ[ĥ].Amount>1)ă.RemoveQueueItem(ĥ,(MyFixedPoint)((double)ķ[ĥ].Amount-1));}}else ă.
  440. ClearQueue();for(int ĥ=0;ĥ<Γ.Count;ĥ++){if(!DZ())yield return true;while(!ϱ(MyDefinitionId.Parse($"{ɼ}/{Γ[ĥ].Ģ}"),Γ[ĥ].Ɓ,ă,Ą,false)
  441. )yield return true;}}}}yield return false;}bool Ϯ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϭ(),Į);if(!DZ())return false;}return ǯ
  442. (Į);}IEnumerator<bool>ϭ(){List<int>Ϭ=new List<int>(),ϫ=new List<int>();Dictionary<string,ƀ>Ϫ=new Dictionary<string,ƀ>(),ϩ
  443. =new Dictionary<string,ƀ>();List<MyProductionItem>ķ=new List<MyProductionItem>();string Ģ;IMyAssembler ă;bool Ϩ=false,ϧ,Ϧ
  444. ;double J;for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch{continue;}if(!ă.
  445. IsQueueEmpty)Ϩ=true;if(ă.Mode==MyAssemblerMode.Assembly||ă.IsQueueEmpty)Ϭ.Add(Ͱ[E]);else ϫ.Add(Ͱ[E]);}if(Ϩ&&(Ϭ.Count>1||ϫ.Count>1)){
  446. for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;ķ.Clear();try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;ă.GetQueue(ķ);ϧ=ă.Mode==
  447. MyAssemblerMode.Assembly;}catch{continue;}Ϧ=!ϧ&&E<Ο&&E<Math.Ceiling((double)Ͱ.Count/2.0);for(int ĥ=ķ.Count-1;ĥ>=0;ĥ--){if(!DZ())yield
  448. return true;J=(double)ķ[ĥ].Amount;if(ķ.Count>1&&ĥ==0&&J<=50&&!Ϧ)break;Ģ=ķ[ĥ].BlueprintId.SubtypeName;if(J>1||ĥ>0){if(!Ϧ){J=
  449. Math.Ceiling(J*0.9);if(J==(double)ķ[ĥ].Amount&&ĥ==0)J-=1;}if(J>0){if(ϧ){if(!Ϫ.ContainsKey(Ģ))Ϫ[Ģ]=new ƀ{J=J,á=Ģ};else Ϫ[Ģ].J
  450. +=J;}else{if(!ϩ.ContainsKey(Ģ))ϩ[Ģ]=new ƀ{J=J,á=Ģ};else ϩ[Ģ].J+=J;}ă.RemoveQueueItem(ĥ,J);}}}}foreach(KeyValuePair<string,
  451. ƀ>Ħ in Ϫ){if(!DZ())yield return true;while(!σ(Ħ.Value,Ħ.Value.J,Ϭ,MyAssemblerMode.Assembly,false))yield return true;}
  452. foreach(KeyValuePair<string,ƀ>Ħ in ϩ){if(!DZ())yield return true;while(!σ(Ħ.Value,Ħ.Value.J,ϫ,MyAssemblerMode.Disassembly,false)
  453. )yield return true;}}yield return false;}bool Ȯ(List<int>Ī,string Į){if(!μ.ContainsKey(Į)){Ȋ(ĭ(Ī),Į);if(!DZ())return false
  454. ;}return ǯ(Į);}IEnumerator<bool>ĭ(List<int>Ī){ű Ã=Ñ();while(!ĵ(Ã,Ī))yield return true;if(Ã.V.Count>0)while(!Ĭ(Ã.V,Ī,ʊ))
  455. yield return true;if(Ã.ŧ.Count>0)while(!Ĭ(Ã.ŧ,Ī,ʃ))yield return true;if(Ã.Ű.Count>0)while(!Ĭ(Ã.Ű,Ī,ʄ))yield return true;if(Ã.
  456. ũ.Count>0)while(!Ĭ(Ã.ũ,Ī,ʅ))yield return true;if(Ã.Ũ.Count>0)while(!Ĭ(Ã.Ũ,Ī,ʆ))yield return true;yield return false;}bool
  457. Ĭ(SortedList<string,double>Ã,List<int>Ī,string ĩ){if(!μ.ContainsKey(Χ[25])){Ȋ(ī(Ã,Ī,ĩ),Χ[25]);if(!DZ())return false;}
  458. return ǯ(Χ[25]);}IEnumerator<bool>ī(SortedList<string,double>Ã,List<int>Ī,string ĩ){double Ĩ;int ö=0;List<MyInventoryItem>Ë=
  459. new List<MyInventoryItem>();IMyTerminalBlock B,ħ;for(int E=0;E<Ī.Count;E++){foreach(KeyValuePair<string,double>Ħ in Ã){if(ö
  460. >0&&!DZ())yield return true;Ĩ=0;try{B=ʫ[Ī[E]].B;}catch{continue;}while(!ě(ref Ĩ,ĩ,Ħ.Key,B))yield return true;if(Õ(Ĩ,Ħ.
  461. Value/(double)Ī.Count,0.05)){Ë.Clear();B.GetInventory(0).GetItems(Ë);for(int ĥ=Ë.Count-1;ĥ>=0;ĥ--){if(!DZ())yield return true;
  462. if(!Ø(ĩ,Ë[ĥ])||Ë[ĥ].Type.SubtypeId!=Ħ.Key)Ë.RemoveAt(ĥ);}if(Ë.Count>0){double Ĥ=Ĩ-(Ħ.Value/(double)Ī.Count);SortedList<int
  463. ,double>đ=new SortedList<int,double>();for(int ĥ=0;ĥ<Ī.Count;ĥ++){if(E!=ĥ){if(!DZ())yield return true;Ĩ=0;try{ħ=ʫ[Ī[ĥ]].B;
  464. }catch{continue;}while(!ě(ref Ĩ,ĩ,Ħ.Key,ħ))yield return true;if(Ó(Ĩ,Ħ.Value/(double)Ī.Count,0.05))đ[Ī[ĥ]]=Ĩ;}}if(đ.Count>
  465. 0)while(!Ė(Ë[0],B,đ,Ĥ))yield return true;}}ö++;}}yield return false;}bool ĵ(ű Ĩ,List<int>ē,string ª="",string ß=""){if(!μ
  466. .ContainsKey(Χ[8])){Ȋ(Ĵ(Ĩ,ē,ª,ß),Χ[8]);if(!DZ())return false;}return ǯ(Χ[8]);}IEnumerator<bool>Ĵ(ű Ĩ,List<int>ē,string ª,
  467. string ß){List<MyInventoryItem>Ë=new List<MyInventoryItem>();for(int E=0;E<ē.Count;E++){if(E>0&&!DZ())yield return true;Ë.Clear
  468. ();try{ʫ[ē[E]].B.GetInventory(0).GetItems(Ë);}catch{continue;}for(int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if((ª.
  469. Length==0||Ë[ĥ].Type.TypeId==ª)&&(ß.Length==0||Ë[ĥ].Type.SubtypeId==ß))Ĩ.ū(Ë[ĥ]);}}yield return false;}bool ij(string Į){if(!μ.
  470. ContainsKey(Į)){Ȋ(IJ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>IJ(){string ß;SortedList<int,double>đ;List<
  471. MyInventoryItem>Ë=new List<MyInventoryItem>();for(int E=0;E<ˎ.Count;E++){if(E>0&&!DZ())yield return true;ǂ B;try{B=ʫ[ˎ[E]];}catch{
  472. continue;}IMyInventory ı=B.B.GetInventory(0);Ë.Clear();ı.GetItems(Ë);for(int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if(ì(Ë
  473. [ĥ],B)){ß=Ë[ĥ].Type.SubtypeId;if(ǟ(Ë[ĥ])){if(ß=="Ice"){if(ˣ.Count>0){đ=İ(ˣ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else
  474. {if(ˮ.Count>0){đ=İ(ˮ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}}else if(ǜ(Ë[ĥ])){if(ˤ.Count>0){đ=İ(ˤ);while(!Ė(Ë[ĥ],B.B,đ
  475. ))yield return true;}}else if(Ǡ(Ë[ĥ])&&ß=="Stone"){if(ˏ.Count>0){đ=İ(ˏ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else if(
  476. Ǟ(Ë[ĥ])&&ß=="Canvas"){if(ˍ.Count>0){đ=İ(ˍ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else if(Ǥ(Ë[ĥ])&&ʐ){if(Ë[ĥ].Type.
  477. TypeId==ʁ&&ˋ.Count>0){đ=İ(ˋ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}else if(Ë[ĥ].Type.TypeId==ʂ&&ˌ.Count>0){đ=İ(ˌ);while(!Ė(Ë
  478. [ĥ],B.B,đ))yield return true;}else if(ˣ.Count>0){đ=İ(ˣ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}if(ç(Ë[ĥ])){if(ˬ.Count>0
  479. ){đ=İ(ˬ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}}}}yield return false;}SortedList<int,double>İ(List<int>µ){SortedList<
  480. int,double>Ę=new SortedList<int,double>();for(int E=0;E<µ.Count;E++)Ę[µ[E]]=-1;return Ę;}bool Ė(MyInventoryItem Ö,
  481. IMyTerminalBlock B,SortedList<int,double>đ,double ĕ=-1){if(!μ.ContainsKey(Χ[10])){Ȋ(Ĕ(Ö,B,đ,ĕ),Χ[10]);if(!DZ())return false;}return ǯ(Χ[
  482. 10]);}IEnumerator<bool>Ĕ(MyInventoryItem Ö,IMyTerminalBlock B,SortedList<int,double>ē,double ė){IMyTerminalBlock Ì;
  483. SortedList<int,double>đ=new SortedList<int,double>(ē);List<int>Đ=new List<int>();double ď;for(int E=0;E<đ.Count;E+=0){if(!DZ())
  484. yield return true;try{if(!Ğ(ʫ[đ.Keys[E]],Ö))đ.RemoveAt(E);else{Đ.Add(đ.Keys[E]);E++;}}catch{}}if(đ.Count>0){ű Ã=Ñ();while(!ĵ(
  485. Ã,Đ,Ö.Type.TypeId,Ö.Type.SubtypeId))yield return true;Đ.Clear();double Ď=(double)Ö.Amount;if(ė>0&&Ď>ė)Ď=ė;double č,Č,ċ,Ē,
  486. Ċ=ʸ["balanceRange"];bool ę=Ǵ(Ö);Ã.ū(Ö.Type.TypeId,Ö.Type.SubtypeId,Ď);if(Ã.š()>0&&đ.Count>0){double ģ=Ã.ŭ(Ö)/(double)đ.
  487. Count;for(int E=0;E<đ.Count;E+=0){if(!DZ())yield return true;ď=đ.Values[E];if(ď==-1){ď=0;try{Ì=ʫ[đ.Keys[E]].B;}catch{continue;
  488. }while(!ě(ref ď,Ö,Ì))yield return true;đ[đ.Keys[E]]=ď;}if(ď>ģ+(ģ*Ċ))đ.RemoveAt(E);else E++;}}if(đ.Count>0){č=Ď/(double)đ.
  489. Count;int Ģ,ġ=0;if(đ.Count>1)ġ=α.Next(0,đ.Count-1);try{Ē=è(Ö,ʫ[đ.Keys[0]].B);}catch{Ē=double.MaxValue;}bool Ġ=false;double ğ=
  490. ʫ[đ.Keys[0]].ǀ.ŭ(ref Ġ,Ö);if(Ġ)Ē=ğ;for(int E=0;E<đ.Count;E++){ď=đ.Values[E];Ģ=đ.Keys[E];if(!DZ())yield return true;if(ď==-
  491. 1){ď=0;try{Ì=ʫ[đ.Keys[E]].B;}catch{continue;}while(!ě(ref ď,Ö,Ì))yield return true;}if(ę)ċ=č;else{if(E==ġ)ċ=Math.Ceiling(
  492. č);else ċ=Math.Floor(č);}if(ċ>Ē)ċ=Ē;if(ď>0&&ċ+ď>Ē)ċ=Ē-ď;if(!ę){if(E==ġ)ċ=Math.Ceiling(ċ);else ċ=Math.Floor(ċ);}Č=ċ;while(
  493. !ä(ref ċ,B.GetInventory(0),ʫ[đ.Keys[E]],Ö))yield return true;if(ċ>0){Ď-=Č-ċ;č=Ď/((double)đ.Count-(E+1));}}}}yield return
  494. false;}bool Ğ(ǂ Ì,MyInventoryItem Ö){IMyTerminalBlock B=Ì.B;bool ĝ=false;double Ĝ=Ì.ǀ.ŭ(ref ĝ,Ö);if(ĝ&&Ĝ<=0)return false;if(B
  495. is IMyRefinery){if(ǟ(Ö)){if(B.BlockDefinition.SubtypeName==ɻ){if(ʵ["basicRefineryTypes"].Contains(Ö.Type.SubtypeId))return
  496. true;Ǒ Þ=õ(Ö.Type.ToString());if(Þ!=null)return Þ.Ɨ;}}}if(ǜ(Ö)&&ʧ.ContainsKey(Ì.B.BlockDefinition.ToString())){return ʧ[Ì.B.
  497. BlockDefinition.ToString()]==Ö.Type.SubtypeId;}return true;}bool ě(ref double J,MyInventoryItem Ö,IMyTerminalBlock B){if(!μ.ContainsKey
  498. (Χ[11])){Ȋ(Ě(Ö.Type.TypeId,Ö.Type.SubtypeId,B),Χ[11]);if(!DZ())return false;}if(ǯ(Χ[11])){J=0+Τ;Τ=0;return true;}return
  499. false;}bool ě(ref double J,string ô,string ß,IMyTerminalBlock B){if(!μ.ContainsKey(Χ[11])){Ȋ(Ě(ô,ß,B),Χ[11]);if(!DZ())return
  500. false;}if(ǯ(Χ[11])){J=0+Τ;Τ=0;return true;}return false;}IEnumerator<bool>Ě(string ô,string ß,IMyTerminalBlock B){List<
  501. MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë);for(int E=0;E<Ë.Count;E++){if(!DZ())yield return true;if(Ë[E
  502. ].Type.TypeId==ô&&Ë[E].Type.SubtypeId==ß)Τ+=(double)Ë[E].Amount;}yield return false;}bool Œ(string Į){if(!μ.ContainsKey(Į
  503. )){Ȋ(ő(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ő(){List<MyInventoryItem>Ë=new List<MyInventoryItem>();ű
  504. Ã=Ñ();double Ĝ=0,Ő=0;bool ĝ=false;ǂ Ì;for(int E=0;E<ʫ.Count;E++){if(!DZ())yield return true;try{ʫ[E].Ĥ=Ñ();Ì=ʫ[E];}catch{
  505. continue;}if(!DZ())yield return true;if(Ì.ǀ.š()>0){Ë.Clear();Ì.B.GetInventory(0).GetItems(Ë);if(!DZ())yield return true;Ã=Ñ();for(
  506. int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if(æ(Ì,Ë[ĥ]))Ã.ū(Ë[ĥ]);}foreach(KeyValuePair<string,double>Ħ in Ã.V){if(!DZ
  507. ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʊ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.V[Ħ.Key]=Ő;}foreach(KeyValuePair<string,double>Ħ in
  508. Ã.Ũ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʆ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.Ũ[Ħ.Key]=Ő;}foreach(KeyValuePair<string,
  509. double>Ħ in Ã.Ű){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʄ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.Ű[Ħ.Key]=Ő;}foreach(KeyValuePair<
  510. string,double>Ħ in Ã.ũ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʅ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.ũ[Ħ.Key]=Ő;}foreach(
  511. KeyValuePair<string,double>Ħ in Ã.ŧ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʃ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.ŧ[Ħ.Key]=Ő;}}}yield
  512. return false;}bool ŏ(string Į){if(!μ.ContainsKey(Į)){Ȋ(œ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>œ(){string q
  513. ;List<MyInventoryItem>ō=new List<MyInventoryItem>();IMyTerminalBlock B;ǂ Ì;string ŝ=ё("manualKeyword");for(int E=0;E<ʫ.
  514. Count;E++){try{Ì=ʫ[E];B=Ì.B;}catch{continue;}if(!DZ())yield return true;q=Ȁ(B);bool Ŝ=q.Contains("+in"),ś=q.Contains("+out"),Ś
  515. =q.Contains("-in"),ř=q.Contains("-out"),Ř=q.Contains(ŝ);if(Ì.Ĥ.š()>0){ō.Clear();B.GetInventory(0).GetItems(ō);for(int ĥ=0
  516. ;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ì.Ĥ.ŭ(ō[ĥ])>0)while(!ŗ(ō[ĥ],E,0,true))yield return true;}}if(Ś||(!Ř&&ǽ(Ì,0))
  517. ){ō.Clear();B.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ś||ǽ(ō[ĥ],Ì))while(!ŗ(ō
  518. [ĥ],E,0))yield return true;}}if(B.InventoryCount>1&&(ř||(!Ř&&ǽ(Ì,1)))){ō.Clear();B.GetInventory(1).GetItems(ō);for(int ĥ=
  519. 0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(ř||ǽ(ō[ĥ],Ì))while(!ŗ(ō[ĥ],E,1))yield return true;}}}yield return false;}
  520. bool ŗ(MyInventoryItem Ö,int ŕ,int Ŕ,bool Ĥ=false,int Ŏ=-1){if(!μ.ContainsKey(Χ[14])){Ȋ(Ŗ(Ö,ŕ,Ŕ,Ĥ,Ŏ),Χ[14]);if(!DZ())return
  521. false;}return ǯ(Χ[14]);}IEnumerator<bool>Ŗ(MyInventoryItem Ö,int ŕ,int Ŕ,bool Ĥ,int Ŏ){ǂ B=ʫ[ŕ];IMyTerminalBlock ħ;string ª=Ö
  522. .Type.TypeId;double ã=(double)Ö.Amount,Ŀ;if(Ĥ)ã=B.Ĥ.ŭ(Ö);if(ã>(double)Ö.Amount)ã=(double)Ö.Amount;Ŀ=ã;IMyInventory â=B.B.
  523. GetInventory(Ŕ);List<int>ľ=ˎ;if(Ŀ>0.0){if(Ǟ(Ö))ľ=ˠ;else if(ǝ(Ö))ľ=ˑ;else if(ǜ(Ö))ľ=ː;else if(Ǡ(Ö))ľ=ˢ;else if(ǟ(Ö))ľ=ˡ;for(int E=0;E
  524. <ľ.Count&&(Ŏ<=0||E<Ŏ);E++){if(!DZ())yield return true;try{ħ=ʫ[ľ[E]].B;}catch{continue;}if(B.B!=ħ){while(!ä(ref ã,â,ʫ[ľ[E]]
  525. ,Ö))yield return true;if(ã<=0)break;}}if(!DZ())yield return true;try{if(B.Ĥ.ŭ(Ö)>0.0)ʫ[ŕ].Ĥ.ū(Ö.Type.TypeId,Ö.Type.
  526. SubtypeId,-(Ŀ-ã));}catch{}}yield return false;}int Ľ(float ļ,float Ê){long Ļ,ĺ;Ļ=Math.DivRem((long)ļ,(long)Ê,out ĺ);if(ĺ>0)Ļ++;
  527. return(int)Ļ;}bool Ĺ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ĸ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ĸ(){ƀ ë;List
  528. <MyProductionItem>ķ=new List<MyProductionItem>();ǂ Ì;ű Ã;bool Ķ;for(int E=0;E<Ͱ.Count;E++){if(E>0&&!DZ())yield return true
  529. ;ķ.Clear();try{Ì=ʫ[Ͱ[E]];Ì.ƽ.Ŧ();((IMyAssembler)Ì.B).GetQueue(ķ);Ķ=((IMyAssembler)Ì.B).Mode==MyAssemblerMode.Assembly;}
  530. catch{continue;}for(int ĥ=0;ĥ<ķ.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;ȇ(ķ[ĥ],Ķ);if(ʨ.TryGetValue(ķ[ĥ].BlueprintId.
  531. SubtypeName,out ë)&&ȱ(ë.ſ)){Ã=new ű(ë.ſ);Ã.ť((double)ķ[ĥ].Amount);Ì.ƽ.Ţ(Ã);}}}Ȑ(ref ʳ);if(!DZ())yield return true;Ȑ(ref ʲ);if(!DZ())
  532. yield return true;Ȑ(ref ʱ);if(!DZ())yield return true;Ȑ(ref ʰ);if(!DZ())yield return true;Ȑ(ref ʯ);yield return false;}bool ŀ(
  533. string Į){if(!μ.ContainsKey(Į)){Ȋ(Ō(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ō(){List<MyInventoryItem>ō=new
  534. List<MyInventoryItem>();string ŋ=ё("preventCountingKeyword");IMyTerminalBlock B;for(int E=0;E<ʫ.Count;E++){if(E>0&&!DZ())
  535. yield return true;if(!ø(E))continue;try{B=ʫ[E].B;}catch{continue;}if(!B.CustomData.ToLower().Contains(ŋ)){ō.Clear();try{B.
  536. GetInventory(0).GetItems(ō);}catch{continue;}for(int ĥ=0;ĥ<ō.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;Ɵ(ō[ĥ]);}if(B.InventoryCount>
  537. 1){if(!DZ())yield return true;ō.Clear();B.GetInventory(1).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(ĥ>0&&!DZ())yield return
  538. true;Ɵ(ō[ĥ]);}}}}ȓ(ref ʳ);if(!DZ())yield return true;ʛ=0;ȓ(ref ʲ,true);if(!DZ())yield return true;ȓ(ref ʱ);if(!DZ())yield
  539. return true;ȓ(ref ʰ);if(!DZ())yield return true;ȓ(ref ʯ);ˇ=new TimeSpan(0,0,0);yield return false;}bool Ŋ(string Į){if(!μ.
  540. ContainsKey(Į)){Ȋ(ʼn(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ʼn(){ˮ.Clear();Ͱ.Clear();ˬ.Clear();ˤ.Clear();ˣ.Clear();
  541. ˢ.Clear();ˡ.Clear();ˠ.Clear();ˑ.Clear();ː.Clear();ˏ.Clear();ˎ.Clear();ˍ.Clear();ˌ.Clear();ˋ.Clear();ʫ.Clear();ʪ.Clear();ʩ
  542. .Clear();ʬ.Clear();ʭ.Clear();string K=ё("itemPanelKeyword"),X=ё("outputPanelKeyword"),A=ё("storageKeyword"),u=ё(
  543. "statusPanelKeyword"),ň=ё("includeGridKeyword"),Ň=ё("crossGridControlKeyword");bool ņ=ʷ["sameGridOnly"];if(!DZ())yield return true;List<
  544. IMyTerminalBlock>Ņ=new List<IMyTerminalBlock>();ʻ.GetBlocksOfType<IMyTerminalBlock>(Ņ);List<IMyCubeGrid>ń=new List<IMyCubeGrid>{Me.
  545. CubeGrid};IMyTerminalBlock Ê;for(int E=0;E<Ņ.Count;E++){if(!DZ())yield return true;Ê=Ņ[E];if(Ê.CubeGrid!=Me.CubeGrid&&(Ê.
  546. InventoryCount>0||(Ê is IMyTextPanel))&&Ê.CustomData.Length>0&&Ê.CustomData.ToLower().Replace(" ","").Contains(ň)){if(!ń.Contains(Ê.
  547. CubeGrid))ń.Add(Ê.CubeGrid);}}if(!DZ())yield return true;ʻ.GetBlocksOfType<IMyEntity>(ʭ);for(int E=ʭ.Count-1;E>=0;E--){if(!DZ())
  548. yield return true;Ê=ʭ[E];if(!(Ê.IsFunctional&&(!ņ||ń.Contains(Ê.CubeGrid)||(Ê.CustomData.Length>0&&Ê.CustomData.ToLower().
  549. Replace(" ","").Contains(Ň)))&&(Ê.InventoryCount>0||(Ê is IMyTextPanel&&C(Ê,K,A,X,u))||(Ê is IMyTimerBlock&&Ɂ(Ê))||(Ê is
  550. IMyProgrammableBlock))&&((Ê is IMyProgrammableBlock)||!Ê.CustomData.ToLower().Contains(ɹ))))ʭ.RemoveAt(E);}try{IMyBlockGroup Ń=ʻ.
  551. GetBlockGroupWithName("NDS Exclude");Ń.GetBlocks(ʬ);}catch{}yield return false;}bool ł(ref string ĉ,ű Ã,char Y='[',char w=']',bool Á=true,int
  552. À=4){if(!μ.ContainsKey(Χ[19])){Ȋ(Ä(Ã,Á,À,Y,w),Χ[19]);if(!DZ())return false;}if(ǯ(Χ[19])){ĉ=λ.ToString();λ.Clear();return
  553. true;}return false;}IEnumerator<bool>Ä(ű Ã,bool Á,int À,char Y,char w){while(!Â(Ã.V,ё("itemAmmoKeyword"),Y,w,Á,À))yield
  554. return true;while(!Â(Ã.Ű,ё("itemIngotKeyword"),Y,w,Á,À))yield return true;while(!Â(Ã.ũ,ё("itemOreKeyword"),Y,w,Á,À))yield
  555. return true;while(!Â(Ã.Ũ,ё("itemComponentKeyword"),Y,w,Á,À))yield return true;while(!Â(Ã.ŧ,ё("itemToolKeyword"),Y,w,Á,À))yield
  556. return true;yield return false;}bool Â(SortedList<string,double>µ,string ª,char Y,char w,bool Á,int À){if(!μ.ContainsKey(Χ[20]
  557. )){Ȋ(º(µ,ª,Y,w,Á,À),Χ[20]);if(!DZ())return false;}return ǯ(Χ[20]);}IEnumerator<bool>º(SortedList<string,double>µ,string ª,
  558. char Y,char w,bool Á,int À=0){int Ë=0;for(int E=0;E<µ.Count;E++){if(E>0&&!DZ())yield return true;if(À>0&&Ë>=À){λ.AppendLine(
  559. $"{w}");Ë=0;}if(Ë>0)λ.Append(":");else λ.Append(Y);if(Á)λ.Append($"{µ.Values[E]}:{ª}:'{Ƕ(ª,µ.Keys[E])}'");else{if(Ë==0)λ.
  560. Append($"{ª}:'{Ƕ(ª,µ.Keys[E])}'");else λ.Append($"'{Ƕ(ª,µ.Keys[E])}'");}if(E+1>=µ.Count)λ.Append("]");Ë++;}if(À>0&&µ.Count>0)λ
  561. .AppendLine();yield return false;}void Ï(){if(!μ.ContainsKey(Χ[21])){Ȋ(Î(),Χ[21]);if(!DZ())return;}ʓ=ǯ(Χ[21]);}IEnumerator
  562. <bool>Î(){Ÿ("Bulletproof Glass","BulletproofGlass",ʆ,"BulletproofGlass");Ÿ("Canvas","Canvas",ʆ,"Canvas");Ÿ("Computer",
  563. "Computer",ʆ,"ComputerComponent");yield return true;Ÿ("Construction Comp","Construction",ʆ,"ConstructionComponent");Ÿ(
  564. "Detector Component","Detector",ʆ,"DetectorComponent");Ÿ("Display","Display",ʆ,"Display");yield return true;Ÿ("Explosives","Explosives",ʆ,
  565. "ExplosivesComponent");Ÿ("Girder","Girder",ʆ,"GirderComponent");Ÿ("Gravity Gen. Comp","GravityGenerator",ʆ,"GravityGeneratorComponent");yield
  566. return true;Ÿ("Interior Plate","InteriorPlate",ʆ,"InteriorPlate");Ÿ("Large Steel Tube","LargeTube",ʆ,"LargeTube");Ÿ(
  567. "Medical Component","Medical",ʆ,"MedicalComponent");yield return true;Ÿ("Metal Grid","MetalGrid",ʆ,"MetalGrid");Ÿ("Motor","Motor",ʆ,
  568. "MotorComponent");Ÿ("Power Cell","PowerCell",ʆ,"PowerCell");yield return true;Ÿ("Radio Comm. Comp","RadioCommunication",ʆ,
  569. "RadioCommunicationComponent");Ÿ("Reactor Component","Reactor",ʆ,"ReactorComponent");Ÿ("Small Steel Tube","SmallTube",ʆ,"SmallTube");yield return
  570. true;Ÿ("Solar Cell","SolarCell",ʆ,"SolarCell");Ÿ("Steel Plate","SteelPlate",ʆ,"SteelPlate");Ÿ("Superconductor",
  571. "Superconductor",ʆ,"Superconductor");yield return true;Ÿ("Thruster Component","Thrust",ʆ,"ThrustComponent");Ÿ("Zone Chip","ZoneChip",ʆ,
  572. "",false);Ÿ("Automatic Rifle","AutomaticRifleItem",ʃ,"AutomaticRifle");yield return true;Ÿ("Precise Rifle",
  573. "PreciseAutomaticRifleItem",ʃ,"PreciseAutomaticRifle");Ÿ("Rapid Fire Rifle","RapidFireAutomaticRifleItem",ʃ,"RapidFireAutomaticRifle");Ÿ(
  574. "Ultimate Rifle","UltimateAutomaticRifleItem",ʃ,"UltimateAutomaticRifle");yield return true;Ÿ("Welder 1","WelderItem",ʃ,"Welder");Ÿ(
  575. "Welder 2","Welder2Item",ʃ,"Welder2");Ÿ("Welder 3","Welder3Item",ʃ,"Welder3");yield return true;Ÿ("Welder 4","Welder4Item",ʃ,
  576. "Welder4");Ÿ("Grinder 1","AngleGrinderItem",ʃ,"AngleGrinder");Ÿ("Grinder 2","AngleGrinder2Item",ʃ,"AngleGrinder2");yield return
  577. true;Ÿ("Grinder 3","AngleGrinder3Item",ʃ,"AngleGrinder3");Ÿ("Grinder 4","AngleGrinder4Item",ʃ,"AngleGrinder4");Ÿ("Drill 1",
  578. "HandDrillItem",ʃ,"HandDrill");yield return true;Ÿ("Drill 2","HandDrill2Item",ʃ,"HandDrill2");Ÿ("Drill 3","HandDrill3Item",ʃ,
  579. "HandDrill3");Ÿ("Drill 4","HandDrill4Item",ʃ,"HandDrill4");yield return true;Ÿ("Datapad","Datapad",ʀ,"Datapad",false);Ÿ("Powerkit",
  580. "Powerkit",ɾ,"",false);Ÿ("Medkit","Medkit",ɾ,"",false);yield return true;Ÿ("Clang Cola","ClangCola",ɾ,"",false);Ÿ("Cosmic Coffee",
  581. "CosmicCoffee",ɾ,"",false);Ÿ("SpaceCredit","SpaceCredit",ɽ,"",false);yield return true;Ÿ("Oxygen Bottle","OxygenBottle",ʁ,
  582. "OxygenBottle");Ÿ("Hydrogen Bottle","HydrogenBottle",ʂ,"HydrogenBottle");Ÿ("NATO 5.56x45mm","NATO_5p56x45mm",ʊ,
  583. "NATO_5p56x45mmMagazine");yield return true;Ÿ("NATO 25x184mm","NATO_25x184mm",ʊ,"NATO_25x184mmMagazine");Ÿ("Missile 200mm","Missile200mm",ʊ,
  584. "Missile200mm");Ÿ("Cobalt Ore","Cobalt",ʅ);yield return true;Ÿ("Gold Ore","Gold",ʅ);Ÿ("Ice","Ice",ʅ);Ÿ("Iron Ore","Iron",ʅ);yield
  585. return true;Ÿ("Magnesium Ore","Magnesium",ʅ);Ÿ("Nickel Ore","Nickel",ʅ);Ÿ("Platinum Ore","Platinum",ʅ);yield return true;Ÿ(
  586. "Scrap Ore","Scrap",ʅ,"",false);Ÿ("Silicon Ore","Silicon",ʅ);Ÿ("Silver Ore","Silver",ʅ);yield return true;Ÿ("Stone","Stone",ʅ);Ÿ(
  587. "Uranium Ore","Uranium",ʅ);Ÿ("Cobalt Ingot","Cobalt",ʄ);yield return true;Ÿ("Gold Ingot","Gold",ʄ);Ÿ("Gravel","Stone",ʄ);Ÿ(
  588. "Iron Ingot","Iron",ʄ,"",true,new List<string>(){"Scrap","Stone"});yield return true;Ÿ("Magnesium Powder","Magnesium",ʄ);Ÿ(
  589. "Nickel Ingot","Nickel",ʄ,"",true,new List<string>(){"Stone"});Ÿ("Platinum Ingot","Platinum",ʄ,"");yield return true;Ÿ("Silicon Wafer"
  590. ,"Silicon",ʄ,"",true,new List<string>(){"Stone"});Ÿ("Silver Ingot","Silver",ʄ);Ÿ("Uranium Ingot","Uranium",ʄ);yield
  591. return false;}int Í(ǂ Ì){try{if(Ì.B!=null){IMyTerminalBlock B=Ì.B;if(!((IMyFunctionalBlock)B).Enabled)return-1;else{if(B is
  592. IMyAssembler){if(((IMyAssembler)B).IsProducing||!((IMyAssembler)B).IsQueueEmpty)return 1;else return 0;}else if(B is IMyRefinery){
  593. List<MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë);if(Ë.Count==0)return 0;else return 1;}else
  594. if(B is IMyGasGenerator){List<MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë,Ê=>Ê.Type.
  595. SubtypeId=="Ice");if(Ë.Count==0)return 0;else return 1;}else if(B is IMyReactor){if(B.GetInventory(0).ItemCount==0)return 0;else
  596. return 1;}else if(B is IMyUserControllableGun){if(B.GetInventory(0).ItemCount==0)return 0;else return 1;}}}}catch{}return-1;}
  597. bool É(ű Ç,string g,char Y='[',char w=']',char Æ='|',bool Å=true){if(!μ.ContainsKey(Χ[22])){Ȋ(È(Ç,g,Y,w,Æ,Å),Χ[22]);if(!DZ())
  598. return false;}return ǯ(Χ[22]);}IEnumerator<bool>È(ű Ç,string g,char Y,char w,char Æ,bool Å){string v=g.ToLower().Replace(" ",
  599. ""),W,t,U,T,S,R,Q;bool P,O,N,M,V;T=ё("itemIngotKeyword");S=ё("itemOreKeyword");if(!DZ())yield return true;R=ё(
  600. "itemToolKeyword");Q=ё("itemAmmoKeyword");if(!DZ())yield return true;int L;double J;string[]I,H,G;ʥ[Χ[22]]=$"Text: {g}";if(v.Contains(Y.
  601. ToString())){G=v.Split(new char[]{Y},StringSplitOptions.RemoveEmptyEntries);for(int F=0;F<G.Length;F++){if(!DZ())yield return
  602. true;W=G[F];if(W.Length>0&&W.Contains(w.ToString())){if(!DZ())yield return true;try{W=W.Substring(0,W.IndexOf(w.ToString()));
  603. if(W.Contains(Æ.ToString()))I=W.Split(Æ);else I=new string[]{W};}catch{continue;}for(int E=0;E<I.Length;E++){if(!DZ())yield
  604. return true;try{P=false;O=false;N=false;M=false;V=false;t=I[E];L=t.IndexOf(":");if(Å){J=double.Parse(t.Substring(0,L));t=t.
  605. Substring(L+1);L=t.IndexOf(":");}else J=0;if(J<0)J=0;if(L==-1){U=ɶ;}else{U=t.Substring(0,L);t=t.Substring(L+1);}if(t.Contains(":"
  606. ))H=t.Split(':');else H=new string[]{t};if(U==T)P=true;else if(U==S)O=true;else if(U==R)M=true;else if(U==Q)V=true;else
  607. if(U=="*"){P=true;O=true;M=true;V=true;N=true;}else N=true;}catch{continue;}for(int D=0;D<H.Length;D++){if(!DZ())yield
  608. return true;t=H[D];if(t.Length>0){if(P)while(!Ɏ(Ç,ʳ,t,false,J))yield return true;if(O)while(!Ɏ(Ç,ʲ,t,false,J))yield return
  609. true;if(M)while(!Ɏ(Ç,ʰ,t,false,J))yield return true;if(N)while(!Ɏ(Ç,ʱ,t,false,J))yield return true;if(V)while(!Ɏ(Ç,ʯ,t,false
  610. ,J))yield return true;}}}}}}yield return false;}bool C(IMyTerminalBlock B,string K,string A,string X,string u){string r=B
  611. .CustomName.Replace(" ","").ToLower(),q=Ȁ(B);return r.Contains(K)||r.Contains(ɸ)||r.Contains(ɷ)||r.Contains(ɶ)||r.
  612. Contains(ɵ)||r.Contains(ɿ)||r.Contains(A)||r.Contains(X)||r.Contains(u)||q.Contains("[panel:");}MySprite p(IMyTextSurface h,
  613. string g,Vector2 f,Vector2 e,Color o,string Z="Monospace",TextAlignment n=κ){Vector2 m=h.MeasureStringInPixels(new
  614. StringBuilder(g),Z,1f),l=э(0,0);double k=Math.Min((e.X*0.95)/m.X,e.Y/m.Y)*0.95;m=h.MeasureStringInPixels(new StringBuilder(g),Z,(
  615. float)k);if(n==ι)l=э((e.X*0.5f)-(e.X*0.05f),0f);return new MySprite(SpriteType.TEXT,g,f+э(e.X*0.05f,(e.Y*0.5f)-(m.Y*0.5f))+l,
  616. e,o,Z,n,(float)k);}List<MySprite>j(IMyTextSurface h,string g,Vector2 f,Vector2 e,Color d,Color c,string Z="Monospace",
  617. TextAlignment n=κ){List<MySprite>Ð=new List<MySprite>{new MySprite(SpriteType.TEXTURE,"SquareTapered",f+(e/2f),e,c),p(h,g,f,e,d,Z,n)}
  618. ;return Ð;}string î(string r,int ù=20){if(r.Length<=ù)return r;return
  619. $"{r.Substring(0,(int)Math.Ceiling(((double)ù-1.0)/2.0))}.{r.Substring(r.Length-(int)Math.Floor(((double)ù-1.0)/2.0))}";}bool ø(int ö){try{if(ö>=ʫ.Count)return false;ǂ Ì=ʫ[ö];if(Ì.B==null)return false;if(Ì.B.CubeGrid.CubeExists(Ì.B.
  620. Position)&&Ì.B.IsFunctional)return true;}catch{}return false;}bool õ(out Ǒ Þ,string ô){string ª=ô.Substring(0,ô.IndexOf("/")),ß=
  621. ô.Substring(ô.IndexOf("/")+1);if(ǜ(ª)&&ʯ.TryGetValue(ß,out Þ))return true;if(Ǟ(ª)&&ʱ.TryGetValue(ß,out Þ))return true;if(
  622. Ǡ(ª)&&ʳ.TryGetValue(ß,out Þ))return true;if(ǟ(ª)&&ʲ.TryGetValue(ß,out Þ))return true;if(ǝ(ª)&&ʰ.TryGetValue(ß,out Þ))
  623. return true;Þ=null;return false;}Ǒ õ(string ô){string ª=ô.Substring(0,ô.IndexOf("/")),ß=ô.Substring(ô.IndexOf("/")+1);Ǒ Þ;if(ǜ
  624. (ª)&&ʯ.TryGetValue(ß,out Þ))return Þ;if(Ǟ(ª)&&ʱ.TryGetValue(ß,out Þ))return Þ;if(Ǡ(ª)&&ʳ.TryGetValue(ß,out Þ))return Þ;if
  625. (ǟ(ª)&&ʲ.TryGetValue(ß,out Þ))return Þ;if(ǝ(ª)&&ʰ.TryGetValue(ß,out Þ))return Þ;return null;}string ó(double ò){if(ò<1)
  626. return$"{Ǫ(ò*100.0)}";if(ò==1)return"100";if(ò<10)return$"{Math.Floor(ò*100.0)}";return"999";}string ñ(double ï){if(ï==0)
  627. return"0";if(ï<0.0001)return ï.ToString("0.0E0");if(ï<10)return ú(ï,4);if(ï<100)return ú(ï,3);if(ï<1000)return ú(ï,2);if(ï<
  628. 10000)return ú(ï,1);if(ï<1000000)return Math.Floor(ï).ToString();if(ï<10000000)return
  629. $"{ú(ï/1000000.0,3)}{ʹ["millionsSuffix"]}";if(ï<100000000)return$"{ú(ï/1000000.0,2)}{ʹ["millionsSuffix"]}";if(ï<1000000000)return
  630. $"{ú(ï/1000000.0,1)}{ʹ["millionsSuffix"]}";if(ï<10000000000)return$"{ú(ï/1000000000.0,3)}{ʹ["billionsSuffix"]}";if(ï<100000000000)return
  631. $"{ú(ï/1000000000.0,2)}{ʹ["billionsSuffix"]}";if(ï<1000000000000)return$"{ú(ï/1000000000.0,1)}{ʹ["billionsSuffix"]}";return ï.ToString("0.00E0");}string ð(double ï){
  632. string Y="";if(ï<0)Y="-";return$"{Y}{ñ(Math.Abs(ï))}";}string ú(double ï,int ć){return(Math.Floor(ï*(Math.Pow(10.0,ć)))/(Math.
  633. Pow(10.0,ć))).ToString();}void Ĉ(ref StringBuilder Ć,Ǒ Þ){Ć.Append($"Name={Þ.ǐ}||Quota={Þ.Ç}");if(Þ.Ɩ)Ć.AppendLine(
  634. $"<{Þ.Ɯ}");else Ć.AppendLine();Ć.Append($"^Type={Þ.ª}||Subtype={Þ.ß}");if(Þ.á.Length!=0)Ć.Append(
  635. $"||Blueprint={Þ.á}||Assembly Multiplier={Þ.Ʊ}||Disassembly Multiplier={Þ.Ɗ}||Assemble={Þ.ƚ}||Disassemble={Þ.ƙ}");if(ǟ(Þ.ª)){Ć.Append($"||Refine={Þ.Ƙ}||BasicRefine={Þ.Ɨ}");}Ć.Append($"||Fuel={Þ.ƛ}||Display={Þ.ŷ}");if(Ǡ(Þ.ª)){Ć.
  636. Append("||Ore Keys=[");for(int E=0;E<Þ.Ŷ.Count;E++){if(E!=0)Ć.Append("|");Ć.Append(Þ.Ŷ[E]);}Ć.Append("]");}Ć.AppendLine();}
  637. bool ą(ǂ B,MyDefinitionId á,MyAssemblerMode Ą){IMyAssembler ă=(IMyAssembler)B.B;string q=B.Ǔ();bool Ă=false,ā=false;if(Ϗ(
  638. "assemblyOnlyKeyword",q))Ă=true;else if(Ϗ("disassemblyOnlyKeyword",q))ā=true;if((Ă&&Ą==MyAssemblerMode.Disassembly)||(ā&&Ą==MyAssemblerMode.
  639. Assembly))return false;return ă.CanUseBlueprint(á)&&(ă.IsQueueEmpty||ă.Mode==Ą);}string Ā(ƀ ë){return$"{ɼ}/{ë.á}";}double ÿ(ƀ ë,
  640. bool þ=false){Ǒ Þ;if(õ(out Þ,$"{ë.ª}/{ë.ß}")){if(þ)return Þ.ƨ(ʸ["allowedExcessPercent"]);return Þ.Ʃ();}return 0;}double ý(
  641. IMyTerminalBlock B){try{string q=Ȁ(B),ü=ё("priorityTag"),û;if(q.Contains(ü)){û=q.Substring(q.IndexOf(ü)+ü.Length);û=û.Substring(0,û.
  642. IndexOf(">"));return double.Parse(û);}}catch{}return 1;}double í(MyDefinitionId á){ƀ ë;if(ʨ.TryGetValue(á.SubtypeName,out ë)){
  643. return à(ë.ª,ë.ß);}return-1;}double à(string ª,string ß){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}"))return Þ.ơ();return 100;}bool Ý(string Ü){
  644. if(!ʿ.ContainsKey(Ü)){ʿ[Ü]=new TimeSpan(0,0,0);return true;}return ʿ[Ü].TotalMilliseconds<=0.0;}TimeSpan Û(double Ú){
  645. return TimeSpan.FromSeconds(Ú);}double Ù(IMyTerminalBlock B){return(double)B.GetInventory(0).MaxVolume-(double)B.GetInventory(
  646. 0).CurrentVolume;}bool Ø(string ª,MyInventoryItem Ö){return(ǜ(ª)&&ǜ(Ö))||(Ǟ(ª)&&Ǟ(Ö))||(Ǡ(ª)&&Ǡ(Ö))||(ǟ(ª)&&ǟ(Ö))||(ǝ(ª)
  647. &&ǝ(Ö));}bool Õ(double J,double Ò,double Ô){return J>Ò+(Ò*Ô);}bool Ó(double J,double Ò,double Ô){return J<Ò-(Ò*Ô);}ű Ñ(){ű
  648. Ã=new ű{Ū=this};return Ã;}bool ì(MyInventoryItem Ö,ǂ B){string q=B.Ǔ(),ß=Ö.Type.SubtypeId;if(!q.Contains("<distribute>")
  649. &&B.ƿ.ŭ(Ö)>0)return false;return(ǟ(Ö)&&ê(Ö))||ǜ(Ö)||ç(Ö)||(ˏ.Count>0&&Ǡ(Ö)&&ß=="Stone")||(Ǟ(Ö)&&ß=="Canvas")||(Ǥ(Ö)&&ʐ);}
  650. bool ê(MyInventoryItem Ö){Ǒ é;if(õ(out é,Ö.Type.ToString()))return é.Ƙ;return true;}double è(MyInventoryItem Ö,
  651. IMyTerminalBlock B){string ß=Ö.Type.SubtypeId;if(B is IMyGasGenerator){if(ǟ(Ö)&&ß=="Ice")return ʸ["icePerO2/H2Generator"];}else if(B is
  652. IMyRefinery){if(ʛ>0)return((double)B.GetInventory(0).MaxVolume/ʛ)/Ǿ(Ö);}else if(B is IMyUserControllableGun)return ʶ["ammoPerGun"];
  653. else if(B is IMyReactor)return ʸ["fuelPerReactor"];else if(B is IMyParachute)return ʶ["canvasPerParachute"];return double.
  654. MaxValue;}bool ç(MyInventoryItem Ö){Ǒ Þ;if(õ(out Þ,Ö.Type.ToString()))return Þ.ƛ;return false;}bool æ(ǂ B,MyInventoryItem Ö){
  655. bool å=false;B.ǀ.ŭ(ref å,Ö);return å;}bool ä(ref double ã,IMyInventory â,ǂ Ł,MyInventoryItem Ö){if(!μ.ContainsKey(Χ[23])){Ȋ(
  656. Ǽ(ã,â,Ł,Ö),Χ[23]);if(!DZ())return false;}bool Ş=ǯ(Χ[23]);if(Ş){ã-=Υ;Υ=0;return true;}return false;}IEnumerator<bool>Ǽ(
  657. double ã,IMyInventory â,ǂ Ł,MyInventoryItem Ö){IMyInventory ǻ=Ł.B.GetInventory(0);bool Ǻ=false,ǹ=false;double À=Ł.ǀ.ŭ(ref Ǻ,Ö)
  658. ,ď=0,Ǹ=ǵ(Ö,Ł.B),Ƿ=ã;if(Ǻ){while(!ě(ref ď,Ö,Ł.B))yield return true;if((À<=0||ď>=À))ǹ=true;else if(Ƿ+ď>À)Ƿ=À-ď;}if(!ǹ){if(Ƿ
  659. >Ǹ)Ƿ=Ǹ;if(!Ǵ(Ö))Ƿ=Math.Floor(Ƿ);if(Ƿ>0){if(ǻ.TransferItemFrom(â,Ö,(MyFixedPoint)Ƿ)){ƃ(
  660. $"Moved {ð(Ƿ).PadRight(6)} {î(Ƕ(Ö),12).PadRight(12)} to {î(Ł.B.CustomName,12).PadRight(12)}");Υ=Ƿ;}}}yield return false;}string Ƕ(MyInventoryItem Ö){return Ƕ(Ö.Type.TypeId,Ö.Type.SubtypeId);}string Ƕ(string ª,
  661. string ß){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}"))return Þ.ǐ;return ß;}double ǵ(MyInventoryItem Ö,IMyTerminalBlock B){return Ù(B)/Ǿ(Ö);}
  662. bool Ǵ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().UsesFractions;}bool ǽ(ǂ Ȃ,int Ŕ){IMyTerminalBlock B=Ȃ.B;if(Ȃ.ƶ)return
  663. Ŕ==1;if(B is IMyRefinery)return Ŕ==1;if(B is IMyAssembler){IMyAssembler ă=(IMyAssembler)B;return(ă.IsQueueEmpty||((ă.Mode
  664. ==MyAssemblerMode.Assembly&&Ŕ==1)||(ă.Mode==MyAssemblerMode.Disassembly&&Ŕ==0)));}if(B is IMyReactor||B is IMyParachute||B
  665. is IMyUserControllableGun||B is IMySafeZoneBlock)return false;return true;}bool Ȅ(IMyTerminalBlock B){string ȃ=B.
  666. BlockDefinition.ToString().ToLower();for(int E=0;E<ʵ["gravelSifterKeys"].Count;E++){if(ȃ.Contains(ʵ["gravelSifterKeys"][E].ToLower()))
  667. return true;}return false;}bool ǽ(MyInventoryItem Ö,ǂ Ȃ){IMyTerminalBlock B=Ȃ.B;if(ǿ(Ȃ,Ö)||ȁ(Ȃ,Ö)||(B is IMyGasGenerator&&(Ö.
  668. Type.SubtypeId=="Ice"||(Ǥ(Ö)&&ʐ))))return false;if(B is IMyAssembler){IMyAssembler ă=(IMyAssembler)B;if(Ǟ(Ö)||ǝ(Ö)||ǜ(Ö))
  669. return ă.IsQueueEmpty||ă.Mode==MyAssemblerMode.Assembly;else if(Ǡ(Ö))return ă.IsQueueEmpty||ă.Mode==MyAssemblerMode.
  670. Disassembly;}if(B is IMyShipWelder&&((IMyShipWelder)B).Enabled&&Ǟ(Ö))return false;return true;}bool ȁ(ǂ B,MyInventoryItem Ö){if(Ǟ(Ö
  671. ))return B.Ʒ;else if(ǝ(Ö))return B.Ƹ;else if(ǜ(Ö))return B.ƻ;else if(Ǡ(Ö))return B.ƺ;else if(ǟ(Ö))return B.ƹ;return false
  672. ;}string Ȁ(IMyTerminalBlock B){return B.CustomData.ToLower();}bool ǿ(ǂ B,MyInventoryItem Ö){return B.ƿ.ŭ(Ö)>0.0;}double Ǿ
  673. (MyInventoryItem Ö){return Ö.Type.GetItemInfo().Volume;}bool Ǥ(MyInventoryItem Ö){return Ǥ(Ö.Type.TypeId);}bool Ǥ(string
  674. ª){return ɣ(ª,ʂ)||ɣ(ª,ʁ);}bool Ǡ(string ª){return ɣ(ª,ʄ)||ɣ(ª,ɸ)||(ª.Length>1&&ǣ(ɸ,ª));}bool ǟ(string ª){return ɣ(ª,ʅ)||ɣ
  675. (ª,ɷ)||(ª.Length>1&&ǣ(ɷ,ª));}bool ǜ(string ª){return ɣ(ª,ʊ)||ɣ(ª,ɿ)||(ª.Length>1&&ǣ(ɿ,ª));}bool Ǟ(string ª){return ɣ(ª,ʆ)
  676. ||ɣ(ª,ɶ)||(ª.Length>1&&ǣ(ɶ,ª));}bool ǝ(string ª){return ɣ(ª,ʃ)||Ǥ(ª)||ɣ(ª,ʀ)||ɣ(ª,ɾ)||ɣ(ª,ɽ)||ɣ(ª,ɵ)||(ª.Length>1&&(ǣ(ʃ,ª)
  677. ||ǣ(ʀ,ª)||ǣ(ɾ,ª)||ǣ(ɽ,ª)||ǣ(ɵ,ª)));}bool ǣ(string Ǣ,string ǡ){return Ǣ.Replace(" ","").ToLower().StartsWith(ǡ.Replace(" ",
  678. "").ToLower());}bool Ǡ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsIngot;}bool ǟ(MyInventoryItem Ö){return Ö.Type.
  679. GetItemInfo().IsOre;}bool Ǟ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsComponent;}bool ǝ(MyInventoryItem Ö){return Ö.Type.
  680. GetItemInfo().IsTool||ǝ(Ö.Type.TypeId);}bool ǜ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsAmmo;}bool Dz(IMyTerminalBlock B){
  681. string Þ=B.BlockDefinition.ToString();Þ=Þ.Substring(Þ.IndexOf("_")+1);if(ʵ["excludedDefinitions"].Contains(Þ))return true;if(B
  682. .CustomData.ToLower().Contains(ɹ))return true;return ʬ.Contains(B);}bool DZ(double ǰ=0.9){return(Runtime.
  683. CurrentInstructionCount<(Runtime.MaxInstructionCount*ʸ["actionLimiterMultiplier"]*ǰ)&&(DateTime.Now-ʈ).TotalMilliseconds<ʸ["runTimeLimiter"]*ǰ)
  684. ;}bool ǯ(string Į){ʇ=Į;bool Ǯ;DateTime ǭ=DateTime.Now,Ǭ;try{Ǯ=μ[Į].MoveNext();Ǭ=DateTime.Now;}catch{ƃ(
  685. $"Error in function: {Į} : {ʥ[Į]}");ƈ(Į);return true;}if(Į.Length!=0&&ˀ.ContainsKey(Į))ˀ[Į]=ˀ[Į]+(Ǭ-ǭ);if(!Ǯ){string ǫ;if(ˀ[Į].TotalMilliseconds>0&&ʾ[Į]>0
  686. )ǫ=$"{Ǫ(ˀ[Į].TotalMilliseconds/(double)ʾ[Į])}ms/tick";else ǫ="0ms/tick";ʺ[Į]=
  687. $"{Ǫ(ˀ[Į].TotalMilliseconds)} ms/{ʾ[Į]} ticks = {ǫ}";ƈ(Į);}return!Ǯ;}double Ǫ(double ï,int ǩ=2){return Math.Round(ï,ǩ);}void Ǩ(){int ǧ=ʶ["averageTicks"];if(ǧ>0){if(Φ==null
  688. ||Φ.Length!=ǧ){Φ=new double[ǧ];ʚ=0;for(int E=0;E<Φ.Length;E++)Φ[E]=-1;}Φ[ʚ]=Runtime.LastRunTimeMs;ʚ++;if(ʚ>=Φ.Length)ʚ=0;
  689. double Ǧ=0,ǥ=0;for(int E=0;E<Φ.Length;E++){if(Φ[E]!=-1){Ǧ+=Φ[E];ǥ++;}}Σ=Ǧ/ǥ;}else if(Φ!=null)Φ=null;}void ƃ(string ĉ){if(ĉ.
  690. Length!=0){if(ĉ.StartsWith("Error")){ʖ++;ʕ++;}bool dz=true;for(int E=0;E<ʽ.Count;E++){if(ʽ[E].g==ĉ){ʽ[E].Ĩ++;ʽ.Move(E,0);dz=
  691. false;break;}}if(dz)ʽ.Insert(0,new Ƅ{g=ĉ});int ȅ=ʶ["outputLimit"];if(ʽ.Count>ȅ)ʽ.RemoveRange(ȅ,ʽ.Count-ȅ);}}List<MySprite>ȣ(
  692. ref StringBuilder Ć,ref Vector2 Ȣ,bool ȡ,Vector2 Ƞ,Vector2 ȟ,Color c,Color Ȟ,Color ȝ,string Z,double Ȝ,IMyTextSurface h,
  693. string g,Vector2 ț,Vector2 Ț,Vector2 ș,Vector2 Ș,Vector2 ȗ){string Ȗ=$"{ó(Ȝ).PadLeft(5)}%";Ȣ+=new Vector2(0f,ȟ.Y);if(ȡ){List<
  694. MySprite>Ð=new List<MySprite>{new MySprite(SpriteType.TEXTURE,"SquareSimple",Ȣ+(Ƞ/2f),Ƞ,c),p(h,g,Ȣ,Ț,ȝ,Z),p(h,Ȗ,Ȣ+ȗ,ș,Ȟ,Z),};Ð.
  695. AddRange(ȭ(Ȣ+Ș,ț,Ȝ,true));return Ð;}else Ć.AppendLine($"{g} {Ȗ}");return new List<MySprite>();}void ȕ(){if(ʝ>=10&&ʽ.Count>0){
  696. StringBuilder Ć=new StringBuilder();foreach(KeyValuePair<string,string>Ħ in ʺ)Ć.AppendLine($"{Ħ.Key} : {Ħ.Value}");ʝ=0;List<
  697. IMyTextPanel>Ȥ=new List<IMyTextPanel>();ʻ.GetBlocksOfType<IMyTextPanel>(Ȥ,Ê=>Ê.IsFunctional&&Ê.CustomName.ToLower().Contains(
  698. "runtime"));for(int E=0;E<Ȥ.Count;E++){Ȥ[E].ContentType=ContentType.TEXT_AND_IMAGE;Ȥ[E].WriteText(Ć.ToString());}}}List<MySprite>
  699. ȭ(Vector2 f,Vector2 e,double Ȭ,bool ȫ=false,IMyTextSurface h=null,string Z="Monospace"){List<MySprite>Ð=new List<MySprite
  700. >();double ò=Ȭ;if(ò>1.0)ò=1.0;Color o;if(ȫ)o=new Color((int)(150f*(float)ò),(int)(70f*(1f-(float)ò)),0);else o=new Color(
  701. (int)(150f*(1f-(float)ò)),(int)(70f*(float)ò),0);Vector2 Ȫ=э(e.X,e.Y);Ð.Add(new MySprite(SpriteType.TEXTURE,
  702. "SquareSimple",f+э(0f,Ȫ.Y/2f),Ȫ,Color.DarkSlateGray,null,κ));Ð.Add(new MySprite(SpriteType.TEXTURE,"SquareSimple",f+э(0f,Ȫ.Y/2f),э(Ȫ.X
  703. *(float)ò,Ȫ.Y),o,null,κ));if(h!=null)Ð.Add(p(h,$"{ó(Ȭ)}%".PadRight(6),f,э(e.X*0.8f,e.Y),Color.Black,Z));return Ð;}bool ȩ(
  704. string ȧ){if(!μ.ContainsKey(Χ[53])){Ȋ(Ȩ(ȧ),Χ[53]);if(!DZ())return false;}return ǯ(Χ[53]);}IEnumerator<bool>Ȩ(string ȧ){string Ȧ
  705. =ȧ.Replace("||",";"),ª,ß,Ģ,Ȍ,r,ȥ;string[]Ȕ=Ȧ.Split(';');double Ç,Ȇ,ȏ=0;int ö;if(ȍ(Ȕ[0],out Ģ,out Ȍ)){r=Ȍ;if(!ȍ(Ȕ[1],out Ģ
  706. ,out Ȍ)||!double.TryParse(Ȍ,out Ç)){if(Ȍ.Contains("<")){ö=Ȍ.IndexOf("<");ȥ=Ȍ.Substring(ö+1);Ȍ=Ȍ.Substring(0,ö);ȏ=double.
  707. Parse(ȥ);Ç=double.Parse(Ȍ);}else Ç=0;}if(ȏ<Ç)ȏ=Ç;if(ȍ(Ȕ[2],out Ģ,out Ȍ)){ª=Ȍ;if(ȍ(Ȕ[3],out Ģ,out Ȍ)){ß=Ȍ;ȋ(ª,ß);if(!DZ())yield
  708. return true;Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}")){Þ.Ç=Ç;Þ.ª=ª;Þ.ǐ=r;Þ.Ɯ=ȏ;Þ.Ɩ=Ç!=ȏ;for(int E=4;E<Ȕ.Length;E++){if(E>4&&!DZ())yield return
  709. true;try{ö=Ȕ[E].IndexOf("=");Ȇ=0;if(ö!=-1){Ģ=Ȕ[E].Substring(0,ö);Ȍ=Ȕ[E].Substring(ö+1);double.TryParse(Ȍ,out Ȇ);}else Ģ=Ȕ[E]
  710. ;switch(Ģ.Replace(" ","").ToLower()){case"blueprint":Þ.á=Ȍ;break;case"assemblymultiplier":Þ.Ʊ=Ȇ;break;case
  711. "disassemblymultiplier":Þ.Ɗ=Ȇ;break;case"assemble":Þ.ƚ=ɣ(Ȍ,ʡ);break;case"disassemble":Þ.ƙ=ɣ(Ȍ,ʡ);break;case"refine":Þ.Ƙ=ɣ(Ȍ,ʡ);break;case
  712. "basicrefine":Þ.Ɨ=ɣ(Ȍ,ʡ);break;case"display":Þ.ŷ=ɣ(Ȍ,ʡ);break;case"orekeys":string[]Ŷ=Ȍ.Substring(1,Ȍ.Length-2).Split('|');if(Ŷ.
  713. Length>0){Þ.Ŷ.Clear();Þ.Ŷ.AddRange(Ŷ);}break;case"fuel":Þ.ƛ=ɣ(Ȍ,ʡ);break;case"recipe":break;}}catch{}}if(!DZ())yield return
  714. true;if(!ɣ(Þ.ß,ß)){ƃ($"{Þ.ß}({Þ.ß.Length}) != {ß}({ß.Length})");string Ȏ=Þ.ß;Þ.ß=ß;Ÿ(Þ.ǐ,Þ.ß,Þ.ª,Þ.á,Þ.ŷ,Þ.Ŷ);Ɵ(new
  715. MyInventoryItem(new MyItemType(Þ.ª,ß),1,(MyFixedPoint)Þ.Ǐ));ȇ(Þ.á,true,Þ.ǎ,true);ȇ(Þ.á,false,Þ.Ǎ,true);if(ǜ(Þ.ª))ʯ.Remove(Ȏ);else if(Ǟ(
  716. Þ.ª))ʱ.Remove(Ȏ);else if(Ǡ(Þ.ª))ʳ.Remove(Ȏ);else if(ǟ(Þ.ª))ʲ.Remove(Ȏ);else if(ǝ(Þ.ª))ʰ.Remove(Ȏ);}if(Þ.á.Length>0)ʨ[Þ.á]
  717. =ɓ(Þ);}}}}}bool ȍ(string g,out string Ģ,out string Ȍ){int ö=g.IndexOf("=");if(ö!=-1){Ģ=g.Substring(0,ö);Ȍ=g.Substring(ö+1
  718. );return true;}Ģ=g;Ȍ=g;return false;}void ȋ(string Ģ,string ß){if(Ǡ(Ģ)){if(!ʳ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǟ(
  719. Ģ)){if(!ʲ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(Ǟ(Ģ)){if(!ʱ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǜ(Ģ)){if(!ʯ.
  720. ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǝ(Ģ)){if(!ʰ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}}void Ȋ(IEnumerator<bool>ȉ,string Į){μ[Į]=ȉ;ˀ
  721. [Į]=new TimeSpan(0,0,0);ʾ[Į]=1;ʥ[Į]="initialize";}void Ȉ(){Runtime.UpdateFrequency=UpdateFrequency.None;Runtime.
  722. UpdateFrequency&=~UpdateFrequency.Update1;Runtime.UpdateFrequency&=~UpdateFrequency.Update10;Runtime.UpdateFrequency&=~UpdateFrequency.
  723. Update100;if(ʶ["updateFrequency"]==100)Runtime.UpdateFrequency=UpdateFrequency.Update100;else if(ʶ["updateFrequency"]==1)Runtime.
  724. UpdateFrequency=UpdateFrequency.Update1;else{if(ʶ["updateFrequency"]!=10){ʶ["updateFrequency"]=10;ʒ=true;}Runtime.UpdateFrequency=
  725. UpdateFrequency.Update10;}}void ȇ(string á,bool Ķ,double J,bool Ž){ƀ ë;if(ʨ.TryGetValue(á,out ë))ȇ(ë.ª,ë.ß,Ķ,J,Ž);}void ȇ(
  726. MyProductionItem Ö,bool Ķ,bool Ž=false){if(ʨ.ContainsKey(Ö.BlueprintId.SubtypeName)){ƀ ë=ʨ[Ö.BlueprintId.SubtypeName];ȇ(ë.ª,ë.ß,Ķ,(
  727. double)Ö.Amount,Ž);}}void ȇ(string ª,string ß,bool Ķ,double J,bool Ž){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}")){if(Ķ)Þ.Ʈ((MyFixedPoint)J,Ž);
  728. else Þ.ƭ((MyFixedPoint)J,Ž);}}void ȓ(ref SortedList<string,Ǒ>µ,bool Ȓ=false){bool ȑ=ѐ("dynamicQuota"),ƍ=ѐ(
  729. "dynamicQuotaIncreaseWhenLow");int Ə=я("dynamicQuotaPositiveThreshold"),Ɛ=я("dynamicQuotaNegativeThreshold");double Ô=щ(
  730. "dynamicQuotaPercentageIncrement"),ƒ=щ("dynamicQuotaMaxMultiplier");for(int E=0;E<µ.Count;E++){µ.Values[E].Ɣ(ˇ.TotalSeconds,ƒ,ȑ,Ɛ,Ə,Ô,ƍ);if(Ȓ&&µ.Values[E
  731. ].ß!="Ice"&&µ.Values[E].Ǐ>=0.5&&µ.Values[E].Ƙ)ʛ++;}}void Ȑ(ref SortedList<string,Ǒ>µ){Ο=0;for(int E=0;E<µ.Count;E++){µ.
  732. Values[E].ư();Ο+=µ.Values[E].ǎ+µ.Values[E].Ʃ();}}void Ɵ(MyInventoryItem Ö,bool Ž=false){Ǒ Þ;if(õ(out Þ,Ö.Type.ToString()))Þ.Ɵ(
  733. Ö.Amount,Ž);}void ż(IMyTerminalBlock B){bool Ż=false,ź=Ϗ("autoConveyorKeyword",Ȁ(B)),Ź;if(B is IMyAssembler)((
  734. IMyProductionBlock)B).UseConveyorSystem=true;else if(B is IMyRefinery)((IMyProductionBlock)B).UseConveyorSystem=ź||ʷ[
  735. "useConveyorRefineries"];else if(B is IMyReactor)((IMyReactor)B).UseConveyorSystem=ź||ʷ["useConveyorReactors"];else if(B is IMyGasGenerator)((
  736. IMyGasGenerator)B).UseConveyorSystem=ź||ʷ["useConveyorH2/O2Gens"];else if(B is IMySmallGatlingGun){Ź=((IMySmallGatlingGun)B).
  737. UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMyLargeGatlingTurret){Ź=((IMyLargeGatlingTurret)B).
  738. UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMyLargeMissileTurret){Ź=((IMyLargeMissileTurret)B).
  739. UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMySmallMissileLauncherReload){Ź=((IMySmallMissileLauncherReload
  740. )B).UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMySmallMissileLauncher){Ź=((
  741. IMySmallMissileLauncher)B).UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}if(Ż)B.ApplyAction("UseConveyor");}void Ÿ(string r,
  742. string ß,string ª,string á="",bool ŷ=true,List<string>Ŷ=null){Ǒ ŵ=new Ǒ{ª=ª,ß=ß,ǐ=r,á=á,ŷ=ŷ};if(Ǡ(ª))ŵ.Ŷ.Add(ß);if(Ŷ!=null)ŵ.Ŷ
  743. .AddRange(Ŷ);ŵ.Ŷ=ŵ.Ŷ.Distinct().ToList();if(Ǡ(ª)&&ß=="Uranium")ŵ.ƛ=true;if(Ǡ(ª))ʳ[ß]=ŵ;else if(ǟ(ª))ʲ[ß]=ŵ;else if(Ǟ(ª))ʱ
  744. [ß]=ŵ;else if(ǝ(ª))ʰ[ß]=ŵ;else if(ǜ(ª))ʯ[ß]=ŵ;if(ŵ.á.Length>0)ʨ[á]=ɓ(ŵ);}void Ŵ(){if(!μ.ContainsKey("Timer"))Ȋ(ų(),
  745. "Timer");else ǯ("Timer");}IEnumerator<bool>ų(){int Ų=ʶ["updateFrequency"];ˈ-=ˁ;ˇ+=ˁ;ˆ-=ˁ;ʝ+=Ų;ʜ+=Ų;for(int E=0;E<ʿ.Count;E++){
  746. if(!DZ())yield return true;try{if(ʿ.Values[E].TotalMilliseconds>0.0)ʿ[ʿ.Keys[E]]=ʿ.Values[E]-ˁ;}catch{}}if(Ξ>0.0){for(int E
  747. =0;E<ʉ.Count;E++){if(!DZ())yield return true;try{if(ʉ.Values[E].TotalMilliseconds>0.0)ʉ[ʉ.Keys[E]]=ʉ.Values[E]-ˁ;}catch{}}
  748. }ˁ=new TimeSpan(0,0,0);yield return false;}void ž(){if(!ʏ){try{ʏ=true;for(int E=0;E<ʾ.Count;E++)ʾ[ʾ.Keys[E]]=ʾ.Values[E]+
  749. 1;}catch{ƃ("Error advancing state ticks");}}}void Ɖ(){if(!ʎ){try{ʎ=true;for(int E=0;E<ʣ.Count;E++)ʣ[ʣ.Keys[E]]=ʣ.Values[E
  750. ]+1;}catch{ƃ("Error advancing scroll ticks");}}}void ƈ(string Į){try{μ[Į].Dispose();}catch{}try{μ[Į]=null;}catch{}try{μ.
  751. Remove(Į);}catch{}try{ʾ.Remove(Į);}catch{}try{ˀ.Remove(Į);}catch{}try{ʥ.Remove(Į);}catch{}}class Ƈ{public MyAssemblerMode Ą;
  752. public List<MyProductionItem>ķ=new List<MyProductionItem>();public float Ɔ;public DateTime ƅ=DateTime.Now;}class Ƅ{public
  753. string g="";public int Ĩ=1;public string ƃ(){if(Ĩ>1)return$"{g} x{Ĩ}";else return g;}}class Ƃ{public double J=0;public string
  754. Ģ="",g="";public int Ɓ=0;}class ƀ{public string á="",ª="",ß="";public double J=0;public ű ſ;}class ű{public Program Ū;
  755. public SortedList<string,double>Ű=new SortedList<string,double>(),ũ=new SortedList<string,double>(),Ũ=new SortedList<string,
  756. double>(),ŧ=new SortedList<string,double>(),V=new SortedList<string,double>();public ű(ű Ç){Ű=new SortedList<string,double>(Ç.
  757. Ű);ũ=new SortedList<string,double>(Ç.ũ);Ũ=new SortedList<string,double>(Ç.Ũ);ŧ=new SortedList<string,double>(Ç.ŧ);V=new
  758. SortedList<string,double>(Ç.V);Ū=Ç.Ū;}public ű(){}public void Ŧ(){Ű.Clear();ũ.Clear();Ũ.Clear();ŧ.Clear();V.Clear();}public void ť
  759. (double Ô){Ť(Ű,Ô);Ť(ũ,Ô);Ť(Ũ,Ô);Ť(ŧ,Ô);Ť(V,Ô);}private void Ť(SortedList<string,double>µ,double Ô){for(int E=0;E<µ.Count;
  760. E++)µ.Values[E]*=Ô;}public void Ţ(ű ļ){Ŭ(ref Ű,ļ.Ű);Ŭ(ref ũ,ļ.ũ);Ŭ(ref Ũ,ļ.Ũ);Ŭ(ref ŧ,ļ.ŧ);Ŭ(ref V,ļ.V);}public int š(){
  761. return Ű.Count+ũ.Count+Ũ.Count+ŧ.Count+V.Count;}public Ǒ Š(int ö){int ş=ö;if(ş<Ű.Count)return new Ǒ{ª=Ū.ʄ,ß=Ű.Keys[ş],Ǐ=Ű.
  762. Values[ş]};ş-=Ű.Count;if(ş<ũ.Count)return new Ǒ{ª=Ū.ʅ,ß=ũ.Keys[ş],Ǐ=ũ.Values[ş]};ş-=ũ.Count;if(ş<Ũ.Count)return new Ǒ{ª=Ū.ʆ,ß=
  763. Ũ.Keys[ş],Ǐ=Ũ.Values[ş]};ş-=Ũ.Count;if(ş<ŧ.Count)return new Ǒ{ª=Ū.ʃ,ß=ŧ.Keys[ş],Ǐ=ŧ.Values[ş]};ş-=ŧ.Count;if(ş<V.Count)
  764. return new Ǒ{ª=Ū.ʊ,ß=V.Keys[ş],Ǐ=V.Values[ş]};return new Ǒ();}public string ţ(int ö){return Š(ö).ƕ();}public void ū(string ª,
  765. string ß,double J,bool ů=true){if(Ū.ǜ(ª)){if(!ů||!V.ContainsKey(ß))V[ß]=J;else V[ß]+=J;}else if(Ū.Ǟ(ª)){if(!ů||!Ũ.ContainsKey(
  766. ß))Ũ[ß]=J;else Ũ[ß]+=J;}else if(Ū.Ǡ(ª)){if(!ů||!Ű.ContainsKey(ß))Ű[ß]=J;else Ű[ß]+=J;}else if(Ū.ǟ(ª)){if(!ů||!ũ.
  767. ContainsKey(ß))ũ[ß]=J;else ũ[ß]+=J;}else if(Ū.ǝ(ª)){if(!ů||!ŧ.ContainsKey(ß))ŧ[ß]=J;else ŧ[ß]+=J;}}public void ū(MyInventoryItem Ö)
  768. {ū(Ö.Type.TypeId,Ö.Type.SubtypeId,(double)Ö.Amount);}public double ŭ(MyInventoryItem Ö){bool Ů=false;return ŭ(ref Ů,Ö);}
  769. public double ŭ(string ª,string ß){bool Ů=false;return ŭ(ref Ů,ª,ß);}public double ŭ(ref bool å,MyInventoryItem Ö){return ŭ(
  770. ref å,Ö.Type.TypeId,Ö.Type.SubtypeId);}public double ŭ(ref bool å,string ª,string ß){å=true;double Ĩ;if(Ū.ǜ(ª)){if(V.
  771. TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.Ǟ(ª)){if(Ũ.TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.Ǡ(ª)){if(Ű.TryGetValue(ß,out Ĩ))return
  772. Ĩ;}else if(Ū.ǟ(ª)){if(ũ.TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.ǝ(ª)){if(ŧ.TryGetValue(ß,out Ĩ))return Ĩ;}å=false;return
  773. 0;}public void Ŭ(ref SortedList<string,double>ļ,SortedList<string,double>Ê){foreach(KeyValuePair<string,double>Ħ in Ê){if
  774. (ļ.ContainsKey(Ħ.Key))ļ[Ħ.Key]+=Ħ.Value;else ļ[Ħ.Key]=Ħ.Value;}}}class dž{public string ª="",DŽ="",ǃ="";}class ǂ{public
  775. IMyTerminalBlock B;public Ƈ ǁ;public ű ǀ,ƿ,Ĥ,ƾ,ƽ;public List<dž>Ƽ;public bool ƻ=false,ƺ=false,ƹ=false,Ƹ=false,Ʒ=false,ƶ=false,Ƶ=false,ƴ=
  776. false,Ƴ=false,Dž=false,LJ=false,ǚ=false,Ǜ=false,Ǚ=true,ǘ=false,Ǘ=false,ǖ=false;public double Ǖ=1;public int ǔ=0;public string Ǔ
  777. (){if(ǘ)return ǒ().GetText().ToLower();return B.CustomData.ToLower();}public IMyTextSurface ǒ(){if(B is IMyTextPanel)
  778. return(IMyTextSurface)B;else if((ǘ)&&((IMyTextSurfaceProvider)B).SurfaceCount>ǔ)return((IMyTextSurfaceProvider)B).GetSurface(ǔ
  779. );return null;}}class Ǒ{public string ª="",ß="",á="",ǐ="";public double Ǐ=0,ǎ=0,Ǎ=0,nj=0,Nj=0,NJ=0,Ç=0,lj=0,Lj=0,Ʋ=1,Ʊ=1,Ɗ=1,Ɲ
  780. =0,Ɯ=0;public bool ƛ=false,ƚ=true,ƙ=true,Ƙ=true,ŷ=true,Ɨ=false,Ɩ=false;public List<string>Ŷ=new List<string>();public
  781. string ƕ(){return ª+"/"+ß;}public void Ɣ(double Ɠ,double ƒ,bool Ƒ=true,int Ɛ=3,int Ə=9,double Ǝ=0.05,bool ƍ=true){if(Ɠ>0.0)lj=(
  782. nj-Ǐ)/Ɠ;else lj=0;double ƌ=ƒ,Ƌ=(lj/Ç)*Ɠ;Ǐ=nj;nj=0;bool ƞ=Ǐ<1.0;if(ƞ)ƌ/=4.0;if(Ƒ&&Ç>0){if(Ƌ>0)Ƌ*=0.8;else if(Ƌ<0)Ƌ*=1.2;if(ƞ&&ƍ
  783. &&lj==0)Ƌ=Ɠ/-3.0;else if(Ǐ>=Ç&&Ƌ<=0.0)Ƌ=Ɠ/2.0;Ɲ+=Ƌ;double Ơ=0,Ư=0;if(Ɲ<0)Ơ=Math.Floor(Ɲ/-Ɛ);else Ư=Math.Floor(Ɲ/Ə);if(Ơ>0){
  784. if(Ʋ<ƌ){Ɲ=0;Ʋ+=Ǝ;if(Ơ>1)Ʋ+=Ǝ;}else Ɲ=-Ɛ;}else if(Ư>0){if(Ʋ>1){Ɲ=0;Ʋ-=Ǝ;if(Ư>1)Ʋ-=Ǝ;}else Ɲ=Ə;}if(Ʋ>ƌ)Ʋ=ƌ;if(Ʋ<1)Ʋ=1;}else
  785. Ʋ=1;}public void ư(){ǎ=Nj;Ǎ=NJ;Nj=0;NJ=0;}public void Ɵ(MyFixedPoint J,bool Ž){if(Ž)nj+=(double)J;else nj+=(double)J;}public
  786. void Ʈ(MyFixedPoint J,bool Ž){if(Ž)ǎ+=(double)J;else Nj+=(double)J;}public void ƭ(MyFixedPoint J,bool Ž){if(Ž)Ǎ+=(double)J;
  787. else NJ+=(double)J;}public double Ƭ(bool ƫ=true){double ƪ;if(ƫ)ƪ=Ç;else ƪ=Ɯ;if(ƪ<0)return Lj;return Math.Ceiling(ƪ*Ʋ)+Lj;}
  788. public double Ʃ(){if(!ƚ||Ǎ>0)return 0;if(Ǐ+ǎ<Ƭ())return Math.Floor(Ƭ()-(Ǐ+ǎ));return 0;}public double ƨ(double Ƨ){double Ʀ=Ƭ(
  789. false),ƥ,Ƥ=Ƨ;if(Ɯ!=Ç)Ƥ=0;if(!ƙ||(Ʀ==0&&Ç==0)||ǎ>0)return 0;ƥ=Ʀ*(1.0+Ƥ);if(Ǐ-Ǎ>ƥ)return(Ǐ-Ǎ)-ƥ;return 0;}public double ƣ(){
  790. double į=Ƭ(false);if(Ç<0&&į==0)return ǎ;if(į>0&&ǎ>0&&ǎ+Ǐ>į){if(Ǐ>=į)return ǎ;else return(ǎ+Ǐ)-į;}return 0;}public double Ƣ(){
  791. double į=Ƭ();if(į>0&&Ǎ>0&&Ǐ-Ǎ<į){if(Ǐ<=į)return Ǎ;return Ǎ-(Ǐ-į);}return 0;}public double ơ(){return(Ǐ/Ƭ())*100.0;}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement