Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Write Text To LCD v1.G - adapted for use in the AAM Gladius - 7/23/15 - Whiplash141
- --------------------------------------------------------------------------------------
- DESCRIPTION:
- This script will display the status of the Gladius' main guns onto
- LCD readouts :)
- SETUP:
- Run this script with the arguments below to update the screen status
- ARGUMENTS:
- Arguments can be input manually via the control panel or saved and triggered on
- demand via timers.
- All these arguments should be entered without quotes!
- "Ready <Round Number>"
- -Displays ARMED on the specified status LCD
- "Fire <Round Number>"
- -Displays FIRING on the specified status LCD
- "Reload <Round Number>"
- -Displays RELOADING on the specified status LCD
- EXAMPLES:
- Argument: | Result:
- --------------|-------------------------------------------
- "Fire 1" | Writes "Round One: Firing" to LCD Panel - Round One Status
- "reload 3" | Writes "Round Three: Reloading" to LCD Panel - Round Three Status
- "rEaDy 2" | Writes "Round Two: Reloading" to LCD Panel - Round Two Status
- ***Note how letter case is not an issue :D (please don't type like that though...)***
- Feel free to shoot me questions/suggestions
- - Whiplash :) - https://steamcommunity.com/id/Whiplash141
- */
- string roundStatus;
- string roundOnePanelName = "LCD Panel - Round One Status";
- string roundTwoPanelName = "LCD Panel - Round Two Status";
- string roundThreePanelName = "LCD Panel - Round Three Status";
- string panelToWrite;
- string roundNumber;
- List<IMyTerminalBlock> textPanels = new List<IMyTerminalBlock>();
- void Main(string input)
- {
- string input_lower = input.ToLower();
- string[] input_split = input_lower.Split(' ');
- switch (input_split[0])
- {
- case "fire":
- roundStatus = " Firing";
- break;
- case "reload":
- roundStatus = " Reloading";
- break;
- case "ready":
- roundStatus = " Armed";
- break;
- default:
- break;
- }
- switch(input_split[1])
- {
- case "1":
- panelToWrite = roundOnePanelName;
- roundNumber = "One";
- break;
- case "2":
- panelToWrite = roundTwoPanelName;
- roundNumber = "Two";
- break;
- case "3":
- panelToWrite = roundThreePanelName;
- roundNumber = "Three";
- break;
- default:
- break;
- }
- string Message =" \n Round "+ roundNumber + ":\n" + roundStatus;
- GridTerminalSystem.SearchBlocksOfName(panelToWrite,textPanels);
- for(int i=0 ; i < textPanels.Count ; i++)
- {
- IMyTextPanel panel = (IMyTextPanel) textPanels[i];
- panel.WritePublicText(Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement