Space Engineers

Space Engineers

Automatic LCDs 2
TuxHomer Apr 12, 2020 @ 9:09am
Change Text of one LCD Screen
Hi.
Is it possible to change the Text of a LCD Screen using the Run Command on the Programmable Bock where Automatic LCD is runing?

Example with 2 Timer blocks:

Timerblock 1:
Turn Sorter "Ore In" off
Turn Sorter "Ore Out" on
Change the Text of "LCD Ore Sorter Status [LCD]" to "Ore Output Enable"

Timerblock 2:
Turn Sorter "Ore In" on
Turn Sorter "Ore Out" off
Change the Text of "LCD Ore Sorter Status [LCD]" to "Ore input Enable"
< >
Showing 1-3 of 3 comments
Kham Apr 12, 2020 @ 9:36am 
In short, no. You can't change the commands assigned to an LCD via the run function of this script. I know there used to be scripts on the workshop which could be used to change the custom data of LCDs managed by this script but I've no idea if any of them still function.

A couple of things you could do, using the commands available in this script though.

1, Working command
Working {G:Group Name for your sorters}

This would provide a simple readout of your sorters showing if they are on or off

2, PropBool Command
PropBool {Name of Input Sorter} {OnOff} {Ore Sorting Input} {Enabled} {Disabled}
PropBool {Name of Output Sorter} {OnOff} {Ore Sorting Output} {Enabled} {Disabled}

This would display the text "Ore Sorting Input" and "Ore Sorting Output" for your sorter blocks along with toggling Enabled/Disabled based on their current on/off state.

It's maybe not quite as neat as you were hoping for, but without another script to change the commands listed in the custom data field, it's a workaround.
TuxHomer Apr 12, 2020 @ 5:52pm 
I wrote a small Script. It works fine for me.
Just Run the Programmable Bock from a Button panel or something else with the text you want.

MyCommandLine _commandLine = new MyCommandLine();

public Program()
{
Runtime.UpdateFrequency = UpdateFrequency.Once;
}

public void Main(string argument)
{

if (_commandLine.TryParse(argument))
{
string lcdtext = _commandLine.Argument(0);
IMyTextPanel LCD = GridTerminalSystem.GetBlockWithName("LCDName") as IMyTextPanel;
LCD.ContentType = ContentType.TEXT_AND_IMAGE;
LCD.FontSize = 10;
LCD.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER;
LCD.WriteText(lcdtext, false);
}
}
TuxHomer Apr 13, 2020 @ 1:34am 
Now you can change the Text of any LCD Screen. Works best with the Corner LCDs.

/* Simple Text to LCD script
* Just RUN this Script from any Timerblock etc. like this:
* LCDName LCDText
* or
* "LCD Name" "LCD Text"
* It's simple or not? :D */

MyCommandLine _commandLine = new MyCommandLine();

public Program()
{
Runtime.UpdateFrequency = UpdateFrequency.Once;
}

public void Main(string argument)
{

if (_commandLine.TryParse(argument))
{
string lcdname = _commandLine.Argument(0);
string lcdtext = _commandLine.Argument(1);
IMyTextPanel LCD = GridTerminalSystem.GetBlockWithName(lcdname) as IMyTextPanel;
LCD.ContentType = ContentType.TEXT_AND_IMAGE;
LCD.FontSize = 10;
LCD.Alignment = VRage.Game.GUI.TextPanel.TextAlignment.CENTER;
LCD.WriteText(lcdtext, false);
}
}
< >
Showing 1-3 of 3 comments
Per page: 1530 50