Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //x3,1,#test,22[5]2:255:0:0[7]%,y,,1.1.1
- // Above is your LOAD LINE. Copy it into Visual Script Builder to load your script.
- // dco.pe/vsb
- void Main(string argument)
- {
- // block declarations
- string ERR_TXT = "";
- List<IMyTerminalBlock> v0 = new List<IMyTerminalBlock>();
- if(GridTerminalSystem.GetBlockGroupWithName("test") != null) {
- GridTerminalSystem.GetBlockGroupWithName("test").GetBlocksOfType<IMyInteriorLight>(v0, filterThis);
- if(v0.Count == 0) {
- ERR_TXT += "group test has no Interior Light blocks\n";
- }
- }
- else {
- ERR_TXT += "group test not found\n";
- }
- // display errors
- if(ERR_TXT != "") {
- Echo("Script Errors:\n"+ERR_TXT+"(make sure block ownership is set correctly)");
- return;
- }
- else {Echo("");}
- // logic
- foreach(IMyInteriorLight interiorLight in v0) {
- interiorLight.Color = new Color(255, 0, 0);
- }
- }
- bool filterThis(IMyTerminalBlock block) {
- return block.CubeGrid == Me.CubeGrid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement