Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IMyGridTerminalSystem ʻ;SortedList<string,string>ʺ=new SortedList<string,string>(),ʹ=new SortedList<string,string>(){{
- "exclusionKeyword","exclude"},{"manualKeyword","manual"},{"itemIngotKeyword","ingot"},{"itemOreKeyword","ore"},{"itemComponentKeyword",
- "component"},{"itemToolKeyword","tool"},{"itemAmmoKeyword","ammo"},{"storageKeyword","cargo"},{"preventCountingKeyword","discount"}
- ,{"itemPanelKeyword","item"},{"outputPanelKeyword","inventory"},{"thousandsSuffix","K"},{"millionsSuffix","M"},{
- "billionsSuffix","B"},{"assemblyOnlyKeyword","<assemblyOnly>"},{"disassemblyOnlyKeyword","<disassemblyOnly>"},{"belowQuotaOnlyKeyword",
- "<belowQuota>"},{"ascendingAmountKeyword","<ascendingAmount>"},{"descendingAmountKeyword","<descendingAmount>"},{
- "ascendingPercentKeyword","<ascendingPercent>"},{"descendingPercentKeyword","<descendingPercent>"},{"priorityTag","<priority="},{
- "detailedKeyword","<detailed>"},{"compactPercentKeyword","<compactPercent>"},{"compactAmountKeyword","<compactAmount>"},{
- "backgroundColorKeyword","<backColor="},{"nameColorKeyword","<nameColor="},{"amountColorKeyword","<amountColor="},{"nameLengthKeyword",
- "<nameLength="},{"amountLengthKeyword","<amountLength="},{"panelRowCountKeyword","<rows="},{"panelColumnCountKeyword","<columns="},{
- "fontKeyword","<font="},{"scrollTickDelayKeyword","<scroll="},{"totalCapacityKeyword","<total>"},{"statusPanelKeyword","status"},{
- "includeGridKeyword","includeGrid"},{"crossGridControlKeyword","crossGrid"},{"autoConveyorKeyword","autoConveyor"},{"displayTextKeyword",
- "<text>"}};SortedList<string,double>ʸ=new SortedList<string,double>(){{"actionLimiterMultiplier",0.35},{"runTimeLimiter",0.45},{
- "scanDelay",30},{"loopLimiter",0.5},{"icePerO2/H2Generator",5000},{"overheatAverage",0.6},{"balanceRange",0.05},{
- "delayProcessLimits",10},{"delaySortItems",10},{"delayDistributeItems",15},{"delaySpreadItems",15},{"delayQueueAssembly",5},{
- "delayQueueDisassembly",10},{"delayRemoveExcessAssembly",10},{"delayRemoveExcessDisassembly",15},{"delaySortBlueprints",10},{
- "delaySortCargoPriority",20},{"delaySpreadBlueprints",20},{"delayLoadouts",15},{"delayFillingBottles",20},{"delayTimerLogic",10},{
- "delayCheckIdleAssemblers",7.5},{"delayResetIdleAssembler",15},{"delayFindModItems",5},{"fuelPerReactor",500},{"allowedExcessPercent",0.1},{
- "dynamicQuotaPercentageIncrement",0.05},{"dynamicQuotaMaxMultiplier",5},{"delaySortRefinery",7.5},{"multiplayerPanelFixDelay",10}};SortedList<string,bool
- >ʷ=new SortedList<string,bool>(){{"useConveyorRefineries",false},{"useConveyorReactors",false},{"useConveyorH2/O2Gens",
- false},{"useConveyorGuns",false},{"autoKeyCargoContainers",true},{"countItems",true},{"countBlueprints",true},{
- "processLimits",true},{"sortItems",true},{"spreadRefineries",true},{"spreadReactors",true},{"spreadGuns",true},{"spreadH2/O2Gens",true}
- ,{"spreadGravelSifters",true},{"spreadParachutes",true},{"queueAssembly",true},{"queueDisassembly",true},{
- "removeExcessAssembly",true},{"removeExcessDisassembly",true},{"sortBlueprints",true},{"sortCargoPriority",true},{"spreadBlueprints",true},{
- "doLoadouts",true},{"distributeItems",true},{"triggerLogic",true},{"resetIdleAssemblers",true},{"findModItems",true},{
- "autoLoadSettings",true},{"dynamicQuota",true},{"dynamicQuotaIncreaseWhenLow",true},{"sameGridOnly",false},{"sortRefineries",true},{
- "setPanelsToSprite",true}};SortedList<string,int>ʶ=new SortedList<string,int>(){{"updateFrequency",1},{"averageTicks",30},{"outputLimit",15
- },{"dynamicQuotaNegativeThreshold",3},{"dynamicQuotaPositiveThreshold",9},{"ammoPerGun",40},{"canvasPerParachute",4}};
- SortedList<string,List<string>>ʵ=new SortedList<string,List<string>>(){{"excludedDefinitions",new List<string>(){
- "Refinery/SmallShipSmallShieldGeneratorBase","CryoChamber/LargeBlockBed","Refinery/LargeShipLargeShieldGeneratorBase","CargoContainer/LargeBlockLockerRoom",
- "CargoContainer/LargeBlockLockerRoomCorner","CargoContainer/LargeBlockLockers","Cockpit/PassengerSeatSmall","Cockpit/PassengerSeatLarge",
- "InteriorTurret/LargeInteriorTurret","Cockpit/CockpitOpen","Cockpit/OpenCockpitSmall","Cockpit/LargeBlockCockpit","Cockpit/CockpitOpen",
- "InteriorTurret/LargeInteriorTurret"}},{"basicRefineryTypes",new List<string>(){"Stone","Scrap","Iron","Nickel","Cobalt","Silicon","Magnesium"}},{
- "gravelSifterKeys",new List<string>(){"gravelrefinery","gravelseparator"}}};SortedList<string,ű>ʴ=new SortedList<string,ű>();SortedList<
- string,Ǒ>ʳ=new SortedList<string,Ǒ>(),ʲ=new SortedList<string,Ǒ>(),ʱ=new SortedList<string,Ǒ>(),ʰ=new SortedList<string,Ǒ>(),ʯ
- =new SortedList<string,Ǒ>(),ʮ=new SortedList<string,Ǒ>();List<IMyTerminalBlock>ʭ=new List<IMyTerminalBlock>(),ʬ=new List<
- IMyTerminalBlock>();List<ǂ>ʫ=new List<ǂ>(),ʪ=new List<ǂ>(),ʩ=new List<ǂ>();Dictionary<string,ƀ>ʨ=new Dictionary<string,ƀ>();Dictionary<
- string,string>ʧ=new Dictionary<string,string>();HashSet<string>ʼ=new HashSet<string>();List<Ƅ>ʽ=new List<Ƅ>();List<int>ˮ=new
- List<int>(),Ͱ=new List<int>(),ˬ=new List<int>(),ˤ=new List<int>(),ˣ=new List<int>(),ˢ=new List<int>(),ˡ=new List<int>(),ˠ=
- new List<int>(),ˑ=new List<int>(),ː=new List<int>(),ˏ=new List<int>(),ˎ=new List<int>(),ˍ=new List<int>(),ˌ=new List<int>()
- ,ˋ=new List<int>();List<string>ˊ=new List<string>(),ˉ=new List<string>();TimeSpan ˈ=TimeSpan.FromSeconds(0),ˇ=new
- TimeSpan(0,0,0),ˆ=new TimeSpan(0,0,0),ˁ=new TimeSpan(0,0,0);SortedList<string,TimeSpan>ˀ=new SortedList<string,TimeSpan>(),ʿ=new
- SortedList<string,TimeSpan>();SortedList<string,int>ʾ=new SortedList<string,int>();SortedList<string,string>ʥ=new SortedList<
- string,string>();SortedList<long,int>ʋ=new SortedList<long,int>(),ʣ=new SortedList<long,int>();SortedList<long,TimeSpan>ʉ=new
- SortedList<long,TimeSpan>();DateTime ʈ=DateTime.Now;string ʇ="Program",ʆ="MyObjectBuilder_Component",ʅ="MyObjectBuilder_Ore",ʄ=
- "MyObjectBuilder_Ingot",ʃ="MyObjectBuilder_PhysicalGunObject",ʂ="MyObjectBuilder_GasContainerObject",ʁ="MyObjectBuilder_OxygenContainerObject",
- ʊ="MyObjectBuilder_AmmoMagazine",ʀ="MyObjectBuilder_Datapad",ɾ="MyObjectBuilder_ConsumableItem",ɽ=
- "MyObjectBuilder_PhysicalObject",ɼ="MyObjectBuilder_BlueprintDefinition",ɻ="Blast Furnace",ɺ="NDS Inventory Manager",ɹ,ɸ,ɷ,ɶ,ɿ,ɵ,ʌ="",ʤ="",ʢ="false",ʡ=
- "true",ʠ=Χ[21];const bool ʟ=true,ʞ=false;int ʝ=10,ʜ=10,ʛ=0,ʚ=0,ʙ=0,ʘ=0,ʗ=0,ʖ=0,ʕ=0,ʔ=0;bool ʓ=false,ʒ=false,ʑ=true,ʐ=false,ʏ=
- false,ʎ=false,ʦ=false,ʍ=true,ͱ=false,ΰ=false,ή=false,έ=false,ά=false,Ϋ=false,Ϊ=true,Ω=false,Ψ=false;static string[]Χ=new
- string[]{"Main Loop","Main Control Loop","Main Output Loop","Adding Status Item","Painting Output Panel",
- "Painting Cargo Panel","Measuring Capacities","Painting Item Panel","Counting Listed Items","Distribution Loop","Distributing Item",
- "Counting Item In Inventory","Measuring Excess","Sort Loop","Storing Item","Blueprint Count Loop","Count Loop","Scanning","Processing",
- "Converting Collection","Converting List","Filling Dictionary","Processing Tags","Transferring Item","Spreading Items","Balancing Items",
- "Distributing Blueprint","Removing Excess Assembly","Drawing Item","Setting Block Quotas","Save","Queue Assembly","Queue Disassembly",
- "Inserting Blueprint","Count Blueprints In Assmbler","Removing Blueprint","Removing Excess Disassembly","Sort Cargo","Cargo Priority Loop",
- "Sorting Cargo Priority","Sort Blueprints","Spread Blueprints","Load","Loadouts","Sort Refineries","Timer Logic","Matching Items",
- "Process Timer","Checking Idle Assemblers","Find Mod Items","Process Setting","Panel Painter","Getting Items For Panel",
- "Processing Item Setting",};double[]Φ;double Υ=0,Τ=0,Σ=0,Ρ=5.03,Π=0,Ο=0,Ξ,Ν=0,Μ=0,Λ=0,Κ=0,Ι=0,ί=0;Random α=new Random();StringBuilder λ=new
- StringBuilder();Dictionary<string,IEnumerator<bool>>μ=new Dictionary<string,IEnumerator<bool>>();const TextAlignment κ=TextAlignment.
- LEFT,ι=TextAlignment.CENTER;Program(){ʻ=GridTerminalSystem;θ();Me.GetSurface(1).ContentType=ContentType.SCRIPT;}void θ(){Ȉ()
- ;ɹ=ё("exclusionKeyword");ɸ=ё("itemIngotKeyword");ɷ=ё("itemOreKeyword");ɶ=ё("itemComponentKeyword");ɿ=ё("itemAmmoKeyword")
- ;ɵ=ё("itemToolKeyword");ʍ=ʷ["autoLoadSettings"];}void Main(string δ){if(!ʦ){try{ʈ=DateTime.Now;ˁ+=Runtime.
- TimeSinceLastRun;Ŵ();Ɖ();Ǩ();ʏ=false;ʎ=false;if(ʍ){ʔ++;if(ʔ>=120){if(Me.CustomData.Length!=ʌ.Length||string.Compare(Me.CustomData,ʌ,
- false)!=0)ʑ=true;ʔ=0;}}try{if(δ.Length!=0)ε(δ);}catch{ƃ($"Error running command: {δ}");}double η=ʸ["overheatAverage"];if(η<=
- 0.0||Σ<=η){ʙ=0;if(!ʓ){ž();Ï();}else{if(ʑ){ž();if(ό())ʑ=false;}else if(ʒ){ž();if(π())ʒ=false;}else Ί();}}else ʙ++;ζ();}catch
- {ƃ("Error in main");}}else Echo("Please recompile!");}void ζ(){if(ʜ>=6){ʜ=0;if(ͱ){int Ĩ=0;if(ʤ.Length==0){Echo(
- "Choose Item");for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].ß.Length!=0){Echo($"{E+1} : {ʮ.Keys[E]}");Ĩ++;}}if(Ĩ==0)ͱ=false;}else{Echo(
- $"Choose Blueprint For {ʤ}");for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].á.Length!=0){Echo($"{E+1} : {ʮ.Keys[E]}");Ĩ++;}}if(Ĩ==0){ͱ=false;ʤ="";}}}
- else if(έ){if(ʮ.Count==0)έ=false;for(int E=0;E<ʮ.Count;E++){if(ʮ.Values[E].á.Length>0)Echo($"BPT: {ʮ.Values[E].á}");else
- Echo($"ITM: {ʮ.Values[E].ß}");}}else if(ά){foreach(KeyValuePair<string,IEnumerator<bool>>Ħ in μ){Echo(Ħ.Key);}}else{Echo(
- $"Main: {ʠ}");Echo($"Current: {ʇ}");Echo($"Last: {Ǫ(Runtime.LastRunTimeMs,4)}");Echo($"Avg: {Ǫ(Σ,4)}");Echo(
- $"Managed Blocks: {ʫ.Count}");Echo($"Panels: {ʪ.Count}");Echo($"Active Functions: {μ.Count}");if(ʘ!=0||ʗ!=0){Echo($"Mod Items: {ʘ}");Echo(
- $"Mod Blueprints: {ʗ}");}if(ʕ>0){Echo($"Current Error Count: {ʖ}");Echo($"Total Error Count: {ʕ}");}if(ʙ>0)Echo($"Overheat Ticks: {ʙ}");}}}
- void ε(string δ){string γ=δ.ToLower(),û,Ģ,r,Ȍ;û=γ.Replace(" ","");if(γ.Contains(" ")){Ģ=γ.Substring(0,γ.IndexOf(" "));Ȍ=γ.
- Substring(γ.IndexOf(" ")+1);}else{Ģ="";Ȍ="";}bool β=ͱ;if(û=="merge"){ʤ="";ͱ=!ͱ;if(ʘ==0||ʗ==0)ͱ=false;return;}if(ͱ){int ö;if(int.
- TryParse(δ,out ö)){ö--;if(ö<ʮ.Count){if(ʤ.Length==0){if(ʮ.Values[ö].ß.Length!=0)ʤ=ʮ.Keys[ö];}else{if(ʮ.Values[ö].á.Length!=0){Ǒ
- Θ=ʮ.Values[ö],Η=ʮ[ʤ];Ÿ(Η.ß,Η.ß,Η.ª,Θ.á);ʮ.Remove(Θ.á);ʮ.Remove(ʤ);ˊ.Remove(Η.ß);ˉ.Remove(Θ.á);ʘ--;ʗ--;ʤ="";ͱ=false;ʒ=true
- ;}}}}}if(!β){β=true;switch(û){case"ping":ƃ("Pong!");break;case"save":if(!ʑ)ʒ=true;else ƃ(
- "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<Ͱ.
- Count;E++){try{((IMyAssembler)ʫ[Ͱ[E]].B).ClearQueue();}catch{}}break;case"reset":Me.CustomData="";Storage="";ʦ=true;break;
- case"clearfunctions":Ό();break;case"merge?":έ=!έ;if(ʮ.Count==0)έ=false;break;case"functions?":ά=!ά;break;case"scan":ˈ=
- TimeSpan.FromSeconds(0);Ό();break;case"echo":Ϊ=!Ϊ;Echo($"Echo Allowed: {Ϊ}");break;default:β=false;break;}}if(!β&&Ģ.Length!=0)
- switch(Ģ){case"setgroup":r=Ȍ.Substring(0,Ȍ.IndexOf(" "));Ȍ=Ȍ.Substring(Ȍ.IndexOf(" ")+1);ɮ(r,double.Parse(Ȍ));ʒ=true;break;
- case"set":r=Ȍ.Substring(0,Ȍ.IndexOf(" "));Ȍ=Ȍ.Substring(Ȍ.LastIndexOf(" ")+1);ɳ(r,double.Parse(Ȍ));ʒ=true;break;}}void Ό(){
- for(int E=0;E<Χ.Length;E++)if(μ.ContainsKey(Χ[E]))ƈ(Χ[E]);}void Ί(){if(!μ.ContainsKey(Χ[0]))Ȋ(Ή(),Χ[0]);else ǯ(Χ[0]);}
- IEnumerator<bool>Ή(){double Έ=ʸ["loopLimiter"];while(true){Ά();if(!DZ(Έ))yield return true;ї();if(!DZ(Έ))yield return true;Έ=ʸ[
- "loopLimiter"];}}void Ά(){ž();if(!μ.ContainsKey(Χ[1]))Ȋ(ͽ(),Χ[1]);else ǯ(Χ[1]);}IEnumerator<bool>ͽ(){string Ģ;while(true){if(ʖ>=10){ʖ
- =0;for(int E=2;E<Χ.Length;E++){if(!DZ())yield return true;if(μ.ContainsKey(Χ[E]))ƈ(Χ[E]);}}if(ˈ.TotalSeconds<=0.0){Ϋ=true;
- ʠ=Χ[17];while(!Ŋ(ʠ))yield return true;ʠ=Χ[18];while(!к(ʠ))yield return true;ʠ="Idle";Ϋ=false;ˈ=TimeSpan.FromSeconds(ʸ[
- "scanDelay"]);}if(ʷ["countItems"]){ʠ=Χ[16];while(!ŀ(ʠ))yield return true;ʠ="Idle";}if(ʷ["countBlueprints"]){ʠ=Χ[15];while(!Ĺ(Χ[15])
- )yield return true;ʠ="Idle";}if(ʛ>0&&ʷ["sortRefineries"]){Ģ=Χ[44];if(Ý(Ģ)){ʠ=Ģ;while(!Ζ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ
- ]=Û(ʸ["delaySortRefinery"]);}}if(ʷ["processLimits"]){Ģ=Χ[12];if(Ý(Ģ)){ʠ=Ģ;while(!Œ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ
- ["delayProcessLimits"]);}}if(ʷ["sortItems"]){Ģ=Χ[13];if(Ý(Ģ)){ʠ=Ģ;while(!ŏ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
- "delaySortItems"]);}}if(ʷ["distributeItems"]){Ģ=Χ[9];if(Ý(Ģ)){if(ʸ["delayFillingBottles"]>0.0&&ˆ.TotalMilliseconds<=0.0)ʐ=true;else ʐ=
- false;ʠ=Ģ;while(!ij(Ģ))yield return true;ʠ="Idle";if(ʐ)ˆ=Û(ʸ["delayFillingBottles"]);ʿ[Ģ]=Û(ʸ["delayDistributeItems"]);}}Ģ=Χ[
- 24];if(Ý(Ģ)){if(ˮ.Count>1&&ʷ["spreadRefineries"]){ʠ="Spreading Refineries";while(!Ȯ(ˮ,Ģ))yield return true;}if(ˬ.Count>1&&
- ʷ["spreadReactors"]){ʠ="Spreading Reactors";while(!Ȯ(ˬ,Ģ))yield return true;}if(ˤ.Count>1&&ʷ["spreadGuns"]){ʠ=
- "Spreading Weapons";while(!Ȯ(ˤ,Ģ))yield return true;}if(ˣ.Count>1&&ʷ["spreadH2/O2Gens"]){ʠ="Spreading O2/H2 Gens";while(!Ȯ(ˣ,Ģ))yield
- return true;}if(ˏ.Count>1&&ʷ["spreadGravelSifters"]){ʠ="Spreading Gravel Sifters";while(!Ȯ(ˏ,Ģ))yield return true;}if(ˍ.Count>
- 1&&ʷ["spreadParachutes"]){ʠ="Spreading Parachutes";while(!Ȯ(ˍ,Ģ))yield return true;}ʠ="Idle";ʿ[Ģ]=Û(ʸ["delaySpreadItems"]
- );}if(ʷ["queueAssembly"]){Ģ=Χ[31];if(Ý(Ģ)){ʠ=Ģ;while(!ψ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayQueueAssembly"]);}}
- if(ʷ["queueDisassembly"]){Ģ=Χ[32];if(Ý(Ģ)){ʠ=Ģ;while(!φ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayQueueDisassembly"]);}
- }if(ʷ["removeExcessAssembly"]){Ģ=Χ[27];if(Ý(Ģ)){ʠ=Ģ;while(!Ϻ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
- "delayRemoveExcessAssembly"]);}}if(ʷ["removeExcessDisassembly"]){Ģ=Χ[36];if(Ý(Ģ)){ʠ=Ģ;while(!ϯ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
- "delayRemoveExcessDisassembly"]);}}if(ʷ["sortBlueprints"]){Ģ=Χ[40];if(Ý(Ģ)){ʠ=Ģ;while(!Ϟ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delaySortBlueprints"]
- );}}if(ʷ["sortCargoPriority"]){Ģ=Χ[38];if(Ý(Ģ)){ʠ=Ģ;while(!Ϣ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
- "delaySortCargoPriority"]);}}if(ʷ["spreadBlueprints"]){Ģ=Χ[41];if(Ý(Ģ)){ʠ=Ģ;while(!Ϯ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ[
- "delaySpreadBlueprints"]);}}if(ʷ["doLoadouts"]){Ģ=Χ[43];if(Ý(Ģ)){ʠ=Ģ;while(!ͼ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayLoadouts"]);}}if(ʷ[
- "triggerLogic"]){Ģ=Χ[45];if(Ý(Ģ)){ʠ=Ģ;while(!ȸ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayTimerLogic"]);}}if(ʷ["resetIdleAssemblers"
- ]){Ģ=Χ[48];if(Ý(Ģ)){ʠ=Ģ;while(!Ȱ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayCheckIdleAssemblers"]);}}if(ʷ[
- "findModItems"]){Ģ=Χ[49];if(Ý(Ģ)){ʠ=Ģ;while(!Ȼ(Ģ))yield return true;ʠ="Idle";ʿ[Ģ]=Û(ʸ["delayFindModItems"]);}}yield return true;}}bool
- ͼ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ͻ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ͻ(){ǂ Ì,ͺ;IMyInventory ͷ,Ͷ
- ;int ʹ,ͳ;List<MyInventoryItem>ō=new List<MyInventoryItem>();ű Ã=Ñ(),Ͳ;Ǒ Þ;double Ύ;for(int E=0;E<ʫ.Count;E++){if(!DZ())
- yield return true;if(!ø(E))continue;try{Ì=ʫ[E];}catch{continue;}ʹ=Ì.ƿ.š();if(ʹ!=0){ͷ=Ì.B.GetInventory(0);Ã.Ŧ();Ͳ=new ű(Ì.ƿ);
- if(Ì.B is IMyAssembler&&!((IMyAssembler)Ì.B).IsQueueEmpty&&Ì.ƽ!=null)Ͳ.Ţ(Ì.ƽ);while(!ĵ(Ã,new List<int>{E}))yield return
- true;ͳ=Ã.š();for(int ĥ=0;ĥ<ͳ;ĥ++){if(!DZ())yield return true;Þ=Ã.Š(ĥ);if(Þ.ß.Length!=0)Ͳ.ū(Þ.ª,Þ.ß,-Þ.Ǐ);}for(int ĥ=0;ĥ<ͳ;ĥ++
- ){if(!DZ())yield return true;try{Þ=Ͳ.Š(ĥ);if(Þ.Ǐ<0.0)ʫ[E].Ĥ.ū(Þ.ª,Þ.ß,-Þ.Ǐ);}catch{}}for(int ĥ=0;ĥ<ˎ.Count&&ȱ(Ͳ);ĥ++){if(!
- DZ())yield return true;ō.Clear();if(!ø(ˎ[ĥ]))continue;try{ͺ=ʫ[ˎ[ĥ]];}catch{continue;}Ͷ=ͺ.B.GetInventory(0);Ͷ.GetItems(ō);
- for(int D=0;D<ō.Count&&ȱ(Ͳ);D++){if(!DZ())yield return true;if(Ͳ.ŭ(ō[D])>0.0&&(double)ō[D].Amount>ͺ.ƿ.ŭ(ō[D])){try{Ύ=Ͳ.ŭ(ō[D
- ]);if(Ύ>(double)ō[D].Amount)Ύ=(double)ō[D].Amount;Ύ-=ͺ.ƿ.ŭ(ō[D]);if(!Ǵ(ō[D]))Ύ=Math.Floor(Ύ);if(Ύ>0.0){if(ͷ.
- TransferItemFrom(Ͷ,ō[D],(MyFixedPoint)Ύ))Ͳ.ū(ō[D].Type.TypeId,ō[D].Type.SubtypeId,-Ύ);}}catch{}}}}}}yield return false;}bool Ζ(string Į)
- {if(!μ.ContainsKey(Į)){Ȋ(Ε(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ε(){ǂ Ì;List<MyInventoryItem>ō=new
- List<MyInventoryItem>(),Δ=new List<MyInventoryItem>();List<Ƃ>Γ=new List<Ƃ>();IMyInventory ı;double Β=0,Α=0,ΐ;for(int E=0;E<ˮ
- .Count;E++){if(!DZ())yield return true;if(!ø(ˮ[E]))continue;try{Ì=ʫ[ˮ[E]];}catch{continue;}ı=Ì.B.GetInventory(0);ō.Clear()
- ;Γ.Clear();ı.GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;try{Γ.Add(new Ƃ{J=ɖ(ō[ĥ]),Ɓ=ĥ});if(ĥ==0){Β=
- Γ[Γ.Count-1].J;Α=Γ[Γ.Count-1].J;}else{Β=Math.Min(Β,Γ[Γ.Count-1].J);Α=Math.Max(Α,Γ[Γ.Count-1].J);}}catch{}}if(Ì.B.
- CustomData.Length==0)Ì.ǀ=Ñ();if(Β!=Α){Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();Δ.Clear();ΐ=Math.Max(ʛ,Γ.Count);double Ώ=0,Ē=(double)ı.
- MaxVolume/Ǿ(ō[0]);for(int ĥ=0;ĥ<Γ.Count;ĥ++){if(!DZ())yield return true;Δ.Add(ō[Γ[ĥ].Ɓ]);}if(Δ.Count>1)for(int F=1;F<=ΐ;F++)Ώ+=F;
- for(int ĥ=0;ĥ<Δ.Count;ĥ++){if(!DZ())yield return true;if(Ì.B.CustomData.Length==0)Ì.ǀ.ū(Δ[ĥ].Type.TypeId,Δ[ĥ].Type.SubtypeId
- ,(((double)Δ.Count-(double)ĥ)/Ώ)*Ē,false);for(int F=0;F<ı.ItemCount;F++){if(!DZ())yield return true;try{MyInventoryItem Ö=
- (MyInventoryItem)ı.GetItemAt(F);if(Ö.Type.ToString()==Δ[ĥ].Type.ToString()){ı.TransferItemFrom(ı,F,ĥ,false,Δ[ĥ].Amount);
- break;}}catch{}}}}}yield return false;}bool ȸ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ɇ(),Į);if(!DZ())return false;}return ǯ(Į);}
- IEnumerator<bool>Ɇ(){bool Ǚ,Ʌ=true;ǂ Ì;Ǒ Þ;for(int E=0;E<ʩ.Count;E++){if(E>0&&!DZ())yield return true;Ì=ʩ[E];if(((IMyFunctionalBlock
- )Ì.B).Enabled){Ǚ=Ì.Ǚ;for(int ĥ=0;ĥ<Ì.Ƽ.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;if(õ(out Þ,Ì.Ƽ[ĥ].ª))Ʌ=Ʉ(Þ,Ì.Ƽ[ĥ].DŽ,Ì.Ƽ[
- ĥ].ǃ);if((!Ʌ&&Ǚ)||(Ʌ&&!Ǚ))break;}if(Ʌ)((IMyTimerBlock)Ì.B).Trigger();}}yield return false;}bool Ʉ(Ǒ Þ,string DŽ,string ǃ){
- double Ƀ=0;if(ǃ=="quota"){Ƀ=Þ.Ƭ();}else if(ǃ.Contains("/")){Ǒ ɂ;if(õ(out ɂ,ǃ))Ƀ=ɂ.Ǐ;}else double.TryParse(ǃ,out Ƀ);if(DŽ.
- Contains("=")&&ǃ=="quota"&&Ƀ<0.0)return false;if(DŽ==">="){return Þ.Ǐ>=Ƀ;}else if(DŽ=="<="){return Þ.Ǐ<=Ƀ;}else if(DŽ==">"){return
- Þ.Ǐ>Ƀ;}else if(DŽ=="<"){return Þ.Ǐ<Ƀ;}else if(DŽ=="="){return Þ.Ǐ==Ƀ;}return true;}bool Ɂ(IMyTerminalBlock B){string q=Ȁ(B)
- ;return q.Contains("[logic&")||q.Contains("[logic|");}bool ɀ(ű Ã,string ª,string r,bool ů=true,double J=0){if(Ǡ(ª))return
- Ɏ(Ã,ʳ,r,ů,J);if(ǜ(ª))return Ɏ(Ã,ʯ,r,ů,J);if(Ǟ(ª))return Ɏ(Ã,ʱ,r,ů,J);if(ǟ(ª))return Ɏ(Ã,ʲ,r,ů,J);if(ǝ(ª))return Ɏ(Ã,ʰ,r,ů
- ,J);return true;}bool Ɏ(ű Ã,SortedList<string,Ǒ>ō,string r,bool ů=true,double J=0){if(!μ.ContainsKey(Χ[46])){Ȋ(ɍ(Ã,ō,r,ů,
- J),Χ[46]);if(!DZ())return false;}return ǯ(Χ[46]);}IEnumerator<bool>ɍ(ű Ã,SortedList<string,Ǒ>ō,string r,bool ů,double J){Ǒ
- Þ;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.
- StartsWith("'")&&r.EndsWith("'");if(r=="*"||(Ɍ&&ɣ(Þ.ǐ.Replace(" ",""),r.Substring(1,r.Length-2)))||(!Ɍ&&Þ.ǐ.ToLower().Replace(" ",
- "").StartsWith(r)))Ã.ū(Þ.ª,Þ.ß,J,ů);}yield return false;}bool ɋ(ǂ Ì){if(!μ.ContainsKey(Χ[47])){Ȋ(Ɋ(Ì),Χ[47]);if(!DZ())
- return false;}return ǯ(Χ[47]);}IEnumerator<bool>Ɋ(ǂ Ì){Ì.Ƽ=new List<dž>();List<string>ɉ=new List<string>();string q,Ɉ,ɇ=
- "[logic",ª="",ß="",DŽ=">",ȿ="";string[]ȶ;char Æ='&';bool ȵ=false,ȴ=false;int ö,ȳ,Ȳ;q=Ì.Ǔ().Replace(" ","");while(q.Contains(ɇ)){
- if(!DZ())yield return true;q=q.Substring(q.IndexOf(ɇ)+ɇ.Length);ö=q.IndexOf("]");Ɉ=q.Substring(0,ö);q=q.Substring(ö+1);if(Ɉ
- .StartsWith("&")){if(!ȵ&&!ȴ)ȵ=true;Ɉ=Ɉ.Substring(1);Æ='&';}else if(Ɉ.StartsWith("|")){if(!ȵ&&!ȴ)ȴ=true;Ɉ=Ɉ.Substring(1);Æ
- ='|';}if(Ɉ.Contains(Æ.ToString()))ȶ=Ɉ.Split(Æ);else ȶ=new string[]{Ɉ};for(int ĥ=0;ĥ<ȶ.Length;ĥ++){if(!DZ())yield return
- true;ɉ.Add(ȶ[ĥ]);}}Ì.Ǚ=Æ=='&';if(ɉ.Count>0){ű Ã,ȷ;for(int ĥ=0;ĥ<ɉ.Count;ĥ++){if(!DZ())yield return true;try{ȿ=ɉ[ĥ];ö=ȿ.
- IndexOf(":");ª=ȿ.Substring(0,ö);ȿ=ȿ.Substring(ö+1);if(ȿ.Contains(">="))DŽ=">=";else if(ȿ.Contains("<="))DŽ="<=";else if(ȿ.
- Contains(">"))DŽ=">";else if(ȿ.Contains("<"))DŽ="<";else if(ȿ.Contains("="))DŽ="=";ö=ȿ.IndexOf(DŽ);ß=ȿ.Substring(0,ö);ȿ=ȿ.Substring(
- ö+DŽ.Length);}catch{}Ã=Ñ();while(!ɀ(Ã,ª,ß))yield return true;ȳ=Ã.š();ö=ȿ.IndexOf(":");if(ö>0){ȷ=Ñ();ª=ȿ.Substring(0,ö);ß=ȿ
- .Substring(ö+1);while(!ɀ(ȷ,ª,ß))yield return true;Ȳ=ȷ.š();for(int E=0;E<ȳ;E++){for(int D=0;D<Ȳ;D++){if(!DZ())yield return
- true;Ì.Ƽ.Add(new dž{ª=Ã.ţ(E),ǃ=ȷ.ţ(D),DŽ=DŽ});}}}else{for(int E=0;E<ȳ;E++){if(!DZ())yield return true;Ì.Ƽ.Add(new dž{ª=Ã.ţ(E),ǃ=ȿ
- ,DŽ=DŽ});}}}}yield return false;}bool ȱ(ű Ã){return ȱ(Ã.V)||ȱ(Ã.Ũ)||ȱ(Ã.Ű)||ȱ(Ã.ũ)||ȱ(Ã.ŧ);}bool ȱ(SortedList<string,double
- >µ){for(int E=0;E<µ.Count;E++)if(µ.Values[E]>0.0)return true;return false;}bool Ȱ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ȯ(),Į
- );if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ȯ(){ǂ Ì;IMyAssembler ă;Ƈ ǁ;double Ⱦ=ʸ["delayResetIdleAssembler"];
- List<MyProductionItem>ķ=new List<MyProductionItem>();List<MyInventoryItem>ō=new List<MyInventoryItem>();int Ƚ;bool ȼ;for(int
- E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;Ì=ʫ[Ͱ[E]];ǁ=Ì.ǁ;if(DateTime.Now>=ǁ.ƅ){ă=(IMyAssembler)Ì.B;if(!ă.IsQueueEmpty
- ){ķ.Clear();ă.GetQueue(ķ);ʫ[Ͱ[E]].ǁ.ƅ=DateTime.Now.AddSeconds(Ⱦ);if(ǁ.Ą==ă.Mode&&ǁ.Ɔ==ă.CurrentProgress){if(ķ.Count==ǁ.ķ.
- Count){Ƚ=0;ȼ=false;for(int ĥ=0;ĥ<ķ.Count&&!ȼ;ĥ++){for(int D=0;D<ǁ.ķ.Count&&!ȼ;D++){if(!DZ())yield return true;if(ķ[ĥ].
- BlueprintId.SubtypeName==ǁ.ķ[D].BlueprintId.SubtypeName&&(double)ķ[ĥ].Amount>=(double)ǁ.ķ[D].Amount){Ƚ++;break;}else ȼ=true;}}if(Ƚ
- ==ķ.Count){ă.ClearQueue();ō.Clear();ă.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++)while(!ŗ(ō[ĥ],Ͱ[E],0))yield
- return true;ō.Clear();ă.GetInventory(1).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++)while(!ŗ(ō[ĥ],Ͱ[E],1))yield return true;}}}try{ʫ
- [Ͱ[E]].ǁ.ķ.Clear();ʫ[Ͱ[E]].ǁ.ķ.AddRange(ķ);}catch{}}else try{ʫ[Ͱ[E]].ǁ.ķ.Clear();}catch{}try{ʫ[Ͱ[E]].ǁ.Ɔ=ă.
- CurrentProgress;ʫ[Ͱ[E]].ǁ.Ą=ă.Mode;}catch{}}}yield return false;}bool Ȼ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ⱥ(),Į);if(!DZ())return false;}
- return ǯ(Į);}IEnumerator<bool>Ⱥ(){List<MyProductionItem>ķ=new List<MyProductionItem>();List<MyInventoryItem>ō=new List<
- MyInventoryItem>();for(int E=0;E<Ͱ.Count;E++){if(E>0&&!DZ())yield return true;ķ.Clear();if(!ø(Ͱ[E]))continue;try{((IMyAssembler)ʫ[Ͱ[E]].
- B).GetQueue(ķ);}catch{continue;}for(int D=0;D<ķ.Count;D++){if(D>0&&!DZ())yield return true;if(ɫ(ķ[D]))ɭ(ķ[D]);}}for(int E=
- 0;E<ʫ.Count;E++){if(E>0&&!DZ())yield return true;ō.Clear();if(!ø(E))continue;try{ʫ[E].B.GetInventory(0).GetItems(ō);}catch
- {continue;}for(int D=0;D<ō.Count;D++){if(D>0&&!DZ())yield return true;if(ɬ(ō[D]))ɏ(ō[D]);}}yield return false;}void ȹ(){ʘ=
- 0;ʗ=0;for(int E=0;E<ʮ.Count;E++)if(ʮ.Values[E].á.Length!=0)ʗ++;else ʘ++;}void ɏ(MyInventoryItem Ö){string ß=Ö.Type.
- SubtypeId;if(Ǡ(Ö)||ǟ(Ö)){Ÿ(ß,ß,Ö.Type.TypeId);ʒ=true;return;}if(!ʮ.ContainsKey(ß)){ʮ[ß]=new Ǒ{ª=Ö.Type.TypeId,ß=ß,ǐ=ß};ˊ.Add(ß);}
- else{Ǒ Þ=ʮ[ß];if(Þ.á.Length!=0){Ÿ(ß,ß,Ö.Type.TypeId,Þ.á);ʮ.Remove(ß);ˊ.Remove(ß);ʒ=true;}}ȹ();}void ɭ(MyProductionItem ë){
- string ß=ë.BlueprintId.SubtypeName;if(!ʮ.ContainsKey(ß)){ʮ[ß]=new Ǒ{á=ß};ˉ.Add(ß);}else{Ǒ Þ=ʮ[ß];if(Þ.ß.Length!=0){Ÿ(Þ.ǐ,Þ.ß,Þ
- .ª,ß);ʮ.Remove(ß);ˉ.Remove(ß);ʒ=true;}}ȹ();}bool ɬ(MyInventoryItem Ö){return!ˊ.Contains(Ö.Type.SubtypeId)&&õ(Ö.Type.
- ToString())==null;}bool ɫ(MyProductionItem ë){if(ë.BlueprintId.SubtypeName=="StoneOreToIngotBasic")return false;return!ˉ.
- Contains(ë.BlueprintId.SubtypeName)&&!ʨ.ContainsKey(ë.BlueprintId.SubtypeName);}bool ɪ(string ȧ){if(!μ.ContainsKey(Χ[50])){Ȋ(ɩ(ȧ
- ),Χ[50]);if(!DZ())return false;}return ǯ(Χ[50]);}IEnumerator<bool>ɩ(string ȧ){int ö=ȧ.IndexOf("=");string ɨ,ɧ;if(ö!=-1){
- string Ģ=ȧ.Substring(0,ö).Trim();ɨ=ȧ.Substring(ö+1).Trim();if(ɣ(Ģ,"name")){while(!ȩ(ȧ))yield return true;}else if(Ģ=="group"){
- ö=ɨ.IndexOf("=");ɧ=ɨ.Substring(0,ö).ToLower();ɨ=ɨ.Substring(ö+1).Trim();ű Ã=Ñ();while(!É(Ã,ɨ,'[',']','|',false))yield
- return true;if(ɧ.Length!=0&&Ã.š()!=0)ʴ[ɧ]=Ã;}else{ɨ=ȧ.Substring(ö+1).Trim();double ɦ;bool ɥ=!ɣ(ɨ,ʢ);if(!double.TryParse(ɨ,out
- ɦ))ɦ=0;if(Ģ=="script"){if(ɨ==ɺ)ΰ=true;}else if(Ģ=="version"){if(ɦ==Ρ)ή=true;}else if(ʹ.ContainsKey(Ģ))ʹ[Ģ]=ɨ;else if(ʸ.
- ContainsKey(Ģ))ʸ[Ģ]=ɦ;else if(ʷ.ContainsKey(Ģ))ʷ[Ģ]=ɥ;else if(ʶ.ContainsKey(Ģ))ʶ[Ģ]=(int)ɦ;else{if(ʵ.ContainsKey(Ģ)&&ɨ.StartsWith(
- "[")&&ɨ.EndsWith("]")){ɨ=ɨ.Substring(1,ɨ.Length-2);string[]ɤ=ɨ.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries)
- ;ʵ[Ģ].Clear();for(int E=0;E<ɤ.Length;E++){if(!DZ())yield return true;ʵ[Ģ].Add(ɤ[E]);}}}}}yield return false;}void ɮ(string
- r,double J){ű Ã;if(ʴ.TryGetValue(r.ToLower(),out Ã)){int Ĩ=Ã.š();for(int E=0;E<Ĩ;E++)ɴ(Ã.ţ(E),J);}}void ɴ(string ô,double
- J){int ö=ô.IndexOf("/");ɴ(ô.Substring(0,ö),ô.Substring(ö+1),J);}void ɴ(string ª,string ß,double J){Ǒ Þ;if(õ(out Þ,
- $"{ª}/{ß}")){Þ.Ç=J;if(Þ.Ɯ<J)Þ.Ɯ=J;}}void ɳ(string r,double J){if(r.Length>0){if(ǜ(r))ɲ(ʯ,J);else if(Ǟ(r))ɲ(ʱ,J);else if(Ǡ(r))ɲ(ʳ,J
- );else if(ǟ(r))ɲ(ʲ,J);else if(ǝ(r))ɲ(ʰ,J);else{ɲ(ʯ,J,r);ɲ(ʱ,J,r);ɲ(ʳ,J,r);ɲ(ʲ,J,r);ɲ(ʰ,J,r);}}}void ɲ(SortedList<string,Ǒ
- >µ,double J,string ɱ=""){string ɰ=ɱ.Replace(" ","");bool ɯ=false;if(ɰ.Length>2){if(ɰ.StartsWith("'")&&ɰ.EndsWith("'")){ɯ=
- true;ɰ=ɰ.Substring(1,ɰ.Length-2);}}for(int E=0;E<µ.Count;E++)if(ɰ.Length==0||(!ɯ&&µ.Values[E].ǐ.Replace(" ","").ToLower().
- StartsWith(ɰ))||(ɯ&&ɣ(µ.Values[E].ǐ.Replace(" ",""),ɰ))){µ.Values[E].Ç=J;if(µ.Values[E].Ɯ<J)µ.Values[E].Ɯ=J;}}bool ɣ(string ļ,
- string Ê){return string.Compare(ļ,Ê,true)==0;}double ɖ(MyInventoryItem Ö){double ɕ=-1,ɔ;Ǒ Þ;for(int E=0;E<ʳ.Count;E++){try{Þ=ʳ
- .Values[E];ɔ=Þ.Ŷ.IndexOf(Ö.Type.SubtypeId);if(ɔ!=-1){if(ɕ==-1)ɕ=Þ.ơ()+(ɔ*0.00001);else ɕ=Math.Min(ɕ,Þ.ơ()+(ɔ*0.00001));}}
- catch{}}return ɕ;}ƀ ɓ(Ǒ Þ){return new ƀ{á=Þ.á,ß=Þ.ß,ª=Þ.ª,ſ=Ñ()};}bool ɒ(ǂ Ì){if(!μ.ContainsKey(Χ[51])){Ȋ(ɑ(Ì),Χ[51]);if(!DZ()
- )return false;}return ǯ(Χ[51]);}IEnumerator<bool>ɑ(ǂ Ì){IMyTextSurface h=Ì.ǒ();long Ģ=Ì.B.EntityId;double ɐ,Ȝ=0;Vector2 e
- =h.SurfaceSize,l=h.TextureSize-h.SurfaceSize,Ƞ,Ȣ,ț,Ț,Ș,ȗ,ȟ,ș,ɢ=э(0f,0f),ɡ=э(0f,0f);if(Ì.ǘ||Ì.ǖ||Ì.B.BlockDefinition.
- ToString()=="MyObjectBuilder_TextPanel/LargeTextPanel")l/=2f;string ɠ=Ì.Ǔ(),g="",Z="Monospace";StringBuilder ɟ=new StringBuilder
- ();bool ɞ=Ì.ƾ.š()>0||Ì.Ƴ||Ì.LJ||Ì.Ƶ||Ì.ƴ||Ì.Dž,Ǜ=Ì.Ǜ,ǚ=Ì.ǚ,Ǘ=Ì.Ǘ,ɝ=Ϗ("ascendingAmountKeyword",ɠ),ɜ=false,ɛ=false,ɚ=false,ə=
- false,ɘ=false,ɗ=false,ȡ=true;List<MySprite>Ð=new List<MySprite>();if(Ϗ("displayTextKeyword",ɠ))ȡ=false;Color c=Color.DarkGray
- ,ȝ=Color.Black,Ȟ=Color.OrangeRed,Љ=h.ScriptForegroundColor,Ϝ;if(!ɝ){if(Ϗ("descendingAmountKeyword",ɠ))ɜ=true;else if(Ϗ(
- "ascendingPercentKeyword",ɠ))ɛ=true;else if(Ϗ("descendingPercentKeyword",ɠ))ɚ=true;}if(!ʋ.ContainsKey(Ģ)){ʋ[Ģ]=0;ʣ[Ģ]=0;}int О=5,Н=1,М=18,Л=6,К=ʋ
- [Ģ],Й=0,И=300,З=19;if(e.X<512)М=10;if(!DZ())yield return true;if(Ϗ(ref О,"panelRowCountKeyword",ɠ))ə=true;if(Ϗ(ref Н,
- "panelColumnCountKeyword",ɠ))ɘ=true;Ϗ(ref М,"nameLengthKeyword",ɠ);Ϗ(ref Л,"amountLengthKeyword",ɠ);Ϗ(ref c,"backgroundColorKeyword",ɠ);if(Ϗ(ref
- ȝ,"nameColorKeyword",ɠ))ɗ=true;Ϗ(ref Ȟ,"amountColorKeyword",ɠ);Ϗ(ref Љ,"detailColorKeyword",ɠ);Ϗ(ref И,
- "scrollTickDelayKeyword",ɠ);if(Ϗ(ref g,"fontKeyword",ɠ))Z=ϒ(h,g);if(!DZ())yield return true;if(ɞ){List<string>Ж=new List<string>();bool Е=Ϗ(
- "detailedKeyword",ɠ),Д=false,Г=false,В=Ϗ("belowQuotaOnlyKeyword",ɠ),Б=false;int А;if(!Е){if(Ϗ("compactPercentKeyword",ɠ))Д=true;else if(Ϗ
- ("compactAmountKeyword",ɠ))Г=true;if(!ə)О=Ľ(e.Y,30f);}if(!ɘ&&(Д||Г))Н=Ľ(e.X,256f);if(!ə&&Е)О=Ľ(e.Y,90f);if(!Е&&!ɗ)ȝ=Љ;if(
- Ì.ƾ.š()>0)while(!ь(Ж,Ì.ƾ))yield return true;else{SortedList<string,Ǒ>Џ=new SortedList<string,Ǒ>();if(Ì.LJ)Џ=ʯ;else if(Ì.Ƴ)
- Џ=ʱ;else if(Ì.Ƶ)Џ=ʳ;else if(Ì.ƴ)Џ=ʲ;else if(Ì.Dž)Џ=ʰ;while(!ь(Ж,null,Џ))yield return true;}А=Ж.Count;Ǒ Þ;for(int E=0;E<Ж.
- Count;E+=0){if(!DZ())yield return true;if(õ(out Þ,Ж[E])&&(!Þ.ŷ||(В&&Þ.Ǐ>=Þ.Ƭ()))){Ж.RemoveAt(E);if(!Þ.ŷ)А--;}else E++;}List<Ƃ>
- Γ=new List<Ƃ>();for(int E=0;E<Ж.Count;E++){if(!DZ())yield return true;if(õ(out Þ,Ж[E])){Ƃ П=new Ƃ{Ģ=Ж[E]};if(ɝ||ɜ)П.J=Þ.Ǐ;
- else if(ɛ||ɚ)П.J=Þ.Ǐ/Þ.Ƭ();else П.g=Þ.ǐ;Γ.Add(П);}}if(ɝ||ɛ)Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();else if(ɜ||ɚ)Γ=Γ.OrderByDescending(ĥ
- =>ĥ.J).ToList();else Γ=Γ.OrderBy(ĥ=>ĥ.g).ToList();Ж.Clear();for(int E=0;E<Γ.Count;E++){if(E>0&&!DZ())yield return true;Ж.
- Add(Γ[E].Ģ);}if(ə&&О==0){int Ы,Ъ;Ы=Math.DivRem(Ж.Count,Н,out Ъ);if(Ъ>0)Ы++;О=Ы;}Ƞ=э(e.X/(float)Н,e.Y/(float)О);ȟ=Ƞ;Ƞ=э(Ƞ.X*
- 0.98f,Ƞ.Y*0.94f);for(int Щ=0;Щ<О&&Й<Ж.Count;Щ++){for(int Ш=0;Ш<Н&&Й<Ж.Count;Ш++){Ȣ=l+э((float)Ш*ȟ.X,(float)Щ*ȟ.Y)+э(ȟ.X*0.01f
- ,ȟ.Y*0.03f);if(К>=Ж.Count)К=0;if(õ(out Þ,Ж[К])){if(Þ.Ƭ()>0)ɐ=Þ.Ǐ/Þ.Ƭ();else ɐ=1;if(Е){ș=э(Ƞ.X,Ƞ.Y/3f);List<string>Ч=new
- List<string>();h.GetSprites(Ч);Б=Ч.Contains(Ж[К]);if(Б&&ȡ){ɡ=э(ș.Y*2f,ș.Y*2f);ɢ=э(ɡ.X,0f);Ð.Add(new MySprite(SpriteType.
- TEXTURE,"SquareSimple",Ȣ+э(0f,ɡ.Y*0.5f),ɡ,Color.Gray,null,κ));Ð.Add(new MySprite(SpriteType.TEXTURE,Ж[К],Ȣ+э(0f,ɡ.Y*0.5f),ɡ,
- null,null,κ));}ț=ș-ɢ;Ț=э(ț.X*((float)М/((float)М+(float)Л)),ț.Y);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.Add(p(h,g,Ȣ+ɢ,Ț,ȝ,Z));else ɟ.
- Append(g);Ș=э(Ț.X,0f);Ț=э(ț.X*((float)Л/((float)М+(float)Л)),ț.Y);g=ð(Þ.Ǐ).PadLeft(Л);if(ȡ)Ð.Add(p(h,g,Ȣ+Ș+ɢ,Ț,Ȟ,Z));else ɟ.
- Append($" {g}");ȗ=э(0f,ș.Y);Ț=э(ț.X*0.45f,ț.Y);g=$"Quota: {ð(Þ.Ƭ()).PadRight(Л)}";if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ+ɢ,Ț,Љ,Z));else ɟ.
- AppendLine($" {g}");Ș=э(Ț.X,0f);Ț=э(ț.X*0.55f,ț.Y);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș+ȗ+ɢ,Ț,ɐ,false,h,Z));ț=ș;ȗ=э(0f,ș.Y*2f);Ț=э(ș.X*(22f/31f),
- ș.Y);Ș=э(Ț.X,0f);if(Þ.ǎ>0)g=$"Assembling: {ð(Þ.ǎ).PadRight(Л)}";else if(Þ.Ǎ>0)g=$"Disassembling: {ð(Þ.Ǎ).PadRight(Л)}";
- else if(ǟ(Þ.ª)){if(Þ.Ƙ)g="Enabled";else g="Disabled";}else g="";if(g.Length>0){if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ,Ț,Љ,Z));else ɟ.Append(
- $" {g}");}Ț=э(ș.X*(9f/31f),ș.Y);if(Þ.lj>=0)g="+";else g="";g+=$"{ð(Þ.lj)}/s";if(ȡ)Ð.Add(p(h,g,Ȣ+ȗ+Ș,Ț,Љ,Z));else ɟ.AppendLine(
- $" {g}");}else if(Г){ț=э(Ƞ.X,Ƞ.Y*0.999f);Ț=э(ț.X*((float)М/((float)М+(float)Л)),ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.
- Add(p(h,g,Ȣ,Ț,ȝ,Z));else ɟ.Append(g);Ț=э(ț.X*((float)Л/((float)М+(float)Л)),ț.Y);g=ð(Þ.Ǐ).PadLeft(Л);if(ȡ)Ð.Add(p(h,g,Ȣ+Ș,Ț
- ,Ȟ,Z));else ɟ.AppendLine($" {g}");}else if(Д){ț=э(Ƞ.X*0.3f,Ƞ.Y*0.999f);Ț=э(Ƞ.X*0.7f,ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(
- М);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,ȝ,Z));else ɟ.AppendLine(g);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș,ț,ɐ,false,h,Z));}else{ț=э(Ƞ.X*0.75f,Ƞ.Y*0.999f);
- Ț=э(ț.X*((float)М/((float)М+(((float)Л*2f)+1f))),ț.Y);Ș=э(Ț.X,0f);g=î(Þ.ǐ,М).PadRight(М);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,ȝ,Z));else
- ɟ.Append(g);Ț=э(ț.X*((((float)Л*2f)+1f)/((float)М+(((float)Л*2f)+1f))),ț.Y);g=
- $"{ð(Þ.Ǐ).PadLeft(Л)}/{ð(Þ.Ƭ()).PadRight(Л)}";if(ȡ)Ð.Add(p(h,g,Ȣ+Ș,Ț,Ȟ,Z));else ɟ.AppendLine($" {g}");Ș=э(ț.X,0f);ț=э(Ƞ.X*0.25f,Ƞ.Y*0.999f);if(ȡ)Ð.AddRange(ȭ(Ȣ+Ș,ț,ɐ
- ,false,h,Z));}}К++;Й++;}}if(Й<Ж.Count&&И>=0){if(ʣ[Ģ]>=И){ʣ[Ģ]=0;К=ʋ[Ģ];for(int E=0;E<Н;E++){if(К>=Ж.Count)К=0;К++;}ʋ[Ģ]=К
- ;}}else{ʣ[Ģ]=0;ʋ[Ģ]=0;}if(В&&Ж.Count==0){if(ȡ)Ð.AddRange(j(h,$"All {А} Items Meet Set Quotas",l,Ƞ,Љ,c,Z));else ɟ.
- AppendLine($"All {А} Items Meet Set Quotas");}}else if(Ǜ){bool Ц=Ϗ("totalCapacityKeyword",ɠ);if(!ɗ)ȝ=Љ;if(Ì.ǘ){З=10;ȟ=э(e.X,e.Y/5f
- );}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)З/
- ((float)З+(float)Л)),Ƞ.Y);ș=э(ț.X*((float)Л/((float)З+(float)Л)),Ƞ.Y);Ș=э(ț.X,0f);ȗ=э(Ț.X,0f);ț=э(Ƞ.X*0.3f,Ƞ.Y);if(Ц){g=
- "Total";if(!Ì.ǘ)g+=" Capacity";if(!Ω){while(!є(ref Ȝ,ˎ))yield return true;Ν=Ȝ;}else Ȝ=Ν;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,
- Ȝ,h,g,ț,Ț,ș,Ș,ȗ));}else{g="Ammo";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ː))yield return true;Μ=Ȝ;}else Ȝ=Μ;Ð.
- AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Component";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˠ))yield
- return true;Λ=Ȝ;}else Ȝ=Λ;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Ingot";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){
- while(!є(ref Ȝ,ˢ))yield return true;Κ=Ȝ;}else Ȝ=Κ;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));g="Ore";if(!Ì.ǘ)g
- +=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˡ))yield return true;Ι=Ȝ;}else Ȝ=Ι;Ð.AddRange(ȣ(ref ɟ,ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,
- Ș,ȗ));g="Tool";if(!Ì.ǘ)g+=" Capacity";if(!Ψ){while(!є(ref Ȝ,ˑ))yield return true;ί=Ȝ;}else Ȝ=ί;Ψ=true;Ð.AddRange(ȣ(ref ɟ,
- ref Ȣ,ȡ,Ƞ,ȟ,c,Ȟ,ȝ,Z,Ȝ,h,g,ț,Ț,ș,Ș,ȗ));}}else if(ǚ){if(Ì.ǘ||Ì.ǖ){Н=1;О=5;}else{Н=2;О=15;}Ƞ=э(e.X/(float)Н,e.Y/(float)О);ȟ=Ƞ;
- Ƞ=э(ȟ.X*0.8f,ȟ.Y);Ȣ=l;if(Н==2){ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,"NDS Inventory Manager 5",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,ʠ,Ƞ,Љ
- ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Managed Blocks: {ʫ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
- $"Runtime: {Ǫ(Σ,4).ToString().PadRight(6)}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Assemblers: {Ͱ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"H2/O2 Gens: {ˣ.Count}"
- ,Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Storages: {ˎ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Weapons: {ˤ.Count}",Ƞ,Љ,c
- ,Z,М);if(!DZ())yield return true;ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Refineries: {ˮ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
- $"Reactors: {ˬ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Hydrogen Tanks: {ˌ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,
- $"Oxygen Tanks: {ˋ.Count}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Mod Items: {ʘ}",Ƞ,Љ,c,Z,М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Mod Blueprints: {ʗ}",Ƞ,Љ,c,Z,
- М);ю(ref ɟ,ref Ð,ref Ȣ,ȡ,h,$"Errors: {ʖ}",Ƞ,Љ,c,Z,М);Ȣ=l+э(Ƞ.X,0f);}Ƞ=э(ȟ.X*1.2f,ȟ.Y);int ȅ=ʶ["outputLimit"];for(int E=0;
- E<ʽ.Count;E++){if(!DZ())yield return true;g=ʽ[E].ƃ();if(g.StartsWith("Error"))Ϝ=Color.Red;else Ϝ=Љ;if(ȡ&&E<О){Ð.AddRange(j
- (h,g,Ȣ,Ƞ,Ϝ,c,Z,ι));Ȣ+=э(0f,Ƞ.Y);}if(!ȡ)ɟ.AppendLine(g);}}else if(Ǘ){Ƞ=э(e.X/2f,e.Y/5f);Ȣ=l;if(ȡ)Ð.Add(new MySprite(
- SpriteType.TEXTURE,"SquareTapered",Ȣ+(Ƞ/2f),Ƞ,c));while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,Ͱ,"Assemblers","Active","Idle",h,ȝ,Љ,c,Z,Ð))yield return
- true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˮ,"Refineries","Active","Idle",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(
- Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˣ,"H2/O2 Gens","Filled","Empty",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˬ,
- "Reactors","Filled","Empty",h,ȝ,Љ,c,Z,Ð))yield return true;Ȣ+=э(0f,Ƞ.Y);while(!Ђ(Χ[3],ɟ,ȡ,Ƞ,Ȣ,ˤ,"Weapons","Filled","Empty",h,ȝ,Љ,c
- ,Z,Ð))yield return true;Ǒ Þ;List<Ƃ>Х=new List<Ƃ>();foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;Þ=õ(Ħ.
- Value.ª+"/"+Ħ.Value.ß);if(Þ!=null){if(Þ.ǎ>0)Х.Add(new Ƃ{g=$"Assembling {ð(Þ.ǎ)} {î(Þ.ǐ,12)}",J=Þ.ǎ});if(Þ.Ǎ>0)Х.Add(new Ƃ{g=
- $"Disassembling {ð(Þ.Ǎ)} {î(Þ.ǐ,12)}",J=Þ.Ǎ});}}Х=Х.OrderBy(ĥ=>ĥ.J).ToList();if(Х.Count==0)Х.Add(new Ƃ{g="Nothing Queued"});Ȣ=l+э(Ƞ.X,0f);ț=э(Ƞ.X,e.Y/15f);
- 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
- ɟ.AppendLine(Х[К].g);Ȣ+=э(0f,ț.Y);К++;}if(Х.Count>15){if(ʣ[Ģ]>=И){ʣ[Ģ]=0;К=ʋ[Ģ];К++;if(К>=Х.Count)К=0;ʋ[Ģ]=К;}}else{ʣ[Ģ]=
- 0;ʋ[Ģ]=0;}}if(!DZ())yield return true;bool Ф=false;if(Ξ>0.0){if(!ʉ.ContainsKey(Ģ))ʉ[Ģ]=TimeSpan.FromSeconds(Ξ);else if(ʉ[Ģ
- ].TotalSeconds<=0.0)Ф=true;if(Ф)ʉ[Ģ]=TimeSpan.FromSeconds(Ξ);}MySpriteDrawFrame У=h.DrawFrame();if(Ф){for(int E=0;E<Ð.
- Count;E++){if(!DZ())yield return true;MySprite Т=new MySprite{Alignment=Ð[E].Alignment,Color=Ѕ((Color)Ð[E].Color),Data=Ð[E].
- Data,FontId=Ð[E].FontId,Position=Ð[E].Position,Size=Ð[E].Size,Type=Ð[E].Type};Ð.RemoveAt(E);Ð.Insert(E,Т);}Ð.Insert(0,new
- MySprite());}if(ȡ)У.AddRange(Ð);У.Dispose();if(!ȡ){string С=ɟ.ToString().Trim();string[]Р=С.Split(new[]{"\r\n","\r","\n"},
- StringSplitOptions.RemoveEmptyEntries);Vector2 m=new Vector2(0,0),Ѝ=new Vector2(0,0);Vector2 Ј=h.SurfaceSize;Ѓ(ref Ј,Ì.B);for(int E=0;E<Р.
- Length;E++){if(!DZ())yield return true;Ѝ=Me.GetSurface(1).MeasureStringInPixels(new StringBuilder(Р[E]),h.Font,1f);m=new
- Vector2(Math.Max(Ѝ.X,m.X),Ѝ.Y*(float)Р.Length);}float І=((100f-h.TextPadding)/100f);float k=Math.Min((Ј.X*І)/m.X,(Ј.Y*І)/m.Y);
- 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.
- 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 Ѓ
- (ref Vector2 e,IMyTerminalBlock B){try{string é=B.BlockDefinition.ToString(),Ї;Ї=é.ToLower();if(Ї.Contains(
- "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;
- else e.Y*=0.147193F;}}}catch{}}bool Ђ(string Į,StringBuilder Ć,bool ȡ,Vector2 e,Vector2 f,List<int>Ī,string Ё,string Ѐ,
- string Ͽ,IMyTextSurface h,Color ȝ,Color Љ,Color c,string Z,List<MySprite>Ð){if(!μ.ContainsKey(Į)){Ȋ(Ќ(Ć,ȡ,e,f,Ī,Ё,Ѐ,Ͽ,h,ȝ,Љ,c,
- Z,Ð),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ќ(StringBuilder Ć,bool ȡ,Vector2 e,Vector2 f,List<int>Ī,
- string Ё,string Ѐ,string Ͽ,IMyTextSurface h,Color ȝ,Color Љ,Color c,string Z,List<MySprite>Ð){Vector2 ț=э(e.X,e.Y/3f),Ț,Ȣ=f;Ț=
- э(ț.X/2f,ț.Y);int Ћ=0,Ў=0,Њ,Ь=0;string g;for(int E=0;E<Ī.Count;E++){if(!DZ())yield return true;Њ=Í(ʫ[Ī[E]]);switch(Њ){case
- -1:Ь++;break;case 0:Ћ++;break;case 1:Ў++;break;}}if(ȡ)Ð.Add(new MySprite(SpriteType.TEXTURE,"SquareTapered",Ȣ+(e/2f),e,c)
- );g=Ё;if(ȡ)Ð.Add(p(h,g.PadRight(10),Ȣ,ț,ȝ,Z,ι));else Ć.Append(g.PadRight(10));Ȣ+=э(0f,Ț.Y);g=$"{Ѐ}: {Ў}".PadRight(11);if(
- ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.Append(g);Ȣ+=э(Ț.X,0f);g=$"{Ͽ}: {Ћ}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.
- Append(g);Ȣ+=э(-Ț.X,Ț.Y);g=$"Enabled {Ў+Ћ}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.Append(g);Ȣ+=э(Ț.X,0f);g=
- $"Disabled {Ь}".PadRight(11);if(ȡ)Ð.Add(p(h,g,Ȣ,Ț,Љ,Z,ι));else Ć.AppendLine(g);yield return false;}void ю(ref StringBuilder Ć,ref List<
- MySprite>Ð,ref Vector2 Ȣ,bool ȡ,IMyTextSurface h,string g,Vector2 e,Color Љ,Color c,string Z,int М){Ȣ+=э(0f,e.Y);if(ȡ)Ð.AddRange
- (j(h,g.PadRight(М),Ȣ,e,Љ,c,Z));else Ć.AppendLine(g);}Vector2 э(float ĥ,float D){return new Vector2(ĥ,D);}bool ь(List<
- string>Ж,ű Ã=null,SortedList<string,Ǒ>ы=null){if(!μ.ContainsKey(Χ[52])){Ȋ(ъ(Ж,Ã,ы),Χ[52]);if(!DZ())return false;}return ǯ(Χ[52]
- );}IEnumerator<bool>ъ(List<string>Ж,ű Ã,SortedList<string,Ǒ>ы){if(Ã!=null){int ȳ=Ã.š();for(int E=0;E<ȳ;E++){if(E>0&&!DZ())
- yield return true;Ж.Add(Ã.ţ(E));}}if(ы!=null){for(int E=0;E<ы.Count;E++){if(E>0&&!DZ())yield return true;Ж.Add(ы.Values[E].ƕ()
- );}}yield return false;}void ї(){if(!μ.ContainsKey(Χ[2])){Ȋ(і(),Χ[2]);if(!DZ())return;}ǯ(Χ[2]);}IEnumerator<bool>і(){ǂ Ì;
- List<ǂ>ѕ=new List<ǂ>(ʪ);Ξ=ʸ["multiplayerPanelFixDelay"];Ω=false;Ψ=false;for(int E=0;E<ѕ.Count;E++){if(E>0&&!DZ())yield return
- true;Ì=ѕ[E];while(!ɒ(Ì)){do{yield return true;}while(Ϋ);}}yield return false;}bool є(ref double Ȭ,List<int>Ī){if(!μ.
- ContainsKey(Χ[6])){Ȋ(ѓ(Ī),Χ[6]);if(!DZ())return false;}bool Ş=ǯ(Χ[6]);if(Ş)Ȭ=Π;return Ş;}IEnumerator<bool>ѓ(List<int>Ī){double ђ=0,Ž
- =0;IMyInventory ı;for(int E=0;E<Ī.Count;E++){if(E>0&&!DZ())yield return true;if(ø(Ī[E])){try{ı=ʫ[Ī[E]].B.GetInventory(0);ђ
- +=(double)ı.MaxVolume;Ž+=(double)ı.CurrentVolume;}catch{}}}Π=Ž/ђ;yield return false;}string ё(string Ģ){return ʹ[Ģ].
- Replace(" ","").ToLower();}bool ѐ(string Ģ){return ʷ[Ģ];}int я(string Ģ){return ʶ[Ģ];}double щ(string Ģ){return ʸ[Ģ];}bool к(
- string Į){if(!μ.ContainsKey(Į)){Ȋ(й(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>й(){IMyTerminalBlock B;string и=ё
- ("manualKeyword"),з,ж,q,r,X,A,е,д,г,в;ж=ё("storageKeyword");if(!DZ())yield return true;X=ё("outputPanelKeyword");A=ё(
- "storageKeyword");д=ё("statusPanelKeyword");з=$"{ж} {ɸ} {ɷ} {ɶ} {ɵ} {ɿ}";bool б=ʷ["autoKeyCargoContainers"],а,Я=false;int ö;if(!DZ())
- yield return true;List<long>Ю=new List<long>();List<MyInventoryItem>Э=new List<MyInventoryItem>();ű л=Ñ();bool н;for(int E=0;
- E<ʭ.Count;E++){if(E>0&&!DZ())yield return true;B=ʭ[E];if(!(B is IMyProgrammableBlock))н=Dz(B);else н=false;ǂ ȃ=new ǂ{B=B,ǀ=
- Ñ(),ƿ=Ñ(),Ĥ=Ñ(),ƾ=Ñ(),ƽ=Ñ(),ǘ=B is IMyCockpit||B is IMyProgrammableBlock};if(!DZ(0.5))yield return true;q=B.CustomData.
- ToLower();г=р(q,out в);if(!DZ())yield return true;r=B.CustomName.Replace(" ","").ToLower();if(!н&&B.InventoryCount>0){ö=ʫ.Count;
- а=г.Contains(ж)||B is IMyCargoContainer;ż(B);if(!DZ())yield return true;if(!q.Contains(и)){if(Ȅ(B)){ȃ.ƶ=true;ˏ.Add(ö);}
- else if(B is IMyAssembler){Ͱ.Add(ö);ȃ.ǁ=new Ƈ{Ɔ=((IMyAssembler)B).CurrentProgress,Ą=((IMyAssembler)B).Mode};}else if(B is
- IMyRefinery){string Ů=B.BlockDefinition.SubtypeId;if(Ů!="DeuteriumProcessor"&&!Ů.EndsWith("PowerTransmitter")&&!Ů.EndsWith(
- "PowerConverter"))ˮ.Add(ö);}else if(B is IMyReactor)ˬ.Add(ö);else if(B is IMyUserControllableGun)ˤ.Add(ö);else if(B is IMyGasGenerator){
- ˣ.Add(ö);((IMyGasGenerator)B).AutoRefill=true;}else if(B is IMyParachute)ˍ.Add(ö);else if(B is IMyGasTank){if(B.
- BlockDefinition.SubtypeName.ToLower().Contains("hydrogen"))ˌ.Add(ö);else ˋ.Add(ö);((IMyGasTank)B).AutoRefillBottles=true;}}if(а){if(б&&
- (q.Length==0||q==ж)){B.CustomData=з;q=B.CustomData.ToLower();г=q;}if(г.Contains(ɸ)){ȃ.ƺ=true;Я=true;ˢ.Add(ö);}if(г.
- Contains(ɷ)){ȃ.ƹ=true;Я=true;ˡ.Add(ö);}if(г.Contains(ɶ)){ȃ.Ʒ=true;Я=true;ˠ.Add(ö);}if(г.Contains(ɵ)){ȃ.Ƹ=true;Я=true;ˑ.Add(ö);}
- if(г.Contains(ɿ)){ȃ.ƻ=true;Я=true;ː.Add(ö);}if(Я){ˎ.Add(ö);ȃ.Ǖ=ý(B);}Я=false;}if(!DZ())yield return true;while(!É(ȃ.ƿ,q,'{'
- ,'}'))yield return true;while(!É(ȃ.ǀ,q))yield return true;if(B is IMyUserControllableGun&&!ȱ(ȃ.ƿ)){е=B.BlockDefinition.
- ToString();if(!ʧ.ContainsKey(е)){if(B.GetInventory(0).ItemCount>0){Э.Clear();B.GetInventory(0).GetItems(Э);ʧ[е]=Э[0].Type.
- SubtypeId;}}if(ʧ.ContainsKey(е))ȃ.ƿ.V[ʧ[е]]=ʶ["ammoPerGun"];}if(B is IMyParachute&&!ȱ(ȃ.ƿ))ȃ.ƿ.Ũ["Canvas"]=ʶ["canvasPerParachute"
- ];if(!DZ(0.5))yield return true;л.Ţ(ȃ.ƿ);ʫ.Add(ȃ);}if(B.InventoryCount==0||B is IMyCockpit||B is IMyProgrammableBlock){if(
- B is IMyCockpit||B is IMyProgrammableBlock){int ш=((IMyTextSurfaceProvider)B).SurfaceCount;IMyTextSurface h;StringBuilder
- Ć=new StringBuilder();for(int ч=0;ч<ш;ч++){if(ч>0&&!DZ())yield return true;h=((IMyTextSurfaceProvider)B).GetSurface(ч);
- string ц=h.GetText().ToLower();if(!ц.Contains("<panel>")){string х=$"[panel:{ч}";if(q.Contains(х)){ц=q.Substring(q.IndexOf(х)+
- х.Length);if(ц.Contains("]"))ц=$"{ц.Substring(0,ц.IndexOf("]"))}";}}else{Ć.AppendLine($"[panel:{ч} {ц}]");}if(ц.Contains(
- "<panel>")){ǂ ф=new ǂ{B=B,ǘ=B is IMyCockpit||B is IMyProgrammableBlock,ǀ=Ñ(),ƿ=Ñ(),Ĥ=Ñ(),ƾ=Ñ(),ƽ=Ñ(),ǔ=ч,LJ=ц.Contains(ɿ),Ƶ=ц.
- Contains(ɸ),ƴ=ц.Contains(ɷ),Dž=ц.Contains(ɵ),Ƴ=ц.Contains(ɶ),ǚ=ц.Contains(X),Ǜ=ц.Contains(A),Ǘ=ц.Contains(д)};if(!DZ())yield
- return true;while(!É(ф.ƾ,ц,'[',']','|',false))yield return true;if(ф.ǚ||ф.Ǜ||ф.LJ||ф.Ƶ||ф.ƴ||ф.Dž||ф.Ƴ||ф.Ǘ||ф.ƾ.š()>0){Ϙ(ф);Ю.
- Add(ф.B.EntityId);ʪ.Add(ф);}}}if(Ć.Length>0&&Ξ>0.0)B.CustomData=Ć.ToString();}else if(B is IMyTextPanel){ȃ.LJ=r.Contains(ɿ);
- ȃ.Ƶ=r.Contains(ɸ);ȃ.ƴ=r.Contains(ɷ);ȃ.Dž=r.Contains(ɵ);ȃ.Ƴ=r.Contains(ɶ);ȃ.ǚ=r.Contains(X);ȃ.Ǜ=r.Contains(A);ȃ.Ǘ=r.
- Contains(д);ȃ.ǖ=B.BlockDefinition.ToString().ToLower().Contains("corner_lcd");if(!DZ())yield return true;while(!É(ȃ.ƾ,q,'[',']',
- '|',false))yield return true;if(ȃ.ǚ||ȃ.Ǜ||ȃ.LJ||ȃ.Ƶ||ȃ.ƴ||ȃ.Dž||ȃ.Ƴ||ȃ.Ǘ||ȃ.ƾ.š()>0){Ϙ(ȃ);Ю.Add(ȃ.B.EntityId);ʪ.Add(ȃ);}}else
- if(B is IMyTimerBlock){while(!ɋ(ȃ))yield return true;ʩ.Add(ȃ);}}if(!DZ())yield return true;}ʭ.Clear();if(ː.Count>0)while(!ϖ
- (ː))yield return true;if(ˠ.Count>0)while(!ϖ(ˠ))yield return true;if(ˢ.Count>0)while(!ϖ(ˢ))yield return true;if(ˡ.Count>0)
- while(!ϖ(ˡ))yield return true;if(ˑ.Count>0)while(!ϖ(ˑ))yield return true;while(!ϔ(ʯ,л))yield return true;while(!ϔ(ʱ,л))yield
- return true;while(!ϔ(ʳ,л))yield return true;while(!ϔ(ʲ,л))yield return true;while(!ϔ(ʰ,л))yield return true;long Ģ;for(int E=0
- ;E<ʣ.Count;E++){if(!DZ())yield return true;Ģ=ʣ.Keys[E];if(!Ю.Contains(Ģ)){try{if(ʣ.ContainsKey(Ģ))ʣ.Remove(Ģ);if(ʋ.
- ContainsKey(Ģ))ʋ.Remove(Ģ);}catch{}}}}bool у(ǂ Ì,ref double т,MyInventoryItem Ö){bool с=false;double ğ=Ì.ǀ.ŭ(ref с,Ö);if(!с)ğ=Ì.ƿ.ŭ
- (ref с,Ö);if(с){т=ğ;return true;}return false;}string р(string g,out string в){string v=g,п="",о="{",м="}";в="";int Ͼ,ϥ;
- for(int E=1;E<=2;E++){Ͼ=v.IndexOf(о);ϥ=v.IndexOf(м);while(Ͼ!=-1&&ϥ!=-1&&ϥ>Ͼ){if(Ͼ>0)п+=v.Substring(0,Ͼ);в+=v.Substring(0,ϥ+
- 1);v=v.Substring(ϥ+1);Ͼ=v.IndexOf("{");ϥ=v.IndexOf("}");}п+=v;if(о=="{"){v=п;п="";о="[";м="]";}}return п;}string ϒ(
- IMyTextSurface h,string ϑ){List<string>ϐ=new List<string>();h.GetFonts(ϐ);for(int E=0;E<ϐ.Count;E++){if(ɣ(ϑ,ϐ[E]))return ϐ[E];}return
- "Monospace";}bool Ϗ(string Ģ,string ɠ){return ɠ.Contains(ё(Ģ));}bool Ϗ(ref string g,string Ģ,string ɠ){try{string ώ=ё(Ģ),ȿ;if(ɠ.
- Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.Substring(0,ȿ.IndexOf(">"));g=ȿ;return ȿ.Length>0;}}catch{}return false;}
- bool Ϗ(ref int ï,string Ģ,string ɠ){try{string ώ=ё(Ģ),ȿ;int ϓ;if(ɠ.Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.
- Substring(0,ȿ.IndexOf(">"));if(int.TryParse(ȿ,out ϓ)){ï=ϓ;return true;}}}catch{}return false;}bool Ϗ(ref Color o,string Ģ,string
- ɠ){try{string ώ=ё(Ģ),ȿ;Color Ϝ;if(ɠ.Contains(ώ)){ȿ=ɠ.Substring(ɠ.IndexOf(ώ)+ώ.Length);ȿ=ȿ.Substring(0,ȿ.IndexOf(">"));if(
- ϛ(out Ϝ,ȿ)){o=new Color(Ϝ.ToVector4());return true;}}}catch{}return false;}bool ϛ(out Color o,string Ϛ){o=Color.White;try
- {string[]ϙ=Ϛ.Split(':');if(ϙ.Length==4)o=new Color(int.Parse(ϙ[0]),int.Parse(ϙ[1]),int.Parse(ϙ[2]),int.Parse(ϙ[3]));else
- if(ϙ.Length==3)o=new Color(int.Parse(ϙ[0]),int.Parse(ϙ[1]),int.Parse(ϙ[2]));else return false;return true;}catch{}return
- false;}void Ϙ(ǂ ȃ){string ϗ=ȃ.B.EntityId.ToString();if(ȃ.ǘ)ϗ+=$":{ȃ.ǔ}";else ϗ+=$":0";if(!ʼ.Contains(ϗ)){ʼ.Add(ϗ);
- IMyTextSurface h=ȃ.ǒ();if(ʷ["setPanelsToSprite"]){if(h.ContentType!=ContentType.SCRIPT)h.ContentType=ContentType.SCRIPT;if(h.Script!=
- "None")h.Script="None";h.ScriptBackgroundColor=h.ScriptBackgroundColor;h.ScriptForegroundColor=h.ScriptForegroundColor;}}}bool
- ϖ(List<int>Ī){if(!μ.ContainsKey(Χ[37])){Ȋ(ϕ(Ī),Χ[37]);if(!DZ())return false;}return ǯ(Χ[37]);}IEnumerator<bool>ϕ(List<int>
- Ī){List<Ƃ>Γ=new List<Ƃ>();for(int E=0;E<Ī.Count;E++){if(!DZ())yield return true;try{Γ.Add(new Ƃ{J=ʫ[Ī[E]].Ǖ,Ɓ=Ī[E]});}
- catch{}}Ī.Clear();Γ=Γ.OrderByDescending(ĥ=>ĥ.J).ToList();for(int E=0;E<Γ.Count;E++){if(!DZ())yield return true;Ī.Add(Γ[E].Ɓ);}
- yield return false;}bool ϔ(SortedList<string,Ǒ>ō,ű Ã){if(!μ.ContainsKey(Χ[29])){Ȋ(ρ(ō,Ã),Χ[29]);if(!DZ())return false;}return
- ǯ(Χ[29]);}IEnumerator<bool>ρ(SortedList<string,Ǒ>ō,ű Ã){for(int E=0;E<ō.Count;E++){if(E>0&&!DZ())yield return true;ō.
- Values[E].Lj=Ã.ŭ(ō.Values[E].ª,ō.Values[E].ß);}yield return false;}bool π(){if(!μ.ContainsKey(Χ[30])){Ȋ(ο(),Χ[30]);if(!DZ())
- return false;}return ǯ(Χ[30]);}IEnumerator<bool>ο(){StringBuilder Ć=new StringBuilder(),ξ=new StringBuilder();string Y=
- "//////////",w=@"\\\\\\\\\\",ν="",Ů;ƀ ë;Ć.AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Components {w}");Ć.AppendLine(
- $"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʱ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʱ.Values[E]);if(ʨ.TryGetValue(ʱ.Values[E].
- á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.
- AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Ingots {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʳ.Count;E
- ++){if(!DZ())yield return true;Ĉ(ref Ć,ʳ.Values[E]);if(ʨ.TryGetValue(ʳ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,
- '{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine(
- $"{Y} Ammos {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʯ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʯ.Values[E]
- );if(ʨ.TryGetValue(ʯ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append(
- $"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine($"{Y} Tools {w}");Ć.AppendLine($"{w} {Y}");Ć.
- AppendLine();for(int E=0;E<ʰ.Count;E++){if(!DZ())yield return true;Ĉ(ref Ć,ʰ.Values[E]);if(ʨ.TryGetValue(ʰ.Values[E].á,out ë)&&ȱ(ë.
- ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine(
- $"{Y} {w}");Ć.AppendLine($"{Y} Ores {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();for(int E=0;E<ʲ.Count;E++){if(!DZ())yield
- return true;Ĉ(ref Ć,ʲ.Values[E]);if(ʨ.TryGetValue(ʲ.Values[E].á,out ë)&&ȱ(ë.ſ)){Ů="";while(!ł(ref Ů,ë.ſ,'{','}',true))yield
- return true;Ć.Append($"^Recipe={Ů}");}Ć.AppendLine();}Ć.AppendLine($"{Y} {w}");Ć.AppendLine(
- $"{Y} Item Groups {w}");Ć.AppendLine($"{w} {Y}");foreach(KeyValuePair<string,ű>Ħ in ʴ){if(!DZ())yield return true;Ć.Append(
- $"group={Ħ.Key}=");while(!ł(ref ν,Ħ.Value,'[',']',false,0))yield return true;Ć.AppendLine(ν);}Ć.AppendLine();Ć.AppendLine(
- $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Switches {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(
- KeyValuePair<string,bool>Ħ in ʷ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine(
- $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Numbers {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(
- KeyValuePair<string,double>Ħ in ʸ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}foreach(KeyValuePair<string,int>Ħ
- in ʶ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine($"{Y} {w}"
- );Ć.AppendLine($"{Y} Settings : Text {w}");Ć.AppendLine($"{w} {Y}");Ć.AppendLine();foreach(KeyValuePair<
- string,string>Ħ in ʹ){if(!DZ())yield return true;Ć.AppendLine($"{Ħ.Key}={Ħ.Value}");}Ć.AppendLine();Ć.AppendLine(
- $"{Y} {w}");Ć.AppendLine($"{Y} Settings : Lists {w}");Ć.AppendLine($"{w} {Y}");foreach(KeyValuePair<string,List<
- string>>Ħ in ʵ){if(!DZ())yield return true;Ć.Append($"{Ħ.Key}=[");for(int E=0;E<Ħ.Value.Count;E++){if(E>0){Ć.Append("|");if(!DZ(
- ))yield return true;}Ć.Append(Ħ.Value[E]);}Ć.AppendLine("]");Ć.AppendLine();}Ć.AppendLine();Ć.AppendLine();Ć.AppendLine(
- $"script={ɺ}");Ć.AppendLine($"version={Ρ}");Me.CustomData=Ć.ToString().Trim();Storage=Me.CustomData;ʌ=Me.CustomData;ΰ=true;ή=true;
- yield return false;}bool ό(){if(!μ.ContainsKey(Χ[42])){Ȋ(ϋ(),Χ[42]);if(!DZ())return false;}return ǯ(Χ[42]);}IEnumerator<bool>ϋ
- (){if(Me.CustomData.Length!=0&&Storage!=Me.CustomData)Storage=Me.CustomData;if(Storage.Length>0){ΰ=false;ή=false;string[]
- ϊ=Storage.Split(new[]{"\r\n","\r","\n"},StringSplitOptions.RemoveEmptyEntries);List<string>ω=new List<string>();for(int E
- =0;E<ϊ.Length;E++){if(!DZ())yield return true;if(ϊ[E].StartsWith("^")&&ω.Count>0)ω[ω.Count-1]+=
- $"||{ϊ[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(!ή||
- !ΰ)ʒ=true;}else ʒ=true;if(!DZ())yield return true;θ();ʌ=Me.CustomData;yield return false;}bool ψ(string Į){if(!μ.
- ContainsKey(Į)){Ȋ(χ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>χ(){double τ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(
- !DZ())yield return true;τ=ÿ(Ħ.Value);if(τ>0)while(!σ(Ħ.Value,τ,Ͱ))yield return true;}yield return false;}bool φ(string Į){
- if(!μ.ContainsKey(Į)){Ȋ(υ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>υ(){double τ;foreach(KeyValuePair<
- string,ƀ>Ħ in ʨ){if(!DZ())yield return true;τ=ÿ(Ħ.Value,true);if(τ>0)while(!σ(Ħ.Value,τ,Ͱ,MyAssemblerMode.Disassembly))yield
- return true;}yield return false;}bool σ(ƀ ë,double J,List<int>ς,MyAssemblerMode Ą=MyAssemblerMode.Assembly,bool Ĩ=true){if(!μ.
- ContainsKey(Χ[26])){Ȋ(ύ(ë,J,ς,Ą,Ĩ),Χ[26]);if(!DZ())return false;}return ǯ(Χ[26]);}IEnumerator<bool>ύ(ƀ ë,double J,List<int>ς,
- MyAssemblerMode Ą,bool Ĩ){MyDefinitionId á=MyDefinitionId.Parse(Ā(ë));List<int>Ī=new List<int>();for(int E=0;E<ς.Count;E++){if(E>0&&!DZ(
- ))yield return true;if(ą(ʫ[ς[E]],á,Ą)){if(Ī.Count>0&&((IMyAssembler)ʫ[ς[E]].B).IsQueueEmpty)Ī.Insert(0,ς[E]);else Ī.Add(ς
- [E]);}}if(Ο>0&&Ą==MyAssemblerMode.Disassembly)Ī.RemoveRange(0,(int)Math.Min(Ο,Math.Ceiling((double)Ī.Count/2.0)));if(Ī.
- Count>0){int č,Ƨ,ϲ;č=Math.DivRem((int)J,Ī.Count,out Ƨ);for(int E=0;E<Ī.Count&&E<J;E++){ϲ=č;if(E<Ƨ)ϲ++;if(ϲ>0)while(!ϱ(á,ϲ,(
- IMyAssembler)ʫ[Ī[E]].B,Ą,Ĩ))yield return true;}}yield return false;}bool ϱ(MyDefinitionId á,double J,IMyAssembler ă,MyAssemblerMode
- Ą,bool Ĩ=true){if(!μ.ContainsKey(Χ[33])){Ȋ(ϰ(á,J,ă,Ą,Ĩ),Χ[33]);if(!DZ())return false;}return ǯ(Χ[33]);}IEnumerator<bool>ϰ(
- MyDefinitionId á,double J,IMyAssembler ă,MyAssemblerMode Ą,bool Ĩ){bool ϳ;ă.Mode=Ą;if(ă.Mode!=Ą)ă.Mode=Ą;if(ă.Mode==Ą){if(ă.
- IsQueueEmpty)ă.AddQueueItem(á,J);else{List<MyProductionItem>ķ=new List<MyProductionItem>();bool ϼ=false;double Ͻ=0,ϻ=0;if(Ą==
- MyAssemblerMode.Assembly)Ͻ=í(á);ă.GetQueue(ķ);ϳ=false;for(int E=0;!ϳ&&E<ķ.Count;E++){if(E>0&&!DZ())yield return true;if(ķ[E].BlueprintId
- .SubtypeName==á.SubtypeName)ϳ=true;}if(ϳ||Ą==MyAssemblerMode.Assembly)for(int E=0;E<ķ.Count;E++){if(E>0&&!DZ())yield
- return true;if(!ϳ&&Ą==MyAssemblerMode.Assembly)ϻ=í(ķ[E].BlueprintId);if((!ϳ&&Ͻ<=ϻ)||ķ[E].BlueprintId.SubtypeName==á.
- SubtypeName){ă.InsertQueueItem(E,á,J);ϼ=true;break;}}if(!ϼ)ă.AddQueueItem(á,J);}if(Ĩ)ȇ(á.SubtypeName,Ą==MyAssemblerMode.Assembly,J,
- true);}yield return false;}bool Ϻ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ϲ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<
- bool>Ϲ(){Ǒ Þ;double ϣ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;if(õ(out Þ,$"{Ħ.Value.ª}/{Ħ.Value.ß}")
- ){ϣ=Math.Floor(Þ.ƣ());if(ϣ>0)while(!ϸ(Ħ.Value,ϣ))yield return true;}}yield return false;}bool ϸ(ƀ ë,double J,
- MyAssemblerMode Ą=MyAssemblerMode.Assembly){if(!μ.ContainsKey(Χ[35])){Ȋ(Ϸ(ë,J,Ą),Χ[35]);if(!DZ())return false;}return ǯ(Χ[35]);}
- IEnumerator<bool>Ϸ(ƀ ë,double J,MyAssemblerMode Ą){double ϵ,ϴ=J;List<MyProductionItem>ķ=new List<MyProductionItem>();for(int E=0;E<
- Ͱ.Count&&ϴ>0;E++){IMyAssembler ă;try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch{continue;}if(!DZ())yield return true;if(ă.Mode==Ą&&!
- ă.IsQueueEmpty){ķ.Clear();ă.GetQueue(ķ);for(int ĥ=ķ.Count-1;ĥ>=0&&ϴ>0;ĥ--){if(!DZ())yield return true;if(ķ[ĥ].BlueprintId.
- SubtypeName==ë.á){ϵ=(double)ķ[ĥ].Amount;if(ϵ>ϴ)ϵ=ϴ;ă.RemoveQueueItem(ĥ,(MyFixedPoint)ϵ);ȇ(ë.á,Ą==MyAssemblerMode.Assembly,-ϵ,true);
- ϴ-=ϵ;}}}}yield return false;}bool ϯ(string Į){if(!μ.ContainsKey(Į)){Ȋ(Ϥ(),Į);if(!DZ())return false;}return ǯ(Į);}
- IEnumerator<bool>Ϥ(){Ǒ Þ;double ϣ;foreach(KeyValuePair<string,ƀ>Ħ in ʨ){if(!DZ())yield return true;if(õ(out Þ,
- $"{Ħ.Value.ª}/{Ħ.Value.ß}")){ϣ=Math.Floor(Þ.Ƣ());if(ϣ>0)while(!ϸ(Ħ.Value,ϣ,MyAssemblerMode.Disassembly))yield return true;}}yield return false;}
- bool Ϣ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϡ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ϡ(){if(ː.Count>1)while(!
- Ϡ(ː))yield return true;if(ˠ.Count>1)while(!Ϡ(ˠ))yield return true;if(ˢ.Count>1)while(!Ϡ(ˢ))yield return true;if(ˡ.Count>1
- )while(!Ϡ(ˡ))yield return true;if(ˑ.Count>1)while(!Ϡ(ˑ))yield return true;yield return false;}bool Ϡ(List<int>Ī){if(!μ.
- ContainsKey(Χ[39])){Ȋ(ϟ(Ī),Χ[39]);if(!DZ())return false;}return ǯ(Χ[39]);}IEnumerator<bool>ϟ(List<int>Ī){List<MyInventoryItem>ō=new
- List<MyInventoryItem>();ǂ Ì;for(int E=1;E<Ī.Count;E++){if(!DZ())yield return true;ō.Clear();try{Ì=ʫ[Ī[E]];}catch{continue;}Ì.
- B.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ì.ƿ.ŭ(ō[ĥ])<=0.0)while(!ŗ(ō[ĥ],Ī[E]
- ,0,false,E))yield return true;}}yield return false;}bool Ϟ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϝ(),Į);if(!DZ())return false;
- }return ǯ(Į);}IEnumerator<bool>ϝ(){List<Ƃ>Γ=new List<Ƃ>();List<MyProductionItem>ķ=new List<MyProductionItem>();
- IMyAssembler ă;MyAssemblerMode Ą;for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;ķ.Clear();try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch
- {continue;}if(!ă.IsQueueEmpty&&ă.Mode!=MyAssemblerMode.Disassembly){ă.GetQueue(ķ);if(ķ.Count>1){Ą=ă.Mode;Γ.Clear();for(
- int ĥ=0;ĥ<ķ.Count;ĥ++){if(!DZ())yield return true;Γ.Add(new Ƃ{J=í(ķ[ĥ].BlueprintId),Ɓ=(int)ķ[ĥ].Amount,Ģ=ķ[ĥ].BlueprintId.
- SubtypeName});}if(Ą==MyAssemblerMode.Assembly)Γ=Γ.OrderBy(ĥ=>ĥ.J).ToList();else Γ=Γ.OrderByDescending(ĥ=>ĥ.J).ToList();if(Γ[0].Ģ==ķ
- [0].BlueprintId.SubtypeName){Γ.RemoveAt(0);for(int ĥ=ķ.Count-1;ĥ>=1;ĥ--){if(!DZ())yield return true;ă.RemoveQueueItem(ĥ,ķ[
- ĥ].Amount);}}else if(ă.CurrentProgress>0){for(int ĥ=ķ.Count-1;ĥ>=0;ĥ--){if(!DZ())yield return true;if(ĥ!=0)ă.
- RemoveQueueItem(ĥ,ķ[ĥ].Amount);else if((double)ķ[ĥ].Amount>1)ă.RemoveQueueItem(ĥ,(MyFixedPoint)((double)ķ[ĥ].Amount-1));}}else ă.
- ClearQueue();for(int ĥ=0;ĥ<Γ.Count;ĥ++){if(!DZ())yield return true;while(!ϱ(MyDefinitionId.Parse($"{ɼ}/{Γ[ĥ].Ģ}"),Γ[ĥ].Ɓ,ă,Ą,false)
- )yield return true;}}}}yield return false;}bool Ϯ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ϭ(),Į);if(!DZ())return false;}return ǯ
- (Į);}IEnumerator<bool>ϭ(){List<int>Ϭ=new List<int>(),ϫ=new List<int>();Dictionary<string,ƀ>Ϫ=new Dictionary<string,ƀ>(),ϩ
- =new Dictionary<string,ƀ>();List<MyProductionItem>ķ=new List<MyProductionItem>();string Ģ;IMyAssembler ă;bool Ϩ=false,ϧ,Ϧ
- ;double J;for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;}catch{continue;}if(!ă.
- IsQueueEmpty)Ϩ=true;if(ă.Mode==MyAssemblerMode.Assembly||ă.IsQueueEmpty)Ϭ.Add(Ͱ[E]);else ϫ.Add(Ͱ[E]);}if(Ϩ&&(Ϭ.Count>1||ϫ.Count>1)){
- for(int E=0;E<Ͱ.Count;E++){if(!DZ())yield return true;ķ.Clear();try{ă=(IMyAssembler)ʫ[Ͱ[E]].B;ă.GetQueue(ķ);ϧ=ă.Mode==
- MyAssemblerMode.Assembly;}catch{continue;}Ϧ=!ϧ&&E<Ο&&E<Math.Ceiling((double)Ͱ.Count/2.0);for(int ĥ=ķ.Count-1;ĥ>=0;ĥ--){if(!DZ())yield
- return true;J=(double)ķ[ĥ].Amount;if(ķ.Count>1&&ĥ==0&&J<=50&&!Ϧ)break;Ģ=ķ[ĥ].BlueprintId.SubtypeName;if(J>1||ĥ>0){if(!Ϧ){J=
- Math.Ceiling(J*0.9);if(J==(double)ķ[ĥ].Amount&&ĥ==0)J-=1;}if(J>0){if(ϧ){if(!Ϫ.ContainsKey(Ģ))Ϫ[Ģ]=new ƀ{J=J,á=Ģ};else Ϫ[Ģ].J
- +=J;}else{if(!ϩ.ContainsKey(Ģ))ϩ[Ģ]=new ƀ{J=J,á=Ģ};else ϩ[Ģ].J+=J;}ă.RemoveQueueItem(ĥ,J);}}}}foreach(KeyValuePair<string,
- ƀ>Ħ in Ϫ){if(!DZ())yield return true;while(!σ(Ħ.Value,Ħ.Value.J,Ϭ,MyAssemblerMode.Assembly,false))yield return true;}
- foreach(KeyValuePair<string,ƀ>Ħ in ϩ){if(!DZ())yield return true;while(!σ(Ħ.Value,Ħ.Value.J,ϫ,MyAssemblerMode.Disassembly,false)
- )yield return true;}}yield return false;}bool Ȯ(List<int>Ī,string Į){if(!μ.ContainsKey(Į)){Ȋ(ĭ(Ī),Į);if(!DZ())return false
- ;}return ǯ(Į);}IEnumerator<bool>ĭ(List<int>Ī){ű Ã=Ñ();while(!ĵ(Ã,Ī))yield return true;if(Ã.V.Count>0)while(!Ĭ(Ã.V,Ī,ʊ))
- yield return true;if(Ã.ŧ.Count>0)while(!Ĭ(Ã.ŧ,Ī,ʃ))yield return true;if(Ã.Ű.Count>0)while(!Ĭ(Ã.Ű,Ī,ʄ))yield return true;if(Ã.
- ũ.Count>0)while(!Ĭ(Ã.ũ,Ī,ʅ))yield return true;if(Ã.Ũ.Count>0)while(!Ĭ(Ã.Ũ,Ī,ʆ))yield return true;yield return false;}bool
- Ĭ(SortedList<string,double>Ã,List<int>Ī,string ĩ){if(!μ.ContainsKey(Χ[25])){Ȋ(ī(Ã,Ī,ĩ),Χ[25]);if(!DZ())return false;}
- return ǯ(Χ[25]);}IEnumerator<bool>ī(SortedList<string,double>Ã,List<int>Ī,string ĩ){double Ĩ;int ö=0;List<MyInventoryItem>Ë=
- new List<MyInventoryItem>();IMyTerminalBlock B,ħ;for(int E=0;E<Ī.Count;E++){foreach(KeyValuePair<string,double>Ħ in Ã){if(ö
- >0&&!DZ())yield return true;Ĩ=0;try{B=ʫ[Ī[E]].B;}catch{continue;}while(!ě(ref Ĩ,ĩ,Ħ.Key,B))yield return true;if(Õ(Ĩ,Ħ.
- Value/(double)Ī.Count,0.05)){Ë.Clear();B.GetInventory(0).GetItems(Ë);for(int ĥ=Ë.Count-1;ĥ>=0;ĥ--){if(!DZ())yield return true;
- if(!Ø(ĩ,Ë[ĥ])||Ë[ĥ].Type.SubtypeId!=Ħ.Key)Ë.RemoveAt(ĥ);}if(Ë.Count>0){double Ĥ=Ĩ-(Ħ.Value/(double)Ī.Count);SortedList<int
- ,double>đ=new SortedList<int,double>();for(int ĥ=0;ĥ<Ī.Count;ĥ++){if(E!=ĥ){if(!DZ())yield return true;Ĩ=0;try{ħ=ʫ[Ī[ĥ]].B;
- }catch{continue;}while(!ě(ref Ĩ,ĩ,Ħ.Key,ħ))yield return true;if(Ó(Ĩ,Ħ.Value/(double)Ī.Count,0.05))đ[Ī[ĥ]]=Ĩ;}}if(đ.Count>
- 0)while(!Ė(Ë[0],B,đ,Ĥ))yield return true;}}ö++;}}yield return false;}bool ĵ(ű Ĩ,List<int>ē,string ª="",string ß=""){if(!μ
- .ContainsKey(Χ[8])){Ȋ(Ĵ(Ĩ,ē,ª,ß),Χ[8]);if(!DZ())return false;}return ǯ(Χ[8]);}IEnumerator<bool>Ĵ(ű Ĩ,List<int>ē,string ª,
- string ß){List<MyInventoryItem>Ë=new List<MyInventoryItem>();for(int E=0;E<ē.Count;E++){if(E>0&&!DZ())yield return true;Ë.Clear
- ();try{ʫ[ē[E]].B.GetInventory(0).GetItems(Ë);}catch{continue;}for(int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if((ª.
- Length==0||Ë[ĥ].Type.TypeId==ª)&&(ß.Length==0||Ë[ĥ].Type.SubtypeId==ß))Ĩ.ū(Ë[ĥ]);}}yield return false;}bool ij(string Į){if(!μ.
- ContainsKey(Į)){Ȋ(IJ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>IJ(){string ß;SortedList<int,double>đ;List<
- MyInventoryItem>Ë=new List<MyInventoryItem>();for(int E=0;E<ˎ.Count;E++){if(E>0&&!DZ())yield return true;ǂ B;try{B=ʫ[ˎ[E]];}catch{
- continue;}IMyInventory ı=B.B.GetInventory(0);Ë.Clear();ı.GetItems(Ë);for(int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if(ì(Ë
- [ĥ],B)){ß=Ë[ĥ].Type.SubtypeId;if(ǟ(Ë[ĥ])){if(ß=="Ice"){if(ˣ.Count>0){đ=İ(ˣ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else
- {if(ˮ.Count>0){đ=İ(ˮ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}}else if(ǜ(Ë[ĥ])){if(ˤ.Count>0){đ=İ(ˤ);while(!Ė(Ë[ĥ],B.B,đ
- ))yield return true;}}else if(Ǡ(Ë[ĥ])&&ß=="Stone"){if(ˏ.Count>0){đ=İ(ˏ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else if(
- Ǟ(Ë[ĥ])&&ß=="Canvas"){if(ˍ.Count>0){đ=İ(ˍ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}else if(Ǥ(Ë[ĥ])&&ʐ){if(Ë[ĥ].Type.
- TypeId==ʁ&&ˋ.Count>0){đ=İ(ˋ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}else if(Ë[ĥ].Type.TypeId==ʂ&&ˌ.Count>0){đ=İ(ˌ);while(!Ė(Ë
- [ĥ],B.B,đ))yield return true;}else if(ˣ.Count>0){đ=İ(ˣ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}if(ç(Ë[ĥ])){if(ˬ.Count>0
- ){đ=İ(ˬ);while(!Ė(Ë[ĥ],B.B,đ))yield return true;}}}}}yield return false;}SortedList<int,double>İ(List<int>µ){SortedList<
- int,double>Ę=new SortedList<int,double>();for(int E=0;E<µ.Count;E++)Ę[µ[E]]=-1;return Ę;}bool Ė(MyInventoryItem Ö,
- IMyTerminalBlock B,SortedList<int,double>đ,double ĕ=-1){if(!μ.ContainsKey(Χ[10])){Ȋ(Ĕ(Ö,B,đ,ĕ),Χ[10]);if(!DZ())return false;}return ǯ(Χ[
- 10]);}IEnumerator<bool>Ĕ(MyInventoryItem Ö,IMyTerminalBlock B,SortedList<int,double>ē,double ė){IMyTerminalBlock Ì;
- SortedList<int,double>đ=new SortedList<int,double>(ē);List<int>Đ=new List<int>();double ď;for(int E=0;E<đ.Count;E+=0){if(!DZ())
- yield return true;try{if(!Ğ(ʫ[đ.Keys[E]],Ö))đ.RemoveAt(E);else{Đ.Add(đ.Keys[E]);E++;}}catch{}}if(đ.Count>0){ű Ã=Ñ();while(!ĵ(
- Ã,Đ,Ö.Type.TypeId,Ö.Type.SubtypeId))yield return true;Đ.Clear();double Ď=(double)Ö.Amount;if(ė>0&&Ď>ė)Ď=ė;double č,Č,ċ,Ē,
- Ċ=ʸ["balanceRange"];bool ę=Ǵ(Ö);Ã.ū(Ö.Type.TypeId,Ö.Type.SubtypeId,Ď);if(Ã.š()>0&&đ.Count>0){double ģ=Ã.ŭ(Ö)/(double)đ.
- 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;
- }while(!ě(ref ď,Ö,Ì))yield return true;đ[đ.Keys[E]]=ď;}if(ď>ģ+(ģ*Ċ))đ.RemoveAt(E);else E++;}}if(đ.Count>0){č=Ď/(double)đ.
- Count;int Ģ,ġ=0;if(đ.Count>1)ġ=α.Next(0,đ.Count-1);try{Ē=è(Ö,ʫ[đ.Keys[0]].B);}catch{Ē=double.MaxValue;}bool Ġ=false;double ğ=
- ʫ[đ.Keys[0]].ǀ.ŭ(ref Ġ,Ö);if(Ġ)Ē=ğ;for(int E=0;E<đ.Count;E++){ď=đ.Values[E];Ģ=đ.Keys[E];if(!DZ())yield return true;if(ď==-
- 1){ď=0;try{Ì=ʫ[đ.Keys[E]].B;}catch{continue;}while(!ě(ref ď,Ö,Ì))yield return true;}if(ę)ċ=č;else{if(E==ġ)ċ=Math.Ceiling(
- č);else ċ=Math.Floor(č);}if(ċ>Ē)ċ=Ē;if(ď>0&&ċ+ď>Ē)ċ=Ē-ď;if(!ę){if(E==ġ)ċ=Math.Ceiling(ċ);else ċ=Math.Floor(ċ);}Č=ċ;while(
- !ä(ref ċ,B.GetInventory(0),ʫ[đ.Keys[E]],Ö))yield return true;if(ċ>0){Ď-=Č-ċ;č=Ď/((double)đ.Count-(E+1));}}}}yield return
- false;}bool Ğ(ǂ Ì,MyInventoryItem Ö){IMyTerminalBlock B=Ì.B;bool ĝ=false;double Ĝ=Ì.ǀ.ŭ(ref ĝ,Ö);if(ĝ&&Ĝ<=0)return false;if(B
- is IMyRefinery){if(ǟ(Ö)){if(B.BlockDefinition.SubtypeName==ɻ){if(ʵ["basicRefineryTypes"].Contains(Ö.Type.SubtypeId))return
- true;Ǒ Þ=õ(Ö.Type.ToString());if(Þ!=null)return Þ.Ɨ;}}}if(ǜ(Ö)&&ʧ.ContainsKey(Ì.B.BlockDefinition.ToString())){return ʧ[Ì.B.
- BlockDefinition.ToString()]==Ö.Type.SubtypeId;}return true;}bool ě(ref double J,MyInventoryItem Ö,IMyTerminalBlock B){if(!μ.ContainsKey
- (Χ[11])){Ȋ(Ě(Ö.Type.TypeId,Ö.Type.SubtypeId,B),Χ[11]);if(!DZ())return false;}if(ǯ(Χ[11])){J=0+Τ;Τ=0;return true;}return
- false;}bool ě(ref double J,string ô,string ß,IMyTerminalBlock B){if(!μ.ContainsKey(Χ[11])){Ȋ(Ě(ô,ß,B),Χ[11]);if(!DZ())return
- false;}if(ǯ(Χ[11])){J=0+Τ;Τ=0;return true;}return false;}IEnumerator<bool>Ě(string ô,string ß,IMyTerminalBlock B){List<
- MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë);for(int E=0;E<Ë.Count;E++){if(!DZ())yield return true;if(Ë[E
- ].Type.TypeId==ô&&Ë[E].Type.SubtypeId==ß)Τ+=(double)Ë[E].Amount;}yield return false;}bool Œ(string Į){if(!μ.ContainsKey(Į
- )){Ȋ(ő(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ő(){List<MyInventoryItem>Ë=new List<MyInventoryItem>();ű
- Ã=Ñ();double Ĝ=0,Ő=0;bool ĝ=false;ǂ Ì;for(int E=0;E<ʫ.Count;E++){if(!DZ())yield return true;try{ʫ[E].Ĥ=Ñ();Ì=ʫ[E];}catch{
- continue;}if(!DZ())yield return true;if(Ì.ǀ.š()>0){Ë.Clear();Ì.B.GetInventory(0).GetItems(Ë);if(!DZ())yield return true;Ã=Ñ();for(
- int ĥ=0;ĥ<Ë.Count;ĥ++){if(!DZ())yield return true;if(æ(Ì,Ë[ĥ]))Ã.ū(Ë[ĥ]);}foreach(KeyValuePair<string,double>Ħ in Ã.V){if(!DZ
- ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʊ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.V[Ħ.Key]=Ő;}foreach(KeyValuePair<string,double>Ħ in
- Ã.Ũ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʆ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.Ũ[Ħ.Key]=Ő;}foreach(KeyValuePair<string,
- double>Ħ in Ã.Ű){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʄ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.Ű[Ħ.Key]=Ő;}foreach(KeyValuePair<
- string,double>Ħ in Ã.ũ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʅ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.ũ[Ħ.Key]=Ő;}foreach(
- KeyValuePair<string,double>Ħ in Ã.ŧ){if(!DZ())yield return true;Ĝ=Ì.ǀ.ŭ(ref ĝ,ʃ,Ħ.Key);Ő=Ħ.Value-Ĝ;if(ĝ&&Ő>0)Ì.Ĥ.ŧ[Ħ.Key]=Ő;}}}yield
- return false;}bool ŏ(string Į){if(!μ.ContainsKey(Į)){Ȋ(œ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>œ(){string q
- ;List<MyInventoryItem>ō=new List<MyInventoryItem>();IMyTerminalBlock B;ǂ Ì;string ŝ=ё("manualKeyword");for(int E=0;E<ʫ.
- Count;E++){try{Ì=ʫ[E];B=Ì.B;}catch{continue;}if(!DZ())yield return true;q=Ȁ(B);bool Ŝ=q.Contains("+in"),ś=q.Contains("+out"),Ś
- =q.Contains("-in"),ř=q.Contains("-out"),Ř=q.Contains(ŝ);if(Ì.Ĥ.š()>0){ō.Clear();B.GetInventory(0).GetItems(ō);for(int ĥ=0
- ;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ì.Ĥ.ŭ(ō[ĥ])>0)while(!ŗ(ō[ĥ],E,0,true))yield return true;}}if(Ś||(!Ř&&ǽ(Ì,0))
- ){ō.Clear();B.GetInventory(0).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(Ś||ǽ(ō[ĥ],Ì))while(!ŗ(ō
- [ĥ],E,0))yield return true;}}if(B.InventoryCount>1&&(ř||(!Ř&&ǽ(Ì,1)))){ō.Clear();B.GetInventory(1).GetItems(ō);for(int ĥ=
- 0;ĥ<ō.Count;ĥ++){if(!DZ())yield return true;if(ř||ǽ(ō[ĥ],Ì))while(!ŗ(ō[ĥ],E,1))yield return true;}}}yield return false;}
- bool ŗ(MyInventoryItem Ö,int ŕ,int Ŕ,bool Ĥ=false,int Ŏ=-1){if(!μ.ContainsKey(Χ[14])){Ȋ(Ŗ(Ö,ŕ,Ŕ,Ĥ,Ŏ),Χ[14]);if(!DZ())return
- false;}return ǯ(Χ[14]);}IEnumerator<bool>Ŗ(MyInventoryItem Ö,int ŕ,int Ŕ,bool Ĥ,int Ŏ){ǂ B=ʫ[ŕ];IMyTerminalBlock ħ;string ª=Ö
- .Type.TypeId;double ã=(double)Ö.Amount,Ŀ;if(Ĥ)ã=B.Ĥ.ŭ(Ö);if(ã>(double)Ö.Amount)ã=(double)Ö.Amount;Ŀ=ã;IMyInventory â=B.B.
- GetInventory(Ŕ);List<int>ľ=ˎ;if(Ŀ>0.0){if(Ǟ(Ö))ľ=ˠ;else if(ǝ(Ö))ľ=ˑ;else if(ǜ(Ö))ľ=ː;else if(Ǡ(Ö))ľ=ˢ;else if(ǟ(Ö))ľ=ˡ;for(int E=0;E
- <ľ.Count&&(Ŏ<=0||E<Ŏ);E++){if(!DZ())yield return true;try{ħ=ʫ[ľ[E]].B;}catch{continue;}if(B.B!=ħ){while(!ä(ref ã,â,ʫ[ľ[E]]
- ,Ö))yield return true;if(ã<=0)break;}}if(!DZ())yield return true;try{if(B.Ĥ.ŭ(Ö)>0.0)ʫ[ŕ].Ĥ.ū(Ö.Type.TypeId,Ö.Type.
- SubtypeId,-(Ŀ-ã));}catch{}}yield return false;}int Ľ(float ļ,float Ê){long Ļ,ĺ;Ļ=Math.DivRem((long)ļ,(long)Ê,out ĺ);if(ĺ>0)Ļ++;
- return(int)Ļ;}bool Ĺ(string Į){if(!μ.ContainsKey(Į)){Ȋ(ĸ(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ĸ(){ƀ ë;List
- <MyProductionItem>ķ=new List<MyProductionItem>();ǂ Ì;ű Ã;bool Ķ;for(int E=0;E<Ͱ.Count;E++){if(E>0&&!DZ())yield return true
- ;ķ.Clear();try{Ì=ʫ[Ͱ[E]];Ì.ƽ.Ŧ();((IMyAssembler)Ì.B).GetQueue(ķ);Ķ=((IMyAssembler)Ì.B).Mode==MyAssemblerMode.Assembly;}
- catch{continue;}for(int ĥ=0;ĥ<ķ.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;ȇ(ķ[ĥ],Ķ);if(ʨ.TryGetValue(ķ[ĥ].BlueprintId.
- SubtypeName,out ë)&&ȱ(ë.ſ)){Ã=new ű(ë.ſ);Ã.ť((double)ķ[ĥ].Amount);Ì.ƽ.Ţ(Ã);}}}Ȑ(ref ʳ);if(!DZ())yield return true;Ȑ(ref ʲ);if(!DZ())
- yield return true;Ȑ(ref ʱ);if(!DZ())yield return true;Ȑ(ref ʰ);if(!DZ())yield return true;Ȑ(ref ʯ);yield return false;}bool ŀ(
- string Į){if(!μ.ContainsKey(Į)){Ȋ(Ō(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>Ō(){List<MyInventoryItem>ō=new
- List<MyInventoryItem>();string ŋ=ё("preventCountingKeyword");IMyTerminalBlock B;for(int E=0;E<ʫ.Count;E++){if(E>0&&!DZ())
- yield return true;if(!ø(E))continue;try{B=ʫ[E].B;}catch{continue;}if(!B.CustomData.ToLower().Contains(ŋ)){ō.Clear();try{B.
- GetInventory(0).GetItems(ō);}catch{continue;}for(int ĥ=0;ĥ<ō.Count;ĥ++){if(ĥ>0&&!DZ())yield return true;Ɵ(ō[ĥ]);}if(B.InventoryCount>
- 1){if(!DZ())yield return true;ō.Clear();B.GetInventory(1).GetItems(ō);for(int ĥ=0;ĥ<ō.Count;ĥ++){if(ĥ>0&&!DZ())yield return
- true;Ɵ(ō[ĥ]);}}}}ȓ(ref ʳ);if(!DZ())yield return true;ʛ=0;ȓ(ref ʲ,true);if(!DZ())yield return true;ȓ(ref ʱ);if(!DZ())yield
- return true;ȓ(ref ʰ);if(!DZ())yield return true;ȓ(ref ʯ);ˇ=new TimeSpan(0,0,0);yield return false;}bool Ŋ(string Į){if(!μ.
- ContainsKey(Į)){Ȋ(ʼn(),Į);if(!DZ())return false;}return ǯ(Į);}IEnumerator<bool>ʼn(){ˮ.Clear();Ͱ.Clear();ˬ.Clear();ˤ.Clear();ˣ.Clear();
- ˢ.Clear();ˡ.Clear();ˠ.Clear();ˑ.Clear();ː.Clear();ˏ.Clear();ˎ.Clear();ˍ.Clear();ˌ.Clear();ˋ.Clear();ʫ.Clear();ʪ.Clear();ʩ
- .Clear();ʬ.Clear();ʭ.Clear();string K=ё("itemPanelKeyword"),X=ё("outputPanelKeyword"),A=ё("storageKeyword"),u=ё(
- "statusPanelKeyword"),ň=ё("includeGridKeyword"),Ň=ё("crossGridControlKeyword");bool ņ=ʷ["sameGridOnly"];if(!DZ())yield return true;List<
- IMyTerminalBlock>Ņ=new List<IMyTerminalBlock>();ʻ.GetBlocksOfType<IMyTerminalBlock>(Ņ);List<IMyCubeGrid>ń=new List<IMyCubeGrid>{Me.
- CubeGrid};IMyTerminalBlock Ê;for(int E=0;E<Ņ.Count;E++){if(!DZ())yield return true;Ê=Ņ[E];if(Ê.CubeGrid!=Me.CubeGrid&&(Ê.
- InventoryCount>0||(Ê is IMyTextPanel))&&Ê.CustomData.Length>0&&Ê.CustomData.ToLower().Replace(" ","").Contains(ň)){if(!ń.Contains(Ê.
- CubeGrid))ń.Add(Ê.CubeGrid);}}if(!DZ())yield return true;ʻ.GetBlocksOfType<IMyEntity>(ʭ);for(int E=ʭ.Count-1;E>=0;E--){if(!DZ())
- yield return true;Ê=ʭ[E];if(!(Ê.IsFunctional&&(!ņ||ń.Contains(Ê.CubeGrid)||(Ê.CustomData.Length>0&&Ê.CustomData.ToLower().
- Replace(" ","").Contains(Ň)))&&(Ê.InventoryCount>0||(Ê is IMyTextPanel&&C(Ê,K,A,X,u))||(Ê is IMyTimerBlock&&Ɂ(Ê))||(Ê is
- IMyProgrammableBlock))&&((Ê is IMyProgrammableBlock)||!Ê.CustomData.ToLower().Contains(ɹ))))ʭ.RemoveAt(E);}try{IMyBlockGroup Ń=ʻ.
- GetBlockGroupWithName("NDS Exclude");Ń.GetBlocks(ʬ);}catch{}yield return false;}bool ł(ref string ĉ,ű Ã,char Y='[',char w=']',bool Á=true,int
- À=4){if(!μ.ContainsKey(Χ[19])){Ȋ(Ä(Ã,Á,À,Y,w),Χ[19]);if(!DZ())return false;}if(ǯ(Χ[19])){ĉ=λ.ToString();λ.Clear();return
- true;}return false;}IEnumerator<bool>Ä(ű Ã,bool Á,int À,char Y,char w){while(!Â(Ã.V,ё("itemAmmoKeyword"),Y,w,Á,À))yield
- return true;while(!Â(Ã.Ű,ё("itemIngotKeyword"),Y,w,Á,À))yield return true;while(!Â(Ã.ũ,ё("itemOreKeyword"),Y,w,Á,À))yield
- return true;while(!Â(Ã.Ũ,ё("itemComponentKeyword"),Y,w,Á,À))yield return true;while(!Â(Ã.ŧ,ё("itemToolKeyword"),Y,w,Á,À))yield
- return true;yield return false;}bool Â(SortedList<string,double>µ,string ª,char Y,char w,bool Á,int À){if(!μ.ContainsKey(Χ[20]
- )){Ȋ(º(µ,ª,Y,w,Á,À),Χ[20]);if(!DZ())return false;}return ǯ(Χ[20]);}IEnumerator<bool>º(SortedList<string,double>µ,string ª,
- 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(
- $"{w}");Ë=0;}if(Ë>0)λ.Append(":");else λ.Append(Y);if(Á)λ.Append($"{µ.Values[E]}:{ª}:'{Ƕ(ª,µ.Keys[E])}'");else{if(Ë==0)λ.
- Append($"{ª}:'{Ƕ(ª,µ.Keys[E])}'");else λ.Append($"'{Ƕ(ª,µ.Keys[E])}'");}if(E+1>=µ.Count)λ.Append("]");Ë++;}if(À>0&&µ.Count>0)λ
- .AppendLine();yield return false;}void Ï(){if(!μ.ContainsKey(Χ[21])){Ȋ(Î(),Χ[21]);if(!DZ())return;}ʓ=ǯ(Χ[21]);}IEnumerator
- <bool>Î(){Ÿ("Bulletproof Glass","BulletproofGlass",ʆ,"BulletproofGlass");Ÿ("Canvas","Canvas",ʆ,"Canvas");Ÿ("Computer",
- "Computer",ʆ,"ComputerComponent");yield return true;Ÿ("Construction Comp","Construction",ʆ,"ConstructionComponent");Ÿ(
- "Detector Component","Detector",ʆ,"DetectorComponent");Ÿ("Display","Display",ʆ,"Display");yield return true;Ÿ("Explosives","Explosives",ʆ,
- "ExplosivesComponent");Ÿ("Girder","Girder",ʆ,"GirderComponent");Ÿ("Gravity Gen. Comp","GravityGenerator",ʆ,"GravityGeneratorComponent");yield
- return true;Ÿ("Interior Plate","InteriorPlate",ʆ,"InteriorPlate");Ÿ("Large Steel Tube","LargeTube",ʆ,"LargeTube");Ÿ(
- "Medical Component","Medical",ʆ,"MedicalComponent");yield return true;Ÿ("Metal Grid","MetalGrid",ʆ,"MetalGrid");Ÿ("Motor","Motor",ʆ,
- "MotorComponent");Ÿ("Power Cell","PowerCell",ʆ,"PowerCell");yield return true;Ÿ("Radio Comm. Comp","RadioCommunication",ʆ,
- "RadioCommunicationComponent");Ÿ("Reactor Component","Reactor",ʆ,"ReactorComponent");Ÿ("Small Steel Tube","SmallTube",ʆ,"SmallTube");yield return
- true;Ÿ("Solar Cell","SolarCell",ʆ,"SolarCell");Ÿ("Steel Plate","SteelPlate",ʆ,"SteelPlate");Ÿ("Superconductor",
- "Superconductor",ʆ,"Superconductor");yield return true;Ÿ("Thruster Component","Thrust",ʆ,"ThrustComponent");Ÿ("Zone Chip","ZoneChip",ʆ,
- "",false);Ÿ("Automatic Rifle","AutomaticRifleItem",ʃ,"AutomaticRifle");yield return true;Ÿ("Precise Rifle",
- "PreciseAutomaticRifleItem",ʃ,"PreciseAutomaticRifle");Ÿ("Rapid Fire Rifle","RapidFireAutomaticRifleItem",ʃ,"RapidFireAutomaticRifle");Ÿ(
- "Ultimate Rifle","UltimateAutomaticRifleItem",ʃ,"UltimateAutomaticRifle");yield return true;Ÿ("Welder 1","WelderItem",ʃ,"Welder");Ÿ(
- "Welder 2","Welder2Item",ʃ,"Welder2");Ÿ("Welder 3","Welder3Item",ʃ,"Welder3");yield return true;Ÿ("Welder 4","Welder4Item",ʃ,
- "Welder4");Ÿ("Grinder 1","AngleGrinderItem",ʃ,"AngleGrinder");Ÿ("Grinder 2","AngleGrinder2Item",ʃ,"AngleGrinder2");yield return
- true;Ÿ("Grinder 3","AngleGrinder3Item",ʃ,"AngleGrinder3");Ÿ("Grinder 4","AngleGrinder4Item",ʃ,"AngleGrinder4");Ÿ("Drill 1",
- "HandDrillItem",ʃ,"HandDrill");yield return true;Ÿ("Drill 2","HandDrill2Item",ʃ,"HandDrill2");Ÿ("Drill 3","HandDrill3Item",ʃ,
- "HandDrill3");Ÿ("Drill 4","HandDrill4Item",ʃ,"HandDrill4");yield return true;Ÿ("Datapad","Datapad",ʀ,"Datapad",false);Ÿ("Powerkit",
- "Powerkit",ɾ,"",false);Ÿ("Medkit","Medkit",ɾ,"",false);yield return true;Ÿ("Clang Cola","ClangCola",ɾ,"",false);Ÿ("Cosmic Coffee",
- "CosmicCoffee",ɾ,"",false);Ÿ("SpaceCredit","SpaceCredit",ɽ,"",false);yield return true;Ÿ("Oxygen Bottle","OxygenBottle",ʁ,
- "OxygenBottle");Ÿ("Hydrogen Bottle","HydrogenBottle",ʂ,"HydrogenBottle");Ÿ("NATO 5.56x45mm","NATO_5p56x45mm",ʊ,
- "NATO_5p56x45mmMagazine");yield return true;Ÿ("NATO 25x184mm","NATO_25x184mm",ʊ,"NATO_25x184mmMagazine");Ÿ("Missile 200mm","Missile200mm",ʊ,
- "Missile200mm");Ÿ("Cobalt Ore","Cobalt",ʅ);yield return true;Ÿ("Gold Ore","Gold",ʅ);Ÿ("Ice","Ice",ʅ);Ÿ("Iron Ore","Iron",ʅ);yield
- return true;Ÿ("Magnesium Ore","Magnesium",ʅ);Ÿ("Nickel Ore","Nickel",ʅ);Ÿ("Platinum Ore","Platinum",ʅ);yield return true;Ÿ(
- "Scrap Ore","Scrap",ʅ,"",false);Ÿ("Silicon Ore","Silicon",ʅ);Ÿ("Silver Ore","Silver",ʅ);yield return true;Ÿ("Stone","Stone",ʅ);Ÿ(
- "Uranium Ore","Uranium",ʅ);Ÿ("Cobalt Ingot","Cobalt",ʄ);yield return true;Ÿ("Gold Ingot","Gold",ʄ);Ÿ("Gravel","Stone",ʄ);Ÿ(
- "Iron Ingot","Iron",ʄ,"",true,new List<string>(){"Scrap","Stone"});yield return true;Ÿ("Magnesium Powder","Magnesium",ʄ);Ÿ(
- "Nickel Ingot","Nickel",ʄ,"",true,new List<string>(){"Stone"});Ÿ("Platinum Ingot","Platinum",ʄ,"");yield return true;Ÿ("Silicon Wafer"
- ,"Silicon",ʄ,"",true,new List<string>(){"Stone"});Ÿ("Silver Ingot","Silver",ʄ);Ÿ("Uranium Ingot","Uranium",ʄ);yield
- return false;}int Í(ǂ Ì){try{if(Ì.B!=null){IMyTerminalBlock B=Ì.B;if(!((IMyFunctionalBlock)B).Enabled)return-1;else{if(B is
- IMyAssembler){if(((IMyAssembler)B).IsProducing||!((IMyAssembler)B).IsQueueEmpty)return 1;else return 0;}else if(B is IMyRefinery){
- List<MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë);if(Ë.Count==0)return 0;else return 1;}else
- if(B is IMyGasGenerator){List<MyInventoryItem>Ë=new List<MyInventoryItem>();B.GetInventory(0).GetItems(Ë,Ê=>Ê.Type.
- SubtypeId=="Ice");if(Ë.Count==0)return 0;else return 1;}else if(B is IMyReactor){if(B.GetInventory(0).ItemCount==0)return 0;else
- return 1;}else if(B is IMyUserControllableGun){if(B.GetInventory(0).ItemCount==0)return 0;else return 1;}}}}catch{}return-1;}
- bool É(ű Ç,string g,char Y='[',char w=']',char Æ='|',bool Å=true){if(!μ.ContainsKey(Χ[22])){Ȋ(È(Ç,g,Y,w,Æ,Å),Χ[22]);if(!DZ())
- return false;}return ǯ(Χ[22]);}IEnumerator<bool>È(ű Ç,string g,char Y,char w,char Æ,bool Å){string v=g.ToLower().Replace(" ",
- ""),W,t,U,T,S,R,Q;bool P,O,N,M,V;T=ё("itemIngotKeyword");S=ё("itemOreKeyword");if(!DZ())yield return true;R=ё(
- "itemToolKeyword");Q=ё("itemAmmoKeyword");if(!DZ())yield return true;int L;double J;string[]I,H,G;ʥ[Χ[22]]=$"Text: {g}";if(v.Contains(Y.
- ToString())){G=v.Split(new char[]{Y},StringSplitOptions.RemoveEmptyEntries);for(int F=0;F<G.Length;F++){if(!DZ())yield return
- 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()));
- 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
- 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.
- 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(":"
- ))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
- 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
- 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
- true;if(M)while(!Ɏ(Ç,ʰ,t,false,J))yield return true;if(N)while(!Ɏ(Ç,ʱ,t,false,J))yield return true;if(V)while(!Ɏ(Ç,ʯ,t,false
- ,J))yield return true;}}}}}}yield return false;}bool C(IMyTerminalBlock B,string K,string A,string X,string u){string r=B
- .CustomName.Replace(" ","").ToLower(),q=Ȁ(B);return r.Contains(K)||r.Contains(ɸ)||r.Contains(ɷ)||r.Contains(ɶ)||r.
- Contains(ɵ)||r.Contains(ɿ)||r.Contains(A)||r.Contains(X)||r.Contains(u)||q.Contains("[panel:");}MySprite p(IMyTextSurface h,
- string g,Vector2 f,Vector2 e,Color o,string Z="Monospace",TextAlignment n=κ){Vector2 m=h.MeasureStringInPixels(new
- 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,(
- 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,
- e,o,Z,n,(float)k);}List<MySprite>j(IMyTextSurface h,string g,Vector2 f,Vector2 e,Color d,Color c,string Z="Monospace",
- 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)}
- ;return Ð;}string î(string r,int ù=20){if(r.Length<=ù)return r;return
- $"{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.
- Position)&&Ì.B.IsFunctional)return true;}catch{}return false;}bool õ(out Ǒ Þ,string ô){string ª=ô.Substring(0,ô.IndexOf("/")),ß=
- ô.Substring(ô.IndexOf("/")+1);if(ǜ(ª)&&ʯ.TryGetValue(ß,out Þ))return true;if(Ǟ(ª)&&ʱ.TryGetValue(ß,out Þ))return true;if(
- Ǡ(ª)&&ʳ.TryGetValue(ß,out Þ))return true;if(ǟ(ª)&&ʲ.TryGetValue(ß,out Þ))return true;if(ǝ(ª)&&ʰ.TryGetValue(ß,out Þ))
- return true;Þ=null;return false;}Ǒ õ(string ô){string ª=ô.Substring(0,ô.IndexOf("/")),ß=ô.Substring(ô.IndexOf("/")+1);Ǒ Þ;if(ǜ
- (ª)&&ʯ.TryGetValue(ß,out Þ))return Þ;if(Ǟ(ª)&&ʱ.TryGetValue(ß,out Þ))return Þ;if(Ǡ(ª)&&ʳ.TryGetValue(ß,out Þ))return Þ;if
- (ǟ(ª)&&ʲ.TryGetValue(ß,out Þ))return Þ;if(ǝ(ª)&&ʰ.TryGetValue(ß,out Þ))return Þ;return null;}string ó(double ò){if(ò<1)
- return$"{Ǫ(ò*100.0)}";if(ò==1)return"100";if(ò<10)return$"{Math.Floor(ò*100.0)}";return"999";}string ñ(double ï){if(ï==0)
- return"0";if(ï<0.0001)return ï.ToString("0.0E0");if(ï<10)return ú(ï,4);if(ï<100)return ú(ï,3);if(ï<1000)return ú(ï,2);if(ï<
- 10000)return ú(ï,1);if(ï<1000000)return Math.Floor(ï).ToString();if(ï<10000000)return
- $"{ú(ï/1000000.0,3)}{ʹ["millionsSuffix"]}";if(ï<100000000)return$"{ú(ï/1000000.0,2)}{ʹ["millionsSuffix"]}";if(ï<1000000000)return
- $"{ú(ï/1000000.0,1)}{ʹ["millionsSuffix"]}";if(ï<10000000000)return$"{ú(ï/1000000000.0,3)}{ʹ["billionsSuffix"]}";if(ï<100000000000)return
- $"{ú(ï/1000000000.0,2)}{ʹ["billionsSuffix"]}";if(ï<1000000000000)return$"{ú(ï/1000000000.0,1)}{ʹ["billionsSuffix"]}";return ï.ToString("0.00E0");}string ð(double ï){
- string Y="";if(ï<0)Y="-";return$"{Y}{ñ(Math.Abs(ï))}";}string ú(double ï,int ć){return(Math.Floor(ï*(Math.Pow(10.0,ć)))/(Math.
- Pow(10.0,ć))).ToString();}void Ĉ(ref StringBuilder Ć,Ǒ Þ){Ć.Append($"Name={Þ.ǐ}||Quota={Þ.Ç}");if(Þ.Ɩ)Ć.AppendLine(
- $"<{Þ.Ɯ}");else Ć.AppendLine();Ć.Append($"^Type={Þ.ª}||Subtype={Þ.ß}");if(Þ.á.Length!=0)Ć.Append(
- $"||Blueprint={Þ.á}||Assembly Multiplier={Þ.Ʊ}||Disassembly Multiplier={Þ.Ɗ}||Assemble={Þ.ƚ}||Disassemble={Þ.ƙ}");if(ǟ(Þ.ª)){Ć.Append($"||Refine={Þ.Ƙ}||BasicRefine={Þ.Ɨ}");}Ć.Append($"||Fuel={Þ.ƛ}||Display={Þ.ŷ}");if(Ǡ(Þ.ª)){Ć.
- Append("||Ore Keys=[");for(int E=0;E<Þ.Ŷ.Count;E++){if(E!=0)Ć.Append("|");Ć.Append(Þ.Ŷ[E]);}Ć.Append("]");}Ć.AppendLine();}
- bool ą(ǂ B,MyDefinitionId á,MyAssemblerMode Ą){IMyAssembler ă=(IMyAssembler)B.B;string q=B.Ǔ();bool Ă=false,ā=false;if(Ϗ(
- "assemblyOnlyKeyword",q))Ă=true;else if(Ϗ("disassemblyOnlyKeyword",q))ā=true;if((Ă&&Ą==MyAssemblerMode.Disassembly)||(ā&&Ą==MyAssemblerMode.
- Assembly))return false;return ă.CanUseBlueprint(á)&&(ă.IsQueueEmpty||ă.Mode==Ą);}string Ā(ƀ ë){return$"{ɼ}/{ë.á}";}double ÿ(ƀ ë,
- bool þ=false){Ǒ Þ;if(õ(out Þ,$"{ë.ª}/{ë.ß}")){if(þ)return Þ.ƨ(ʸ["allowedExcessPercent"]);return Þ.Ʃ();}return 0;}double ý(
- IMyTerminalBlock B){try{string q=Ȁ(B),ü=ё("priorityTag"),û;if(q.Contains(ü)){û=q.Substring(q.IndexOf(ü)+ü.Length);û=û.Substring(0,û.
- IndexOf(">"));return double.Parse(û);}}catch{}return 1;}double í(MyDefinitionId á){ƀ ë;if(ʨ.TryGetValue(á.SubtypeName,out ë)){
- return à(ë.ª,ë.ß);}return-1;}double à(string ª,string ß){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}"))return Þ.ơ();return 100;}bool Ý(string Ü){
- if(!ʿ.ContainsKey(Ü)){ʿ[Ü]=new TimeSpan(0,0,0);return true;}return ʿ[Ü].TotalMilliseconds<=0.0;}TimeSpan Û(double Ú){
- return TimeSpan.FromSeconds(Ú);}double Ù(IMyTerminalBlock B){return(double)B.GetInventory(0).MaxVolume-(double)B.GetInventory(
- 0).CurrentVolume;}bool Ø(string ª,MyInventoryItem Ö){return(ǜ(ª)&&ǜ(Ö))||(Ǟ(ª)&&Ǟ(Ö))||(Ǡ(ª)&&Ǡ(Ö))||(ǟ(ª)&&ǟ(Ö))||(ǝ(ª)
- &&ǝ(Ö));}bool Õ(double J,double Ò,double Ô){return J>Ò+(Ò*Ô);}bool Ó(double J,double Ò,double Ô){return J<Ò-(Ò*Ô);}ű Ñ(){ű
- Ã=new ű{Ū=this};return Ã;}bool ì(MyInventoryItem Ö,ǂ B){string q=B.Ǔ(),ß=Ö.Type.SubtypeId;if(!q.Contains("<distribute>")
- &&B.ƿ.ŭ(Ö)>0)return false;return(ǟ(Ö)&&ê(Ö))||ǜ(Ö)||ç(Ö)||(ˏ.Count>0&&Ǡ(Ö)&&ß=="Stone")||(Ǟ(Ö)&&ß=="Canvas")||(Ǥ(Ö)&&ʐ);}
- bool ê(MyInventoryItem Ö){Ǒ é;if(õ(out é,Ö.Type.ToString()))return é.Ƙ;return true;}double è(MyInventoryItem Ö,
- IMyTerminalBlock B){string ß=Ö.Type.SubtypeId;if(B is IMyGasGenerator){if(ǟ(Ö)&&ß=="Ice")return ʸ["icePerO2/H2Generator"];}else if(B is
- IMyRefinery){if(ʛ>0)return((double)B.GetInventory(0).MaxVolume/ʛ)/Ǿ(Ö);}else if(B is IMyUserControllableGun)return ʶ["ammoPerGun"];
- else if(B is IMyReactor)return ʸ["fuelPerReactor"];else if(B is IMyParachute)return ʶ["canvasPerParachute"];return double.
- MaxValue;}bool ç(MyInventoryItem Ö){Ǒ Þ;if(õ(out Þ,Ö.Type.ToString()))return Þ.ƛ;return false;}bool æ(ǂ B,MyInventoryItem Ö){
- bool å=false;B.ǀ.ŭ(ref å,Ö);return å;}bool ä(ref double ã,IMyInventory â,ǂ Ł,MyInventoryItem Ö){if(!μ.ContainsKey(Χ[23])){Ȋ(
- Ǽ(ã,â,Ł,Ö),Χ[23]);if(!DZ())return false;}bool Ş=ǯ(Χ[23]);if(Ş){ã-=Υ;Υ=0;return true;}return false;}IEnumerator<bool>Ǽ(
- double ã,IMyInventory â,ǂ Ł,MyInventoryItem Ö){IMyInventory ǻ=Ł.B.GetInventory(0);bool Ǻ=false,ǹ=false;double À=Ł.ǀ.ŭ(ref Ǻ,Ö)
- ,ď=0,Ǹ=ǵ(Ö,Ł.B),Ƿ=ã;if(Ǻ){while(!ě(ref ď,Ö,Ł.B))yield return true;if((À<=0||ď>=À))ǹ=true;else if(Ƿ+ď>À)Ƿ=À-ď;}if(!ǹ){if(Ƿ
- >Ǹ)Ƿ=Ǹ;if(!Ǵ(Ö))Ƿ=Math.Floor(Ƿ);if(Ƿ>0){if(ǻ.TransferItemFrom(â,Ö,(MyFixedPoint)Ƿ)){ƃ(
- $"Moved {ð(Ƿ).PadRight(6)} {î(Ƕ(Ö),12).PadRight(12)} to {î(Ł.B.CustomName,12).PadRight(12)}");Υ=Ƿ;}}}yield return false;}string Ƕ(MyInventoryItem Ö){return Ƕ(Ö.Type.TypeId,Ö.Type.SubtypeId);}string Ƕ(string ª,
- string ß){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}"))return Þ.ǐ;return ß;}double ǵ(MyInventoryItem Ö,IMyTerminalBlock B){return Ù(B)/Ǿ(Ö);}
- bool Ǵ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().UsesFractions;}bool ǽ(ǂ Ȃ,int Ŕ){IMyTerminalBlock B=Ȃ.B;if(Ȃ.ƶ)return
- Ŕ==1;if(B is IMyRefinery)return Ŕ==1;if(B is IMyAssembler){IMyAssembler ă=(IMyAssembler)B;return(ă.IsQueueEmpty||((ă.Mode
- ==MyAssemblerMode.Assembly&&Ŕ==1)||(ă.Mode==MyAssemblerMode.Disassembly&&Ŕ==0)));}if(B is IMyReactor||B is IMyParachute||B
- is IMyUserControllableGun||B is IMySafeZoneBlock)return false;return true;}bool Ȅ(IMyTerminalBlock B){string ȃ=B.
- BlockDefinition.ToString().ToLower();for(int E=0;E<ʵ["gravelSifterKeys"].Count;E++){if(ȃ.Contains(ʵ["gravelSifterKeys"][E].ToLower()))
- return true;}return false;}bool ǽ(MyInventoryItem Ö,ǂ Ȃ){IMyTerminalBlock B=Ȃ.B;if(ǿ(Ȃ,Ö)||ȁ(Ȃ,Ö)||(B is IMyGasGenerator&&(Ö.
- Type.SubtypeId=="Ice"||(Ǥ(Ö)&&ʐ))))return false;if(B is IMyAssembler){IMyAssembler ă=(IMyAssembler)B;if(Ǟ(Ö)||ǝ(Ö)||ǜ(Ö))
- return ă.IsQueueEmpty||ă.Mode==MyAssemblerMode.Assembly;else if(Ǡ(Ö))return ă.IsQueueEmpty||ă.Mode==MyAssemblerMode.
- Disassembly;}if(B is IMyShipWelder&&((IMyShipWelder)B).Enabled&&Ǟ(Ö))return false;return true;}bool ȁ(ǂ B,MyInventoryItem Ö){if(Ǟ(Ö
- ))return B.Ʒ;else if(ǝ(Ö))return B.Ƹ;else if(ǜ(Ö))return B.ƻ;else if(Ǡ(Ö))return B.ƺ;else if(ǟ(Ö))return B.ƹ;return false
- ;}string Ȁ(IMyTerminalBlock B){return B.CustomData.ToLower();}bool ǿ(ǂ B,MyInventoryItem Ö){return B.ƿ.ŭ(Ö)>0.0;}double Ǿ
- (MyInventoryItem Ö){return Ö.Type.GetItemInfo().Volume;}bool Ǥ(MyInventoryItem Ö){return Ǥ(Ö.Type.TypeId);}bool Ǥ(string
- ª){return ɣ(ª,ʂ)||ɣ(ª,ʁ);}bool Ǡ(string ª){return ɣ(ª,ʄ)||ɣ(ª,ɸ)||(ª.Length>1&&ǣ(ɸ,ª));}bool ǟ(string ª){return ɣ(ª,ʅ)||ɣ
- (ª,ɷ)||(ª.Length>1&&ǣ(ɷ,ª));}bool ǜ(string ª){return ɣ(ª,ʊ)||ɣ(ª,ɿ)||(ª.Length>1&&ǣ(ɿ,ª));}bool Ǟ(string ª){return ɣ(ª,ʆ)
- ||ɣ(ª,ɶ)||(ª.Length>1&&ǣ(ɶ,ª));}bool ǝ(string ª){return ɣ(ª,ʃ)||Ǥ(ª)||ɣ(ª,ʀ)||ɣ(ª,ɾ)||ɣ(ª,ɽ)||ɣ(ª,ɵ)||(ª.Length>1&&(ǣ(ʃ,ª)
- ||ǣ(ʀ,ª)||ǣ(ɾ,ª)||ǣ(ɽ,ª)||ǣ(ɵ,ª)));}bool ǣ(string Ǣ,string ǡ){return Ǣ.Replace(" ","").ToLower().StartsWith(ǡ.Replace(" ",
- "").ToLower());}bool Ǡ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsIngot;}bool ǟ(MyInventoryItem Ö){return Ö.Type.
- GetItemInfo().IsOre;}bool Ǟ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsComponent;}bool ǝ(MyInventoryItem Ö){return Ö.Type.
- GetItemInfo().IsTool||ǝ(Ö.Type.TypeId);}bool ǜ(MyInventoryItem Ö){return Ö.Type.GetItemInfo().IsAmmo;}bool Dz(IMyTerminalBlock B){
- string Þ=B.BlockDefinition.ToString();Þ=Þ.Substring(Þ.IndexOf("_")+1);if(ʵ["excludedDefinitions"].Contains(Þ))return true;if(B
- .CustomData.ToLower().Contains(ɹ))return true;return ʬ.Contains(B);}bool DZ(double ǰ=0.9){return(Runtime.
- CurrentInstructionCount<(Runtime.MaxInstructionCount*ʸ["actionLimiterMultiplier"]*ǰ)&&(DateTime.Now-ʈ).TotalMilliseconds<ʸ["runTimeLimiter"]*ǰ)
- ;}bool ǯ(string Į){ʇ=Į;bool Ǯ;DateTime ǭ=DateTime.Now,Ǭ;try{Ǯ=μ[Į].MoveNext();Ǭ=DateTime.Now;}catch{ƃ(
- $"Error in function: {Į} : {ʥ[Į]}");ƈ(Į);return true;}if(Į.Length!=0&&ˀ.ContainsKey(Į))ˀ[Į]=ˀ[Į]+(Ǭ-ǭ);if(!Ǯ){string ǫ;if(ˀ[Į].TotalMilliseconds>0&&ʾ[Į]>0
- )ǫ=$"{Ǫ(ˀ[Į].TotalMilliseconds/(double)ʾ[Į])}ms/tick";else ǫ="0ms/tick";ʺ[Į]=
- $"{Ǫ(ˀ[Į].TotalMilliseconds)} ms/{ʾ[Į]} ticks = {ǫ}";ƈ(Į);}return!Ǯ;}double Ǫ(double ï,int ǩ=2){return Math.Round(ï,ǩ);}void Ǩ(){int ǧ=ʶ["averageTicks"];if(ǧ>0){if(Φ==null
- ||Φ.Length!=ǧ){Φ=new double[ǧ];ʚ=0;for(int E=0;E<Φ.Length;E++)Φ[E]=-1;}Φ[ʚ]=Runtime.LastRunTimeMs;ʚ++;if(ʚ>=Φ.Length)ʚ=0;
- double Ǧ=0,ǥ=0;for(int E=0;E<Φ.Length;E++){if(Φ[E]!=-1){Ǧ+=Φ[E];ǥ++;}}Σ=Ǧ/ǥ;}else if(Φ!=null)Φ=null;}void ƃ(string ĉ){if(ĉ.
- Length!=0){if(ĉ.StartsWith("Error")){ʖ++;ʕ++;}bool dz=true;for(int E=0;E<ʽ.Count;E++){if(ʽ[E].g==ĉ){ʽ[E].Ĩ++;ʽ.Move(E,0);dz=
- false;break;}}if(dz)ʽ.Insert(0,new Ƅ{g=ĉ});int ȅ=ʶ["outputLimit"];if(ʽ.Count>ȅ)ʽ.RemoveRange(ȅ,ʽ.Count-ȅ);}}List<MySprite>ȣ(
- ref StringBuilder Ć,ref Vector2 Ȣ,bool ȡ,Vector2 Ƞ,Vector2 ȟ,Color c,Color Ȟ,Color ȝ,string Z,double Ȝ,IMyTextSurface h,
- string g,Vector2 ț,Vector2 Ț,Vector2 ș,Vector2 Ș,Vector2 ȗ){string Ȗ=$"{ó(Ȝ).PadLeft(5)}%";Ȣ+=new Vector2(0f,ȟ.Y);if(ȡ){List<
- MySprite>Ð=new List<MySprite>{new MySprite(SpriteType.TEXTURE,"SquareSimple",Ȣ+(Ƞ/2f),Ƞ,c),p(h,g,Ȣ,Ț,ȝ,Z),p(h,Ȗ,Ȣ+ȗ,ș,Ȟ,Z),};Ð.
- AddRange(ȭ(Ȣ+Ș,ț,Ȝ,true));return Ð;}else Ć.AppendLine($"{g} {Ȗ}");return new List<MySprite>();}void ȕ(){if(ʝ>=10&&ʽ.Count>0){
- StringBuilder Ć=new StringBuilder();foreach(KeyValuePair<string,string>Ħ in ʺ)Ć.AppendLine($"{Ħ.Key} : {Ħ.Value}");ʝ=0;List<
- IMyTextPanel>Ȥ=new List<IMyTextPanel>();ʻ.GetBlocksOfType<IMyTextPanel>(Ȥ,Ê=>Ê.IsFunctional&&Ê.CustomName.ToLower().Contains(
- "runtime"));for(int E=0;E<Ȥ.Count;E++){Ȥ[E].ContentType=ContentType.TEXT_AND_IMAGE;Ȥ[E].WriteText(Ć.ToString());}}}List<MySprite>
- ȭ(Vector2 f,Vector2 e,double Ȭ,bool ȫ=false,IMyTextSurface h=null,string Z="Monospace"){List<MySprite>Ð=new List<MySprite
- >();double ò=Ȭ;if(ò>1.0)ò=1.0;Color o;if(ȫ)o=new Color((int)(150f*(float)ò),(int)(70f*(1f-(float)ò)),0);else o=new Color(
- (int)(150f*(1f-(float)ò)),(int)(70f*(float)ò),0);Vector2 Ȫ=э(e.X,e.Y);Ð.Add(new MySprite(SpriteType.TEXTURE,
- "SquareSimple",f+э(0f,Ȫ.Y/2f),Ȫ,Color.DarkSlateGray,null,κ));Ð.Add(new MySprite(SpriteType.TEXTURE,"SquareSimple",f+э(0f,Ȫ.Y/2f),э(Ȫ.X
- *(float)ò,Ȫ.Y),o,null,κ));if(h!=null)Ð.Add(p(h,$"{ó(Ȭ)}%".PadRight(6),f,э(e.X*0.8f,e.Y),Color.Black,Z));return Ð;}bool ȩ(
- string ȧ){if(!μ.ContainsKey(Χ[53])){Ȋ(Ȩ(ȧ),Χ[53]);if(!DZ())return false;}return ǯ(Χ[53]);}IEnumerator<bool>Ȩ(string ȧ){string Ȧ
- =ȧ.Replace("||",";"),ª,ß,Ģ,Ȍ,r,ȥ;string[]Ȕ=Ȧ.Split(';');double Ç,Ȇ,ȏ=0;int ö;if(ȍ(Ȕ[0],out Ģ,out Ȍ)){r=Ȍ;if(!ȍ(Ȕ[1],out Ģ
- ,out Ȍ)||!double.TryParse(Ȍ,out Ç)){if(Ȍ.Contains("<")){ö=Ȍ.IndexOf("<");ȥ=Ȍ.Substring(ö+1);Ȍ=Ȍ.Substring(0,ö);ȏ=double.
- Parse(ȥ);Ç=double.Parse(Ȍ);}else Ç=0;}if(ȏ<Ç)ȏ=Ç;if(ȍ(Ȕ[2],out Ģ,out Ȍ)){ª=Ȍ;if(ȍ(Ȕ[3],out Ģ,out Ȍ)){ß=Ȍ;ȋ(ª,ß);if(!DZ())yield
- return true;Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}")){Þ.Ç=Ç;Þ.ª=ª;Þ.ǐ=r;Þ.Ɯ=ȏ;Þ.Ɩ=Ç!=ȏ;for(int E=4;E<Ȕ.Length;E++){if(E>4&&!DZ())yield return
- true;try{ö=Ȕ[E].IndexOf("=");Ȇ=0;if(ö!=-1){Ģ=Ȕ[E].Substring(0,ö);Ȍ=Ȕ[E].Substring(ö+1);double.TryParse(Ȍ,out Ȇ);}else Ģ=Ȕ[E]
- ;switch(Ģ.Replace(" ","").ToLower()){case"blueprint":Þ.á=Ȍ;break;case"assemblymultiplier":Þ.Ʊ=Ȇ;break;case
- "disassemblymultiplier":Þ.Ɗ=Ȇ;break;case"assemble":Þ.ƚ=ɣ(Ȍ,ʡ);break;case"disassemble":Þ.ƙ=ɣ(Ȍ,ʡ);break;case"refine":Þ.Ƙ=ɣ(Ȍ,ʡ);break;case
- "basicrefine":Þ.Ɨ=ɣ(Ȍ,ʡ);break;case"display":Þ.ŷ=ɣ(Ȍ,ʡ);break;case"orekeys":string[]Ŷ=Ȍ.Substring(1,Ȍ.Length-2).Split('|');if(Ŷ.
- Length>0){Þ.Ŷ.Clear();Þ.Ŷ.AddRange(Ŷ);}break;case"fuel":Þ.ƛ=ɣ(Ȍ,ʡ);break;case"recipe":break;}}catch{}}if(!DZ())yield return
- true;if(!ɣ(Þ.ß,ß)){ƃ($"{Þ.ß}({Þ.ß.Length}) != {ß}({ß.Length})");string Ȏ=Þ.ß;Þ.ß=ß;Ÿ(Þ.ǐ,Þ.ß,Þ.ª,Þ.á,Þ.ŷ,Þ.Ŷ);Ɵ(new
- MyInventoryItem(new MyItemType(Þ.ª,ß),1,(MyFixedPoint)Þ.Ǐ));ȇ(Þ.á,true,Þ.ǎ,true);ȇ(Þ.á,false,Þ.Ǎ,true);if(ǜ(Þ.ª))ʯ.Remove(Ȏ);else if(Ǟ(
- Þ.ª))ʱ.Remove(Ȏ);else if(Ǡ(Þ.ª))ʳ.Remove(Ȏ);else if(ǟ(Þ.ª))ʲ.Remove(Ȏ);else if(ǝ(Þ.ª))ʰ.Remove(Ȏ);}if(Þ.á.Length>0)ʨ[Þ.á]
- =ɓ(Þ);}}}}}bool ȍ(string g,out string Ģ,out string Ȍ){int ö=g.IndexOf("=");if(ö!=-1){Ģ=g.Substring(0,ö);Ȍ=g.Substring(ö+1
- );return true;}Ģ=g;Ȍ=g;return false;}void ȋ(string Ģ,string ß){if(Ǡ(Ģ)){if(!ʳ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǟ(
- Ģ)){if(!ʲ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(Ǟ(Ģ)){if(!ʱ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǜ(Ģ)){if(!ʯ.
- ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}else if(ǝ(Ģ)){if(!ʰ.ContainsKey(ß))Ÿ(ß,ß,Ģ,"",true);}}void Ȋ(IEnumerator<bool>ȉ,string Į){μ[Į]=ȉ;ˀ
- [Į]=new TimeSpan(0,0,0);ʾ[Į]=1;ʥ[Į]="initialize";}void Ȉ(){Runtime.UpdateFrequency=UpdateFrequency.None;Runtime.
- UpdateFrequency&=~UpdateFrequency.Update1;Runtime.UpdateFrequency&=~UpdateFrequency.Update10;Runtime.UpdateFrequency&=~UpdateFrequency.
- Update100;if(ʶ["updateFrequency"]==100)Runtime.UpdateFrequency=UpdateFrequency.Update100;else if(ʶ["updateFrequency"]==1)Runtime.
- UpdateFrequency=UpdateFrequency.Update1;else{if(ʶ["updateFrequency"]!=10){ʶ["updateFrequency"]=10;ʒ=true;}Runtime.UpdateFrequency=
- UpdateFrequency.Update10;}}void ȇ(string á,bool Ķ,double J,bool Ž){ƀ ë;if(ʨ.TryGetValue(á,out ë))ȇ(ë.ª,ë.ß,Ķ,J,Ž);}void ȇ(
- MyProductionItem Ö,bool Ķ,bool Ž=false){if(ʨ.ContainsKey(Ö.BlueprintId.SubtypeName)){ƀ ë=ʨ[Ö.BlueprintId.SubtypeName];ȇ(ë.ª,ë.ß,Ķ,(
- double)Ö.Amount,Ž);}}void ȇ(string ª,string ß,bool Ķ,double J,bool Ž){Ǒ Þ;if(õ(out Þ,$"{ª}/{ß}")){if(Ķ)Þ.Ʈ((MyFixedPoint)J,Ž);
- else Þ.ƭ((MyFixedPoint)J,Ž);}}void ȓ(ref SortedList<string,Ǒ>µ,bool Ȓ=false){bool ȑ=ѐ("dynamicQuota"),ƍ=ѐ(
- "dynamicQuotaIncreaseWhenLow");int Ə=я("dynamicQuotaPositiveThreshold"),Ɛ=я("dynamicQuotaNegativeThreshold");double Ô=щ(
- "dynamicQuotaPercentageIncrement"),ƒ=щ("dynamicQuotaMaxMultiplier");for(int E=0;E<µ.Count;E++){µ.Values[E].Ɣ(ˇ.TotalSeconds,ƒ,ȑ,Ɛ,Ə,Ô,ƍ);if(Ȓ&&µ.Values[E
- ].ß!="Ice"&&µ.Values[E].Ǐ>=0.5&&µ.Values[E].Ƙ)ʛ++;}}void Ȑ(ref SortedList<string,Ǒ>µ){Ο=0;for(int E=0;E<µ.Count;E++){µ.
- Values[E].ư();Ο+=µ.Values[E].ǎ+µ.Values[E].Ʃ();}}void Ɵ(MyInventoryItem Ö,bool Ž=false){Ǒ Þ;if(õ(out Þ,Ö.Type.ToString()))Þ.Ɵ(
- Ö.Amount,Ž);}void ż(IMyTerminalBlock B){bool Ż=false,ź=Ϗ("autoConveyorKeyword",Ȁ(B)),Ź;if(B is IMyAssembler)((
- IMyProductionBlock)B).UseConveyorSystem=true;else if(B is IMyRefinery)((IMyProductionBlock)B).UseConveyorSystem=ź||ʷ[
- "useConveyorRefineries"];else if(B is IMyReactor)((IMyReactor)B).UseConveyorSystem=ź||ʷ["useConveyorReactors"];else if(B is IMyGasGenerator)((
- IMyGasGenerator)B).UseConveyorSystem=ź||ʷ["useConveyorH2/O2Gens"];else if(B is IMySmallGatlingGun){Ź=((IMySmallGatlingGun)B).
- UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMyLargeGatlingTurret){Ź=((IMyLargeGatlingTurret)B).
- UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMyLargeMissileTurret){Ź=((IMyLargeMissileTurret)B).
- UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMySmallMissileLauncherReload){Ź=((IMySmallMissileLauncherReload
- )B).UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}else if(B is IMySmallMissileLauncher){Ź=((
- IMySmallMissileLauncher)B).UseConveyorSystem;if(ź||ʷ["useConveyorGuns"])Ż=!Ź;else Ż=Ź;}if(Ż)B.ApplyAction("UseConveyor");}void Ÿ(string r,
- string ß,string ª,string á="",bool ŷ=true,List<string>Ŷ=null){Ǒ ŵ=new Ǒ{ª=ª,ß=ß,ǐ=r,á=á,ŷ=ŷ};if(Ǡ(ª))ŵ.Ŷ.Add(ß);if(Ŷ!=null)ŵ.Ŷ
- .AddRange(Ŷ);ŵ.Ŷ=ŵ.Ŷ.Distinct().ToList();if(Ǡ(ª)&&ß=="Uranium")ŵ.ƛ=true;if(Ǡ(ª))ʳ[ß]=ŵ;else if(ǟ(ª))ʲ[ß]=ŵ;else if(Ǟ(ª))ʱ
- [ß]=ŵ;else if(ǝ(ª))ʰ[ß]=ŵ;else if(ǜ(ª))ʯ[ß]=ŵ;if(ŵ.á.Length>0)ʨ[á]=ɓ(ŵ);}void Ŵ(){if(!μ.ContainsKey("Timer"))Ȋ(ų(),
- "Timer");else ǯ("Timer");}IEnumerator<bool>ų(){int Ų=ʶ["updateFrequency"];ˈ-=ˁ;ˇ+=ˁ;ˆ-=ˁ;ʝ+=Ų;ʜ+=Ų;for(int E=0;E<ʿ.Count;E++){
- if(!DZ())yield return true;try{if(ʿ.Values[E].TotalMilliseconds>0.0)ʿ[ʿ.Keys[E]]=ʿ.Values[E]-ˁ;}catch{}}if(Ξ>0.0){for(int E
- =0;E<ʉ.Count;E++){if(!DZ())yield return true;try{if(ʉ.Values[E].TotalMilliseconds>0.0)ʉ[ʉ.Keys[E]]=ʉ.Values[E]-ˁ;}catch{}}
- }ˁ=new TimeSpan(0,0,0);yield return false;}void ž(){if(!ʏ){try{ʏ=true;for(int E=0;E<ʾ.Count;E++)ʾ[ʾ.Keys[E]]=ʾ.Values[E]+
- 1;}catch{ƃ("Error advancing state ticks");}}}void Ɖ(){if(!ʎ){try{ʎ=true;for(int E=0;E<ʣ.Count;E++)ʣ[ʣ.Keys[E]]=ʣ.Values[E
- ]+1;}catch{ƃ("Error advancing scroll ticks");}}}void ƈ(string Į){try{μ[Į].Dispose();}catch{}try{μ[Į]=null;}catch{}try{μ.
- Remove(Į);}catch{}try{ʾ.Remove(Į);}catch{}try{ˀ.Remove(Į);}catch{}try{ʥ.Remove(Į);}catch{}}class Ƈ{public MyAssemblerMode Ą;
- public List<MyProductionItem>ķ=new List<MyProductionItem>();public float Ɔ;public DateTime ƅ=DateTime.Now;}class Ƅ{public
- string g="";public int Ĩ=1;public string ƃ(){if(Ĩ>1)return$"{g} x{Ĩ}";else return g;}}class Ƃ{public double J=0;public string
- Ģ="",g="";public int Ɓ=0;}class ƀ{public string á="",ª="",ß="";public double J=0;public ű ſ;}class ű{public Program Ū;
- public SortedList<string,double>Ű=new SortedList<string,double>(),ũ=new SortedList<string,double>(),Ũ=new SortedList<string,
- double>(),ŧ=new SortedList<string,double>(),V=new SortedList<string,double>();public ű(ű Ç){Ű=new SortedList<string,double>(Ç.
- Ű);ũ=new SortedList<string,double>(Ç.ũ);Ũ=new SortedList<string,double>(Ç.Ũ);ŧ=new SortedList<string,double>(Ç.ŧ);V=new
- SortedList<string,double>(Ç.V);Ū=Ç.Ū;}public ű(){}public void Ŧ(){Ű.Clear();ũ.Clear();Ũ.Clear();ŧ.Clear();V.Clear();}public void ť
- (double Ô){Ť(Ű,Ô);Ť(ũ,Ô);Ť(Ũ,Ô);Ť(ŧ,Ô);Ť(V,Ô);}private void Ť(SortedList<string,double>µ,double Ô){for(int E=0;E<µ.Count;
- E++)µ.Values[E]*=Ô;}public void Ţ(ű ļ){Ŭ(ref Ű,ļ.Ű);Ŭ(ref ũ,ļ.ũ);Ŭ(ref Ũ,ļ.Ũ);Ŭ(ref ŧ,ļ.ŧ);Ŭ(ref V,ļ.V);}public int š(){
- return Ű.Count+ũ.Count+Ũ.Count+ŧ.Count+V.Count;}public Ǒ Š(int ö){int ş=ö;if(ş<Ű.Count)return new Ǒ{ª=Ū.ʄ,ß=Ű.Keys[ş],Ǐ=Ű.
- Values[ş]};ş-=Ű.Count;if(ş<ũ.Count)return new Ǒ{ª=Ū.ʅ,ß=ũ.Keys[ş],Ǐ=ũ.Values[ş]};ş-=ũ.Count;if(ş<Ũ.Count)return new Ǒ{ª=Ū.ʆ,ß=
- Ũ.Keys[ş],Ǐ=Ũ.Values[ş]};ş-=Ũ.Count;if(ş<ŧ.Count)return new Ǒ{ª=Ū.ʃ,ß=ŧ.Keys[ş],Ǐ=ŧ.Values[ş]};ş-=ŧ.Count;if(ş<V.Count)
- return new Ǒ{ª=Ū.ʊ,ß=V.Keys[ş],Ǐ=V.Values[ş]};return new Ǒ();}public string ţ(int ö){return Š(ö).ƕ();}public void ū(string ª,
- string ß,double J,bool ů=true){if(Ū.ǜ(ª)){if(!ů||!V.ContainsKey(ß))V[ß]=J;else V[ß]+=J;}else if(Ū.Ǟ(ª)){if(!ů||!Ũ.ContainsKey(
- ß))Ũ[ß]=J;else Ũ[ß]+=J;}else if(Ū.Ǡ(ª)){if(!ů||!Ű.ContainsKey(ß))Ű[ß]=J;else Ű[ß]+=J;}else if(Ū.ǟ(ª)){if(!ů||!ũ.
- ContainsKey(ß))ũ[ß]=J;else ũ[ß]+=J;}else if(Ū.ǝ(ª)){if(!ů||!ŧ.ContainsKey(ß))ŧ[ß]=J;else ŧ[ß]+=J;}}public void ū(MyInventoryItem Ö)
- {ū(Ö.Type.TypeId,Ö.Type.SubtypeId,(double)Ö.Amount);}public double ŭ(MyInventoryItem Ö){bool Ů=false;return ŭ(ref Ů,Ö);}
- public double ŭ(string ª,string ß){bool Ů=false;return ŭ(ref Ů,ª,ß);}public double ŭ(ref bool å,MyInventoryItem Ö){return ŭ(
- ref å,Ö.Type.TypeId,Ö.Type.SubtypeId);}public double ŭ(ref bool å,string ª,string ß){å=true;double Ĩ;if(Ū.ǜ(ª)){if(V.
- TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.Ǟ(ª)){if(Ũ.TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.Ǡ(ª)){if(Ű.TryGetValue(ß,out Ĩ))return
- Ĩ;}else if(Ū.ǟ(ª)){if(ũ.TryGetValue(ß,out Ĩ))return Ĩ;}else if(Ū.ǝ(ª)){if(ŧ.TryGetValue(ß,out Ĩ))return Ĩ;}å=false;return
- 0;}public void Ŭ(ref SortedList<string,double>ļ,SortedList<string,double>Ê){foreach(KeyValuePair<string,double>Ħ in Ê){if
- (ļ.ContainsKey(Ħ.Key))ļ[Ħ.Key]+=Ħ.Value;else ļ[Ħ.Key]=Ħ.Value;}}}class dž{public string ª="",DŽ="",ǃ="";}class ǂ{public
- IMyTerminalBlock B;public Ƈ ǁ;public ű ǀ,ƿ,Ĥ,ƾ,ƽ;public List<dž>Ƽ;public bool ƻ=false,ƺ=false,ƹ=false,Ƹ=false,Ʒ=false,ƶ=false,Ƶ=false,ƴ=
- false,Ƴ=false,Dž=false,LJ=false,ǚ=false,Ǜ=false,Ǚ=true,ǘ=false,Ǘ=false,ǖ=false;public double Ǖ=1;public int ǔ=0;public string Ǔ
- (){if(ǘ)return ǒ().GetText().ToLower();return B.CustomData.ToLower();}public IMyTextSurface ǒ(){if(B is IMyTextPanel)
- return(IMyTextSurface)B;else if((ǘ)&&((IMyTextSurfaceProvider)B).SurfaceCount>ǔ)return((IMyTextSurfaceProvider)B).GetSurface(ǔ
- );return null;}}class Ǒ{public string ª="",ß="",á="",ǐ="";public double Ǐ=0,ǎ=0,Ǎ=0,nj=0,Nj=0,NJ=0,Ç=0,lj=0,Lj=0,Ʋ=1,Ʊ=1,Ɗ=1,Ɲ
- =0,Ɯ=0;public bool ƛ=false,ƚ=true,ƙ=true,Ƙ=true,ŷ=true,Ɨ=false,Ɩ=false;public List<string>Ŷ=new List<string>();public
- string ƕ(){return ª+"/"+ß;}public void Ɣ(double Ɠ,double ƒ,bool Ƒ=true,int Ɛ=3,int Ə=9,double Ǝ=0.05,bool ƍ=true){if(Ɠ>0.0)lj=(
- 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(ƞ&&ƍ
- &&lj==0)Ƌ=Ɠ/-3.0;else if(Ǐ>=Ç&&Ƌ<=0.0)Ƌ=Ɠ/2.0;Ɲ+=Ƌ;double Ơ=0,Ư=0;if(Ɲ<0)Ơ=Math.Floor(Ɲ/-Ɛ);else Ư=Math.Floor(Ɲ/Ə);if(Ơ>0){
- if(Ʋ<ƌ){Ɲ=0;Ʋ+=Ǝ;if(Ơ>1)Ʋ+=Ǝ;}else Ɲ=-Ɛ;}else if(Ư>0){if(Ʋ>1){Ɲ=0;Ʋ-=Ǝ;if(Ư>1)Ʋ-=Ǝ;}else Ɲ=Ə;}if(Ʋ>ƌ)Ʋ=ƌ;if(Ʋ<1)Ʋ=1;}else
- Ʋ=1;}public void ư(){ǎ=Nj;Ǎ=NJ;Nj=0;NJ=0;}public void Ɵ(MyFixedPoint J,bool Ž){if(Ž)nj+=(double)J;else nj+=(double)J;}public
- void Ʈ(MyFixedPoint J,bool Ž){if(Ž)ǎ+=(double)J;else Nj+=(double)J;}public void ƭ(MyFixedPoint J,bool Ž){if(Ž)Ǎ+=(double)J;
- else NJ+=(double)J;}public double Ƭ(bool ƫ=true){double ƪ;if(ƫ)ƪ=Ç;else ƪ=Ɯ;if(ƪ<0)return Lj;return Math.Ceiling(ƪ*Ʋ)+Lj;}
- public double Ʃ(){if(!ƚ||Ǎ>0)return 0;if(Ǐ+ǎ<Ƭ())return Math.Floor(Ƭ()-(Ǐ+ǎ));return 0;}public double ƨ(double Ƨ){double Ʀ=Ƭ(
- false),ƥ,Ƥ=Ƨ;if(Ɯ!=Ç)Ƥ=0;if(!ƙ||(Ʀ==0&&Ç==0)||ǎ>0)return 0;ƥ=Ʀ*(1.0+Ƥ);if(Ǐ-Ǎ>ƥ)return(Ǐ-Ǎ)-ƥ;return 0;}public double ƣ(){
- double į=Ƭ(false);if(Ç<0&&į==0)return ǎ;if(į>0&&ǎ>0&&ǎ+Ǐ>į){if(Ǐ>=į)return ǎ;else return(ǎ+Ǐ)-į;}return 0;}public double Ƣ(){
- double į=Ƭ();if(į>0&&Ǎ>0&&Ǐ-Ǎ<į){if(Ǐ<=į)return Ǎ;return Ǎ-(Ǐ-į);}return 0;}public double ơ(){return(Ǐ/Ƭ())*100.0;}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement