Advertisement
Whiplash141

Whiplash's Gravity Gun Status Indicator - Gladius

Jul 23rd, 2015
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.10 KB | None | 0 0
  1.  /*  
  2. Write Text To LCD v1.G - adapted for use in the AAM Gladius - 7/23/15 - Whiplash141
  3. --------------------------------------------------------------------------------------  
  4. DESCRIPTION:  
  5. This script will display the status of the Gladius' main guns onto  
  6. LCD readouts :)  
  7.  
  8. SETUP:  
  9. Run this script with the arguments below to update the screen status      
  10.  
  11. ARGUMENTS:
  12. Arguments can be input manually via the control panel or saved and triggered on
  13. demand via timers.
  14. All these arguments should be entered without quotes!  
  15.  
  16. "Ready <Round Number>"  
  17.     -Displays ARMED on the specified status LCD  
  18.      
  19. "Fire <Round Number>"
  20.     -Displays FIRING on the specified status LCD  
  21.  
  22. "Reload <Round Number>"
  23.     -Displays RELOADING on the specified status LCD  
  24.      
  25. EXAMPLES:
  26. Argument:  |   Result:      
  27.   --------------|-------------------------------------------
  28. "Fire 1"        |   Writes "Round One: Firing" to LCD Panel - Round One Status
  29. "reload 3"   |   Writes "Round Three: Reloading" to LCD Panel - Round Three Status
  30. "rEaDy 2"   |   Writes "Round Two: Reloading" to LCD Panel - Round Two Status
  31.  
  32. ***Note how letter case is not an issue :D (please don't type like that though...)***
  33.  
  34. Feel free to shoot me questions/suggestions
  35.     - Whiplash :) - https://steamcommunity.com/id/Whiplash141
  36.  */  
  37.  
  38. string roundStatus;  
  39. string roundOnePanelName = "LCD Panel - Round One Status";  
  40. string roundTwoPanelName = "LCD Panel - Round Two Status";  
  41. string roundThreePanelName = "LCD Panel - Round Three Status";  
  42. string panelToWrite;  
  43. string roundNumber;
  44.  
  45. List<IMyTerminalBlock> textPanels = new List<IMyTerminalBlock>();  
  46.      
  47. void Main(string input)  
  48. {      
  49.     string input_lower = input.ToLower();  
  50.     string[] input_split = input_lower.Split(' ');  
  51.      
  52.      
  53.     switch (input_split[0])  
  54.     {  
  55.         case "fire":  
  56.             roundStatus = "         Firing";  
  57.             break;  
  58.              
  59.         case "reload":  
  60.             roundStatus = "         Reloading";  
  61.             break;  
  62.  
  63.         case "ready":  
  64.             roundStatus = "         Armed";  
  65.             break;  
  66.              
  67.         default:  
  68.             break;
  69.     }  
  70.      
  71.     switch(input_split[1])  
  72.     {  
  73.         case "1":              
  74.             panelToWrite = roundOnePanelName;  
  75.             roundNumber = "One";
  76.             break;  
  77.              
  78.         case "2":  
  79.             panelToWrite = roundTwoPanelName;  
  80.             roundNumber = "Two";
  81.             break;  
  82.              
  83.         case "3":  
  84.             panelToWrite = roundThreePanelName;  
  85.             roundNumber = "Three";
  86.             break;  
  87.          
  88.         default:
  89.             break;  
  90.     }  
  91.  
  92.     string Message =" \n        Round "+ roundNumber + ":\n" + roundStatus;  
  93.  
  94.     GridTerminalSystem.SearchBlocksOfName(panelToWrite,textPanels);    
  95.     for(int i=0 ; i < textPanels.Count ; i++)    
  96.     {    
  97.         IMyTextPanel panel = (IMyTextPanel) textPanels[i];      
  98.         panel.WritePublicText(Message);      
  99.     }      
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement