Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Meridius_IX's Simple Antenna Communication Script
- string antenna_name = "Antenna"; //Change this to the name of the antenna you are using to broadcast from.
- string timer_name = "Timer Block"; //Change this to the name of the timer block you want to trigger on the receiving end.
- string receiver_command = "Trigger Timer"; //This string will be used as the argument to trigger the receiving programmable block.
- void Main(string argument){
- if(argument == receiver_command){
- //Receiver Actions
- IMyTimerBlock timer = GridTerminalSystem.GetBlockWithName(timer_name) as IMyTimerBlock;
- if(timer != null){
- timer.ApplyAction("TriggerNow");
- }
- return;
- }else{
- //Transmitter Actions
- IMyRadioAntenna antenna = GridTerminalSystem.GetBlockWithName(antenna_name) as IMyRadioAntenna;
- if(antenna != null){
- bool transmit = antenna.TransmitMessage(receiver_command);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement