Overview
This is the manuel for “Multi Lcd Config” by Twotwinbrothers
Introduction
This Script is a manual for a Ingame Script:
[link]
This Script allow you to change between Text, texture, font color, font size, etc.
In this Manual i try to explain how to adjust every slider on a text panel with the programmable block ,timers and how to run an other programmable block whit Argument
A little knowledge of scripting is useful, This is not a plug en play script
You have to modify it to youre needs.
Thing to change in code are Underlined
enjoy.
Twotwinbrother
Getting started
This is a line where you can change the name for “argument.”
arg = abbreviation for “argument”
Next part of code is for adding/remove a item name to all connected block (exp. blocks that have not the same ownership) This will prevent that two block with the same name on separate grids when connected will act as one.
Example:
Two seperate grids that can be connected.( ship and station)
One has a block called “door”.
Second has a block also called “door” .
Wen conected you dont want that both doors to open at the same time
- Disconnect connector
- Change “[STATION] ” in how you wand to name your item
- Wen jou run this script with argument “install” it will add “[STATION] ” to all connected blocks
- Wen jou run this script with argument “uninstall” it will remove “[STATION] ” to all connected blocks when it is part of its name
if(arg == “instal”){
if(!term.CustomName.Contains(itemname) ){
term.CustomName =(itemname + term.CustomName);
Echo (term + ” installed”);
}}
if(arg == “uninstal”){
if(term.CustomName.Contains(itemname) ){
term.CustomName = (term.CustomName.Replace (itemname,”” ));
Echo (term + ” uninstalled”);
}}}
How do you build you code
There are two way to cal a lcd
- Whit a tag.use “Cal lcd whit tag” code
- Whit its full name. use “Cal lcd whit name” (This wil limets the things you can change, but is easyer to use)
whit tag i call my lcd this way :
lcd [0] [1]
lcd [0] [2]
lcd [0] [3]
“lcd” you can change to everything. Can be same so long there is a diference in the tag thay have
[0] tag can be use wen you want to change te same thing on all the lcd. don’t use it to change the name.
other tag are only for the lcd that have the tag
Cal Block with tag
- Change “list” in:
“list0” for tag [0]
“list1” for tag [1] - Change “IMyTextPanel” in :
“IMyTimerBlock” for Timers
“IMyProgrammableBlock” for PB - Change “lcd”
- Between ” ” is the tag
if(lcd.CustomName.Contains(itemname)){ //”itemname” is specified on top of script
if(lcd.CustomName.Contains(“[0]“)){ [/code]
Cal Block with name
- Change “lcd” in:
Pb for Programmeble Block - put the full name of the block between ” “
- Change “IMyTextPanel” in:
“IMyTimerBlock” for Timers
“IMyProgrammableBlock” for PB - In the argument list, use a “?” After lcd, this will prevent script crash when block is missing.
Lot of the code line cannot be used wen you cannot change te name,
keep that in mind wen u use this one
how to make arg list
- First arg line begins whit “if” the next “else if”
- “1” = the arg you put under youre butten.
- “1” = after “Echo” is argument name this will be shown “DetailedInfo” box in the terminal menu
Function for Terminal Block
Function for Terminal Block
OnOff | OnOff_0n | OnOff_0ff
- “term” = Change name in how it will called in script
- change: OnOff
action nameexplanation“OnOff”will turn on wen off en off wen on“OnOff_On”will turn on“OnOff_Off”will turn off
Show in Terminal
- “term” = Change name in how it will called in script
- change: true
action nameexplanationtrueShowInTerminal onfalseShowInTerminal off
ShowInInventory
ShowInInventory only exist if block have an inventory
- “term” = Change name in how it will called in script
- change: true
action nameexplanationtrueShowInInventory onfalseShowInInventory off
ShowInToolbarConfig
- “term” = Change name in how it will called in script
- change: true
action nameexplanationtrueShowInToolbarConfig onfalseShowInToolbarConfig off
Change Name
- “name” can be change to everything
- after the name are the tags
This way you can remove a tag and replaced it.
It is sometimes necessary to turn off a script on a LCD
This code will not work wen you use “Cal lcd whit name” code, because it wil change the name of lcd
ShowOnHUD
- “term” = Change name in how it will called in script
- change: true
action nameexplanationtrueShowOnHUD onfalseShowOnHUD off
Write CustomData
Write CustomData
- “Me” = Change name in how it will called in script
- center power n Power; Powertime; = This is the text that the script write in you text panel customdata box.
- ” n ” = End Command And/or Enter ( next line)
- “; ” = End Command
Add to CustomData
- “Me” = Change name in how it will called in script
- “text” = text that you want to add
Replace / Remove to CustomData
- “Me” = Change name in how it will called in script
- “text 1” = text to replace/remove.
- “text 2” = text to replace/remove in. remove everthing between quotes to remove
I use it al lot whit “MMaster Configurable Automatic LCDs V.2
Extra Function for PB
Extra Function for PB
Run Agument
- “PBalert” = Change name in how it will called in script
“PBalert” in “Me” = to run the programmeble where this script is running on - “Green” = Place here the arg
Run PB without Timer
Add code
Before
Exrta function for Timer
Exrta function for Timer
start | stop | TriggerNow | IncreaseTriggerDelay | DecreaseTriggerDelay
- “Tsaver” = Change name in how it will called in script
- change:
action nameexplanation“Start”will start after set time“Stop”will stop“TriggerNow”will trigger“IncreaseTriggerDelay”Increase Delay“DecreaseTriggerDelay”Decrease Delay
TriggerDelay
- “Tsaver” = Change name in how it will called in script
- “10f” = Place a number between 1f t/m 3600f
1f = 1 sec.
60f = 1 min.
3600f = 1 hour. [max time whit Vannilla)
Exrta function for Textpanel / LCD
Exrta function for Textpanel / LCD
Write Public Title
- “lcd” = Change name in how it will called in script
- “Power” = This is the command that the script write in
you text panel Public Title box.
I use it al lot whit “MMaster Configurable Automatic LCDs V. 1”
will not work whit “MMaster Configurable Automatic LCDs V.2”
because i will only use “customdata”
Write Public Text
- “lcd” = Change name in how it will called in script
- “hello bye” = This is the text that the script write in you text panel Public text box.
can not use it whit “MMaster Configurable Automatic LCDs” on remove “LCD” tag - “n” = next line
write PublicText whit CustomData
- “lcd” = Change name in how it will called in script
- “Me” = make it “lcd” if you want it to take it from Customdata of the same lcd
“Me” wil take from this Programmeble block
can not use it whit “MMaster Configurable Automatic LCDs” on,
Remove [LCD] tag first whit “Change Name” code
Show text to picture
- “lcd” = Change name in how it will called in script
- ShowTextureOnScreen() Change:
Public text = ShowPublicTextOnScreen();
textures = ShowTextureOnScreen();
can not use it whit “MMaster Configurable Automatic LCDs” on, it wil simple overwrite it
Remove [LCD] tag first whit “Change Name” code
Font
- “lcd” = Change name in how it will called in script
- “Monospace” = Change name to Font name
Font Size
- “lcd” = Change name in how it will called in script
- “1.0f” = Change Font size 0.1 t/m 10.0
Font Color
- “lcd” = Change name in how it will called in script
- “255, 255, 255” = Change Font color 0 – 255
Wit = 255, 255, 255
Bleu = 0, 0, 255
Red = 255, 0, 0
Green = 0, 255, 0
Bleu = 0, 0, 255
BackGround Color
- “lcd” = Change name in how it will called in script
- “255, 255, 255” = Change Font color 0 – 255
Black = 0, 0, 0
Wit = 255, 255, 255
Add image to selection
- place all the textures above: “void Main(string arg)” like: string[] arrow = {“Arrow”, “Cross” };
- “textures” = Chance name of the string.
- “Arrow” = first texture that will be shown
- place comma space “, ” between the two texture names
- “Cross” = second Texture
string[] textures = {“Arrow“, “Cross” }; void Main(string arg){ }// Vannila Texture list string[] Online = {“Online”}; string[] Offline = {“Offline”}; string[] Arrow = {“Arrow”}; string[] Cross = {“Cross”}; string[] Danger = {“Danger”}; string[] NoEntry = {“No Entry”}; string[] Construction = {“Construction”}; string[] Whitescreen = {“White screen”}; - place in arg list. ( these line can be put in the “[0]” tag so it will be done to all the lcd.)
lcd.ClearImagesFromSelection(); <– Removes al the Textures lcd.SetShowOnScreen(Sandbox.Common.ObjectBuilders.ShowTextOnScreenFlag.NONE); lcd.SetValue(“ChangeIntervalSlider”, 0.1f ); <– will change the Interval time
Don’t put the following lines in Tag that are used in more then one lcd (example “[0]” tag )
lcd.SetCustomName(“Left [0] [1]”); <– dont forget remove the [LCD] tag- “arrow” = Place the String name
- “false” = dont change in “true” give a lot of problems like:
Interval freese
Remove of texture wen thay alreade are there - “lcd” = Change name in how it will called in script
target = new List <string>(arrow); lcd.AddImagesToSelection(target, false);
Remove all image
- “lcd” = Change name in how it will called in script
Live Camera Feeds
There is a mod :
[link]
it make camera textures,
there i s a little problem whit it, that is that the id is so long that you can see the whole name.
so if you want to change between feeds there is a work around:
- place the textures manuely in textpanel
- make two buttens:
Button 1 : Run PB multi whit arg ” 6 ” (without quotes)
Button 2 : Run PB multi whit arg ” 7 ” (without quotes)
- arg “6” will change interval time to 2 sec.
- arg “7” will change interval time to 0 sec. ( there is no interval.)
Wen the feed you want to see is there you puch on the butten whit arg “7”.
then it wil stay on that feed.
if(lcd.CustomName.Contains(itemname)){
if(pblcd.CustomName.Contains(“[cam]”)){
if( “6”.Equals(arg) ){
lcd.SetValue(“ChangeIntervalSlider”, 2.0f );
}
else if( “7”.Equals(arg) ){
lcd.SetValue(“ChangeIntervalSlider”, 0.0f );
}
}}