Whiplash141

Whip's Timer Trigger

Nov 7th, 2015
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. /*
  2. /// Timer activaton script - 11/7/2015 ///
  3. Input the timer's name into the argument and hit run
  4. - Whiplash141
  5. */
  6.  
  7. void Main( string timerName )
  8. {
  9.     List<IMyTerminalBlock> timersToTrigger = new List<IMyTerminalBlock>();
  10.     GridTerminalSystem.SearchBlocksOfName( timerName, timersToTrigger );
  11.     for( int i = 0; i < timersToTrigger.Count; i++ )
  12.     {
  13.         var thisTimer = timersToTrigger[i] as IMyTimerBlock;
  14.         thisTimer.ApplyAction("TriggerNow");
  15.         Echo("Timer " + timerName + " triggered");
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment