summaryrefslogtreecommitdiff
path: root/src/role.offender.js
blob: fc5196d03df59fcdf158ca8150a6fd3d49d019a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
module.exports = {
  run: (creep) => {
    const hostiles = creep.room.find(FIND_HOSTILE_CREEPS);
    if (hostiles.length > 0) {
      if (creep.attack(hostiles[0]) == ERR_NOT_IN_RANGE) {
        move(creep, hostiles[0]);
      }
    }
  }
};