Example #1
0
    public void doWork()
    {
        VRage.MyFixedPoint newAmmo = turrets.Items().OfType("NATO_25x184mm").Count();
        newAmmo = newAmmo + turrets.Items().OfType("Missile200mm").Count();

        if (newAmmo < ammo)
        {
            string timestamp = DateTime.UtcNow.AddHours(3).ToString("dd.MM.yyyy HH:mm:ss");
            log.SetText("[" + timestamp + "] Attack detected, fired " + (ammo - newAmmo) + " ammo; Remaining: " + newAmmo + "\n" + log.screen.GetPublicText());
            beacon.SetName("!!! Attack detected at " + timestamp + " !!!");
        }

        ammo = newAmmo;
        storage.setStorage(ammo.ToString());
    }