TurretConnected
Skip to content
mnscript
TurretConnected(Turret) 

Description ​

Invoked when a Turret peripheral is connected to the terminal

Arguments ​

Turret - The Turret which was connected

Example ​

msc
using Console;
using Event;
using Peripheral;
using Util;

// Registers an event listener for when turrets are connected.

function OnTurretConnected(Turret trt){
    Console.WriteLine("A turret was connected!");
    Console.WriteLine("The turret has "..Util.ToString(trt.GetAmmo()).." ammo.");
}

Event.AddListener("TurretConnected", "turrets", "OnTurretConnected");