-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPiston Group Trial
44 lines (38 loc) · 1.07 KB
/
Piston Group Trial
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Sandbox.ModAPI.Ingame;
using System.Collections.Generic;
using VRage.Game.ModAPI.Ingame.Utilities;
namespace IngameScript
{
partial class Program : MyGridProgram
{
public Program()
{
}
public void Save()
{
}
MyCommandLine _commandLine = new MyCommandLine();
public void Main(string argument, UpdateType updateSource)
{
IMyBlockGroup piston_Group = GridTerminalSystem.GetBlockGroupWithName("Pushers");
if (piston_Group == null)
{
Echo("Group not found");
return;
}
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
piston_Group.GetBlocks(blocks);
foreach (var piston in blocks)
{
if (_commandLine.TryParse("Extend"))
{
piston.Extend();
}
if (_commandLine.TryParse("Reverse"))
{
piston.Retract();
}
}
}
}
}