blob: 91d131ed864c43c2bb4469c796b7d5e600902d08 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
const util = require('creep');
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) {
util.move(creep, hostiles[0]);
}
}
}
};
|