Guest User

Secure Door- Code Reset

a guest
Jun 10th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. /*
  2.  
  3. resets the codes generated by the code generator
  4.  
  5. */
  6.  
  7. const string codeStorage = "[CODE]"; //the name of the text panel that saves the codeStorage
  8.  
  9. void Main ()
  10. {
  11.     //finds the codeStorage text panel
  12.     var storageBlocks = new List<IMyTerminalBlock>();
  13.     GridTerminalSystem.SearchBlocksOfName (codeStorage, storageBlocks);
  14.     var storageList = new List <IMyTextPanel>();
  15.     for(int i = 0; i < storageBlocks.Count; i++)
  16.     {
  17.         IMyTextPanel panel = storageBlocks[i] as IMyTextPanel;
  18.         storageList.Add (panel);
  19.     }
  20.     //clears private and pubic text
  21.     for(int i = 0; i < storageList.Count; i++)
  22.     {
  23.         storageList[i].WritePublicText("", false);
  24.         storageList[i].WritePrivateText("", false);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment