SHARE
TWEET

SE Nanite Factory - Status on LCD 1.0 (ENG)

scadl Jun 24th, 2016 (edited) 153 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void Main(string argument) {
  2.    
  3.         var nf = GridTerminalSystem.GetBlockWithName("Nanite Control Factory "+argument) as IMyTerminalBlock;
  4.         string[] NFStat = {""};
  5.         if ( nf != null ){
  6.             NFStat = nf.CustomInfo.Split('\n');
  7.         }
  8.        
  9.         var ld = GridTerminalSystem.GetBlockWithName("LCD-NanitePanel_"+argument) as IMyTextPanel;
  10.         ld.WritePublicText("", false);
  11.         ld.WritePublicText("-= Nanite Factory =- \n", false);
  12.          
  13.         for ( int i=0; i<NFStat.Length; i++){
  14.  
  15.             if ( NFStat[i].IndexOf("Status") >= 0 ){  
  16.                 ld.WritePublicText( "Status: " + NFStat[i].Split(':')[1] + "\n", true);  
  17.             }
  18.             if ( NFStat[i].IndexOf("Active Nanites") >= 0 ){  
  19.                 ld.WritePublicText( "Active: " + NFStat[i].Split(':')[1] + "\n", true);  
  20.             }
  21.             if ( NFStat[i].IndexOf("Current Power") >= 0 ){  
  22.                 ld.WritePublicText( "--<Status>--\nPower: " + NFStat[i].Split(':')[1] + "\n", true);  
  23.             }
  24.                
  25.             if ( NFStat[i].IndexOf("Possible Construction") >= 0 ){
  26.                 ld.WritePublicText( "--<Tasks>--\nTo Construct: " + NFStat[i].Split(':')[1] + " blocks\n", true);
  27.             }
  28.             if ( NFStat[i].IndexOf("Possible Deconstruction") >= 0 ){
  29.                 ld.WritePublicText( "To DeConst: " + NFStat[i].Split(':')[1] + " blocks\n", true);
  30.             }
  31.             if ( NFStat[i].IndexOf("Possible Floating") >= 0 ){
  32.                 ld.WritePublicText( "To Gather: " + NFStat[i].Split(':')[1] + " pieces\n", true);
  33.             }
  34.             if ( NFStat[i].IndexOf("Possible Projection") >= 0 ){
  35.                 ld.WritePublicText( "To Build: " + NFStat[i].Split(':')[1] + " blocks\n", true);
  36.             }
  37.  
  38.             if ( NFStat[i].IndexOf("Missing components") >= 0 ){
  39.                 ld.WritePublicText( "---------------\nRequiered: \n", true);
  40.                 for ( int j=i+1; j<NFStat.Length-1; j++ ){                  
  41.                     ld.WritePublicText( "[" + NFStat[j] + "]\n", true);
  42.                 }
  43.             }
  44.  
  45.             if  ( NFStat[0] == "" ){
  46.                 ld.WritePublicText("You don't have Nanite Control Factory,\n or you named it incorrectly\n", false);  
  47.                 ld.WritePublicText("Check the mod's description, to know what's wrong...\n ", true);
  48.             }
  49.  
  50.         }
  51.  
  52. }
RAW Paste Data
Top