Determine who attacked me



  • Some player wrecked my base while I was asleep, I got several emails about my creeps being under attack, but they don't indicate whom attacked it.
    Is there a way to find out who is the attacking player?


  • Dev Team

    You can use a script like this:

    var hostilesCount = {};
    
    creep.room.find(FIND_HOSTILE_CREEPS, { filter: function(i) { 
        if(i.owner.username != 'Source Keeper') {
            hostilesCount[i.owner.username] = hostilesCount[i.owner.username] || 0;
            hostilesCount[i.owner.username]++;
        }
    }});
    
    for(var user in hostilesCount) {
        Game.notify(hostilesCount[user] + ' enemies spotted: user ' + user + ' in room ' + creep.room.name);
    }
    


  • Statistically, It was very likely me.



  • Judging from the position on the map, it can't have been you, nugarin. But did you finally find out, who attacked you, DarkTrooper?