Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ////Write Text To LCD v1.T//// - adapted for use in the Timber Wolf - 7/25/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 <Screen Number>"
- -Displays ARMED on the specified status LCD
- "Fire <Screen Number>"
- -Displays FIRING on the specified status LCD
- "Reload <Screen Number>"
- -Displays RELOADING on the specified status LCD
- "<Type> <Screen Number>"
- - K: Kinetic
- - HE: High Explosive
- - ECM: ECM
- - M: Mines
- EXAMPLES:
- Argument: | Result:
- --------------|-------------------------------------------
- "Fire 1" | Writes "Torpedo One: Firing" to LCD Panel - Round One
- "reload 2" | Writes "Torpedo Two: Reloading" to LCD Panel - Round Two
- "rEaDy 2" | Writes "Torpedo Two: Reloading" to LCD Panel - Round Two
- ***Note how letter case is not an issue :D (please don't type like that though...)***
- - Whiplash :)
- */
- string roundOnePanelName = "LCD Panel - Torpedo 1";
- string roundTwoPanelName = "LCD Panel - Torpedo 2";
- string panelToWrite;
- string roundNumber = "null";
- string roundStatus;
- string roundStatus_1 = "Armed";
- string roundStatus_2 = "Armed";
- string roundType;
- string roundType_1 = "Kinetic";
- string roundType_2 = "Kinetic";
- string Message;
- bool skip = true;
- 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]) //primary argument
- {
- case "fire":
- roundStatus = "Firing ";
- skip = false;
- break;
- case "reload":
- roundStatus = "Reloading";
- skip = false;
- break;
- case "ready":
- roundStatus = "Armed ";
- skip = false;
- break;
- case "k":
- roundType = "Kinetic";
- skip = false;
- break;
- case "he":
- roundType = "High Explosive";
- skip = false;
- break;
- case "ecm":
- roundType = "ECM";
- skip = false;
- break;
- case "m":
- roundType = "Mines";
- skip = false;
- break;
- default:
- skip = true;
- break;
- }
- if (skip == false)
- {
- switch(input_split[1]) //round number
- {
- case "1":
- panelToWrite = roundOnePanelName;
- roundNumber = "One";
- if (input_split[0] == "k" | input_split[0] == "he" | input_split[0] == "ecm" | input_split[0] == "m")
- {
- roundType_1 = roundType;
- }else{
- roundStatus_1 = roundStatus;
- }
- Message = "Torpedo " + roundNumber + "\n-----------------------\n Type:\n -" + roundType_1 + "\n Status:\n -" + roundStatus_1;
- break;
- case "2":
- panelToWrite = roundTwoPanelName;
- roundNumber = "Two";
- if (input_split[0] == "k" | input_split[0] == "he" | input_split[0] == "ecm" | input_split[0] == "m")
- {
- roundType_2 = roundType;
- }else{
- roundStatus_2 = roundStatus;
- }
- Message = "Torpedo " + roundNumber + "\n-----------------------\n Type:\n -" + roundType_2 + "\n Status:\n -" + roundStatus_2;
- break;
- default:
- break;
- }
- GridTerminalSystem.SearchBlocksOfName(panelToWrite,textPanels);
- for(int i=0 ; i < textPanels.Count ; i++)
- {
- IMyTextPanel panel = (IMyTextPanel) textPanels[i];
- panel.WritePublicText(Message);
- }
- }else{
- Echo ("Invalid or null input: '" + input +"'");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment